file_path
stringlengths
21
224
content
stringlengths
0
80.8M
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/srv/__init__.py
from control_msgs.srv._query_calibration_state import QueryCalibrationState # noqa: F401 from control_msgs.srv._query_trajectory_state import QueryTrajectoryState # noqa: F401
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/srv/_query_trajectory_state.py
# generated from rosidl_generator_py/resource/_idl.py.em # with input from control_msgs:srv/QueryTrajectoryState.idl # generated code does not contain a copyright notice # Import statements for member types import rosidl_parser.definition # noqa: E402, I100 class Metaclass_QueryTrajectoryState_Request(type): """Metaclass of message 'QueryTrajectoryState_Request'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.srv.QueryTrajectoryState_Request') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__srv__query_trajectory_state__request cls._CONVERT_FROM_PY = module.convert_from_py_msg__srv__query_trajectory_state__request cls._CONVERT_TO_PY = module.convert_to_py_msg__srv__query_trajectory_state__request cls._TYPE_SUPPORT = module.type_support_msg__srv__query_trajectory_state__request cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__srv__query_trajectory_state__request from builtin_interfaces.msg import Time if Time.__class__._TYPE_SUPPORT is None: Time.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class QueryTrajectoryState_Request(metaclass=Metaclass_QueryTrajectoryState_Request): """Message class 'QueryTrajectoryState_Request'.""" __slots__ = [ '_time', ] _fields_and_field_types = { 'time': 'builtin_interfaces/Time', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['builtin_interfaces', 'msg'], 'Time'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from builtin_interfaces.msg import Time self.time = kwargs.get('time', Time()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.time != other.time: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def time(self): """Message field 'time'.""" return self._time @time.setter def time(self, value): if __debug__: from builtin_interfaces.msg import Time assert \ isinstance(value, Time), \ "The 'time' field must be a sub message of type 'Time'" self._time = value # Import statements for member types # Member 'position' # Member 'velocity' # Member 'acceleration' import array # noqa: E402, I100 # already imported above # import rosidl_parser.definition class Metaclass_QueryTrajectoryState_Response(type): """Metaclass of message 'QueryTrajectoryState_Response'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.srv.QueryTrajectoryState_Response') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__srv__query_trajectory_state__response cls._CONVERT_FROM_PY = module.convert_from_py_msg__srv__query_trajectory_state__response cls._CONVERT_TO_PY = module.convert_to_py_msg__srv__query_trajectory_state__response cls._TYPE_SUPPORT = module.type_support_msg__srv__query_trajectory_state__response cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__srv__query_trajectory_state__response @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class QueryTrajectoryState_Response(metaclass=Metaclass_QueryTrajectoryState_Response): """Message class 'QueryTrajectoryState_Response'.""" __slots__ = [ '_success', '_message', '_name', '_position', '_velocity', '_acceleration', ] _fields_and_field_types = { 'success': 'boolean', 'message': 'string', 'name': 'sequence<string>', 'position': 'sequence<double>', 'velocity': 'sequence<double>', 'acceleration': 'sequence<double>', } SLOT_TYPES = ( rosidl_parser.definition.BasicType('boolean'), # noqa: E501 rosidl_parser.definition.UnboundedString(), # noqa: E501 rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.UnboundedString()), # noqa: E501 rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.BasicType('double')), # noqa: E501 rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.BasicType('double')), # noqa: E501 rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.BasicType('double')), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.success = kwargs.get('success', bool()) self.message = kwargs.get('message', str()) self.name = kwargs.get('name', []) self.position = array.array('d', kwargs.get('position', [])) self.velocity = array.array('d', kwargs.get('velocity', [])) self.acceleration = array.array('d', kwargs.get('acceleration', [])) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.success != other.success: return False if self.message != other.message: return False if self.name != other.name: return False if self.position != other.position: return False if self.velocity != other.velocity: return False if self.acceleration != other.acceleration: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def success(self): """Message field 'success'.""" return self._success @success.setter def success(self, value): if __debug__: assert \ isinstance(value, bool), \ "The 'success' field must be of type 'bool'" self._success = value @property def message(self): """Message field 'message'.""" return self._message @message.setter def message(self, value): if __debug__: assert \ isinstance(value, str), \ "The 'message' field must be of type 'str'" self._message = value @property def name(self): """Message field 'name'.""" return self._name @name.setter def name(self, value): if __debug__: from collections.abc import Sequence from collections.abc import Set from collections import UserList from collections import UserString assert \ ((isinstance(value, Sequence) or isinstance(value, Set) or isinstance(value, UserList)) and not isinstance(value, str) and not isinstance(value, UserString) and all(isinstance(v, str) for v in value) and True), \ "The 'name' field must be a set or sequence and each value of type 'str'" self._name = value @property def position(self): """Message field 'position'.""" return self._position @position.setter def position(self, value): if isinstance(value, array.array): assert value.typecode == 'd', \ "The 'position' array.array() must have the type code of 'd'" self._position = value return if __debug__: from collections.abc import Sequence from collections.abc import Set from collections import UserList from collections import UserString assert \ ((isinstance(value, Sequence) or isinstance(value, Set) or isinstance(value, UserList)) and not isinstance(value, str) and not isinstance(value, UserString) and all(isinstance(v, float) for v in value) and True), \ "The 'position' field must be a set or sequence and each value of type 'float'" self._position = array.array('d', value) @property def velocity(self): """Message field 'velocity'.""" return self._velocity @velocity.setter def velocity(self, value): if isinstance(value, array.array): assert value.typecode == 'd', \ "The 'velocity' array.array() must have the type code of 'd'" self._velocity = value return if __debug__: from collections.abc import Sequence from collections.abc import Set from collections import UserList from collections import UserString assert \ ((isinstance(value, Sequence) or isinstance(value, Set) or isinstance(value, UserList)) and not isinstance(value, str) and not isinstance(value, UserString) and all(isinstance(v, float) for v in value) and True), \ "The 'velocity' field must be a set or sequence and each value of type 'float'" self._velocity = array.array('d', value) @property def acceleration(self): """Message field 'acceleration'.""" return self._acceleration @acceleration.setter def acceleration(self, value): if isinstance(value, array.array): assert value.typecode == 'd', \ "The 'acceleration' array.array() must have the type code of 'd'" self._acceleration = value return if __debug__: from collections.abc import Sequence from collections.abc import Set from collections import UserList from collections import UserString assert \ ((isinstance(value, Sequence) or isinstance(value, Set) or isinstance(value, UserList)) and not isinstance(value, str) and not isinstance(value, UserString) and all(isinstance(v, float) for v in value) and True), \ "The 'acceleration' field must be a set or sequence and each value of type 'float'" self._acceleration = array.array('d', value) class Metaclass_QueryTrajectoryState(type): """Metaclass of service 'QueryTrajectoryState'.""" _TYPE_SUPPORT = None @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.srv.QueryTrajectoryState') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._TYPE_SUPPORT = module.type_support_srv__srv__query_trajectory_state from control_msgs.srv import _query_trajectory_state if _query_trajectory_state.Metaclass_QueryTrajectoryState_Request._TYPE_SUPPORT is None: _query_trajectory_state.Metaclass_QueryTrajectoryState_Request.__import_type_support__() if _query_trajectory_state.Metaclass_QueryTrajectoryState_Response._TYPE_SUPPORT is None: _query_trajectory_state.Metaclass_QueryTrajectoryState_Response.__import_type_support__() class QueryTrajectoryState(metaclass=Metaclass_QueryTrajectoryState): from control_msgs.srv._query_trajectory_state import QueryTrajectoryState_Request as Request from control_msgs.srv._query_trajectory_state import QueryTrajectoryState_Response as Response def __init__(self): raise NotImplementedError('Service classes can not be instantiated')
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/srv/_query_calibration_state_s.c
// generated from rosidl_generator_py/resource/_idl_support.c.em // with input from control_msgs:srv/QueryCalibrationState.idl // generated code does not contain a copyright notice #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include <Python.h> #include <stdbool.h> #ifndef _WIN32 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-function" #endif #include "numpy/ndarrayobject.h" #ifndef _WIN32 # pragma GCC diagnostic pop #endif #include "rosidl_runtime_c/visibility_control.h" #include "control_msgs/srv/detail/query_calibration_state__struct.h" #include "control_msgs/srv/detail/query_calibration_state__functions.h" ROSIDL_GENERATOR_C_EXPORT bool control_msgs__srv__query_calibration_state__request__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[72]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.srv._query_calibration_state.QueryCalibrationState_Request", full_classname_dest, 71) == 0); } control_msgs__srv__QueryCalibrationState_Request * ros_message = _ros_message; ros_message->structure_needs_at_least_one_member = 0; return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__srv__query_calibration_state__request__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of QueryCalibrationState_Request */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.srv._query_calibration_state"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "QueryCalibrationState_Request"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } (void)raw_ros_message; // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/srv/detail/query_calibration_state__struct.h" // already included above // #include "control_msgs/srv/detail/query_calibration_state__functions.h" ROSIDL_GENERATOR_C_EXPORT bool control_msgs__srv__query_calibration_state__response__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[73]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.srv._query_calibration_state.QueryCalibrationState_Response", full_classname_dest, 72) == 0); } control_msgs__srv__QueryCalibrationState_Response * ros_message = _ros_message; { // is_calibrated PyObject * field = PyObject_GetAttrString(_pymsg, "is_calibrated"); if (!field) { return false; } assert(PyBool_Check(field)); ros_message->is_calibrated = (Py_True == field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__srv__query_calibration_state__response__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of QueryCalibrationState_Response */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.srv._query_calibration_state"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "QueryCalibrationState_Response"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__srv__QueryCalibrationState_Response * ros_message = (control_msgs__srv__QueryCalibrationState_Response *)raw_ros_message; { // is_calibrated PyObject * field = NULL; field = PyBool_FromLong(ros_message->is_calibrated ? 1 : 0); { int rc = PyObject_SetAttrString(_pymessage, "is_calibrated", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; }
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/action/_joint_trajectory_s.c
// generated from rosidl_generator_py/resource/_idl_support.c.em // with input from control_msgs:action/JointTrajectory.idl // generated code does not contain a copyright notice #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include <Python.h> #include <stdbool.h> #ifndef _WIN32 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-function" #endif #include "numpy/ndarrayobject.h" #ifndef _WIN32 # pragma GCC diagnostic pop #endif #include "rosidl_runtime_c/visibility_control.h" #include "control_msgs/action/detail/joint_trajectory__struct.h" #include "control_msgs/action/detail/joint_trajectory__functions.h" ROSIDL_GENERATOR_C_IMPORT bool trajectory_msgs__msg__joint_trajectory__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * trajectory_msgs__msg__joint_trajectory__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__joint_trajectory__goal__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[59]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._joint_trajectory.JointTrajectory_Goal", full_classname_dest, 58) == 0); } control_msgs__action__JointTrajectory_Goal * ros_message = _ros_message; { // trajectory PyObject * field = PyObject_GetAttrString(_pymsg, "trajectory"); if (!field) { return false; } if (!trajectory_msgs__msg__joint_trajectory__convert_from_py(field, &ros_message->trajectory)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__joint_trajectory__goal__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of JointTrajectory_Goal */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._joint_trajectory"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "JointTrajectory_Goal"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__JointTrajectory_Goal * ros_message = (control_msgs__action__JointTrajectory_Goal *)raw_ros_message; { // trajectory PyObject * field = NULL; field = trajectory_msgs__msg__joint_trajectory__convert_to_py(&ros_message->trajectory); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "trajectory", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/joint_trajectory__struct.h" // already included above // #include "control_msgs/action/detail/joint_trajectory__functions.h" ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__joint_trajectory__result__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[61]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._joint_trajectory.JointTrajectory_Result", full_classname_dest, 60) == 0); } control_msgs__action__JointTrajectory_Result * ros_message = _ros_message; ros_message->structure_needs_at_least_one_member = 0; return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__joint_trajectory__result__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of JointTrajectory_Result */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._joint_trajectory"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "JointTrajectory_Result"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } (void)raw_ros_message; // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/joint_trajectory__struct.h" // already included above // #include "control_msgs/action/detail/joint_trajectory__functions.h" ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__joint_trajectory__feedback__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[63]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._joint_trajectory.JointTrajectory_Feedback", full_classname_dest, 62) == 0); } control_msgs__action__JointTrajectory_Feedback * ros_message = _ros_message; ros_message->structure_needs_at_least_one_member = 0; return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__joint_trajectory__feedback__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of JointTrajectory_Feedback */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._joint_trajectory"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "JointTrajectory_Feedback"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } (void)raw_ros_message; // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/joint_trajectory__struct.h" // already included above // #include "control_msgs/action/detail/joint_trajectory__functions.h" ROSIDL_GENERATOR_C_IMPORT bool unique_identifier_msgs__msg__uuid__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * unique_identifier_msgs__msg__uuid__convert_to_py(void * raw_ros_message); bool control_msgs__action__joint_trajectory__goal__convert_from_py(PyObject * _pymsg, void * _ros_message); PyObject * control_msgs__action__joint_trajectory__goal__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__joint_trajectory__send_goal__request__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[71]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._joint_trajectory.JointTrajectory_SendGoal_Request", full_classname_dest, 70) == 0); } control_msgs__action__JointTrajectory_SendGoal_Request * ros_message = _ros_message; { // goal_id PyObject * field = PyObject_GetAttrString(_pymsg, "goal_id"); if (!field) { return false; } if (!unique_identifier_msgs__msg__uuid__convert_from_py(field, &ros_message->goal_id)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // goal PyObject * field = PyObject_GetAttrString(_pymsg, "goal"); if (!field) { return false; } if (!control_msgs__action__joint_trajectory__goal__convert_from_py(field, &ros_message->goal)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__joint_trajectory__send_goal__request__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of JointTrajectory_SendGoal_Request */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._joint_trajectory"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "JointTrajectory_SendGoal_Request"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__JointTrajectory_SendGoal_Request * ros_message = (control_msgs__action__JointTrajectory_SendGoal_Request *)raw_ros_message; { // goal_id PyObject * field = NULL; field = unique_identifier_msgs__msg__uuid__convert_to_py(&ros_message->goal_id); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "goal_id", field); Py_DECREF(field); if (rc) { return NULL; } } } { // goal PyObject * field = NULL; field = control_msgs__action__joint_trajectory__goal__convert_to_py(&ros_message->goal); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "goal", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/joint_trajectory__struct.h" // already included above // #include "control_msgs/action/detail/joint_trajectory__functions.h" ROSIDL_GENERATOR_C_IMPORT bool builtin_interfaces__msg__time__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * builtin_interfaces__msg__time__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__joint_trajectory__send_goal__response__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[72]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._joint_trajectory.JointTrajectory_SendGoal_Response", full_classname_dest, 71) == 0); } control_msgs__action__JointTrajectory_SendGoal_Response * ros_message = _ros_message; { // accepted PyObject * field = PyObject_GetAttrString(_pymsg, "accepted"); if (!field) { return false; } assert(PyBool_Check(field)); ros_message->accepted = (Py_True == field); Py_DECREF(field); } { // stamp PyObject * field = PyObject_GetAttrString(_pymsg, "stamp"); if (!field) { return false; } if (!builtin_interfaces__msg__time__convert_from_py(field, &ros_message->stamp)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__joint_trajectory__send_goal__response__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of JointTrajectory_SendGoal_Response */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._joint_trajectory"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "JointTrajectory_SendGoal_Response"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__JointTrajectory_SendGoal_Response * ros_message = (control_msgs__action__JointTrajectory_SendGoal_Response *)raw_ros_message; { // accepted PyObject * field = NULL; field = PyBool_FromLong(ros_message->accepted ? 1 : 0); { int rc = PyObject_SetAttrString(_pymessage, "accepted", field); Py_DECREF(field); if (rc) { return NULL; } } } { // stamp PyObject * field = NULL; field = builtin_interfaces__msg__time__convert_to_py(&ros_message->stamp); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "stamp", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/joint_trajectory__struct.h" // already included above // #include "control_msgs/action/detail/joint_trajectory__functions.h" ROSIDL_GENERATOR_C_IMPORT bool unique_identifier_msgs__msg__uuid__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * unique_identifier_msgs__msg__uuid__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__joint_trajectory__get_result__request__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[72]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._joint_trajectory.JointTrajectory_GetResult_Request", full_classname_dest, 71) == 0); } control_msgs__action__JointTrajectory_GetResult_Request * ros_message = _ros_message; { // goal_id PyObject * field = PyObject_GetAttrString(_pymsg, "goal_id"); if (!field) { return false; } if (!unique_identifier_msgs__msg__uuid__convert_from_py(field, &ros_message->goal_id)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__joint_trajectory__get_result__request__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of JointTrajectory_GetResult_Request */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._joint_trajectory"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "JointTrajectory_GetResult_Request"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__JointTrajectory_GetResult_Request * ros_message = (control_msgs__action__JointTrajectory_GetResult_Request *)raw_ros_message; { // goal_id PyObject * field = NULL; field = unique_identifier_msgs__msg__uuid__convert_to_py(&ros_message->goal_id); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "goal_id", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/joint_trajectory__struct.h" // already included above // #include "control_msgs/action/detail/joint_trajectory__functions.h" bool control_msgs__action__joint_trajectory__result__convert_from_py(PyObject * _pymsg, void * _ros_message); PyObject * control_msgs__action__joint_trajectory__result__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__joint_trajectory__get_result__response__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[73]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._joint_trajectory.JointTrajectory_GetResult_Response", full_classname_dest, 72) == 0); } control_msgs__action__JointTrajectory_GetResult_Response * ros_message = _ros_message; { // status PyObject * field = PyObject_GetAttrString(_pymsg, "status"); if (!field) { return false; } assert(PyLong_Check(field)); ros_message->status = (int8_t)PyLong_AsLong(field); Py_DECREF(field); } { // result PyObject * field = PyObject_GetAttrString(_pymsg, "result"); if (!field) { return false; } if (!control_msgs__action__joint_trajectory__result__convert_from_py(field, &ros_message->result)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__joint_trajectory__get_result__response__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of JointTrajectory_GetResult_Response */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._joint_trajectory"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "JointTrajectory_GetResult_Response"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__JointTrajectory_GetResult_Response * ros_message = (control_msgs__action__JointTrajectory_GetResult_Response *)raw_ros_message; { // status PyObject * field = NULL; field = PyLong_FromLong(ros_message->status); { int rc = PyObject_SetAttrString(_pymessage, "status", field); Py_DECREF(field); if (rc) { return NULL; } } } { // result PyObject * field = NULL; field = control_msgs__action__joint_trajectory__result__convert_to_py(&ros_message->result); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "result", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/joint_trajectory__struct.h" // already included above // #include "control_msgs/action/detail/joint_trajectory__functions.h" ROSIDL_GENERATOR_C_IMPORT bool unique_identifier_msgs__msg__uuid__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * unique_identifier_msgs__msg__uuid__convert_to_py(void * raw_ros_message); bool control_msgs__action__joint_trajectory__feedback__convert_from_py(PyObject * _pymsg, void * _ros_message); PyObject * control_msgs__action__joint_trajectory__feedback__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__joint_trajectory__feedback_message__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[70]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._joint_trajectory.JointTrajectory_FeedbackMessage", full_classname_dest, 69) == 0); } control_msgs__action__JointTrajectory_FeedbackMessage * ros_message = _ros_message; { // goal_id PyObject * field = PyObject_GetAttrString(_pymsg, "goal_id"); if (!field) { return false; } if (!unique_identifier_msgs__msg__uuid__convert_from_py(field, &ros_message->goal_id)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // feedback PyObject * field = PyObject_GetAttrString(_pymsg, "feedback"); if (!field) { return false; } if (!control_msgs__action__joint_trajectory__feedback__convert_from_py(field, &ros_message->feedback)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__joint_trajectory__feedback_message__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of JointTrajectory_FeedbackMessage */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._joint_trajectory"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "JointTrajectory_FeedbackMessage"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__JointTrajectory_FeedbackMessage * ros_message = (control_msgs__action__JointTrajectory_FeedbackMessage *)raw_ros_message; { // goal_id PyObject * field = NULL; field = unique_identifier_msgs__msg__uuid__convert_to_py(&ros_message->goal_id); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "goal_id", field); Py_DECREF(field); if (rc) { return NULL; } } } { // feedback PyObject * field = NULL; field = control_msgs__action__joint_trajectory__feedback__convert_to_py(&ros_message->feedback); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "feedback", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; }
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/action/_joint_trajectory.py
# generated from rosidl_generator_py/resource/_idl.py.em # with input from control_msgs:action/JointTrajectory.idl # generated code does not contain a copyright notice # Import statements for member types import rosidl_parser.definition # noqa: E402, I100 class Metaclass_JointTrajectory_Goal(type): """Metaclass of message 'JointTrajectory_Goal'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.JointTrajectory_Goal') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__joint_trajectory__goal cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__joint_trajectory__goal cls._CONVERT_TO_PY = module.convert_to_py_msg__action__joint_trajectory__goal cls._TYPE_SUPPORT = module.type_support_msg__action__joint_trajectory__goal cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__joint_trajectory__goal from trajectory_msgs.msg import JointTrajectory if JointTrajectory.__class__._TYPE_SUPPORT is None: JointTrajectory.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class JointTrajectory_Goal(metaclass=Metaclass_JointTrajectory_Goal): """Message class 'JointTrajectory_Goal'.""" __slots__ = [ '_trajectory', ] _fields_and_field_types = { 'trajectory': 'trajectory_msgs/JointTrajectory', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['trajectory_msgs', 'msg'], 'JointTrajectory'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from trajectory_msgs.msg import JointTrajectory self.trajectory = kwargs.get('trajectory', JointTrajectory()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.trajectory != other.trajectory: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def trajectory(self): """Message field 'trajectory'.""" return self._trajectory @trajectory.setter def trajectory(self, value): if __debug__: from trajectory_msgs.msg import JointTrajectory assert \ isinstance(value, JointTrajectory), \ "The 'trajectory' field must be a sub message of type 'JointTrajectory'" self._trajectory = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_JointTrajectory_Result(type): """Metaclass of message 'JointTrajectory_Result'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.JointTrajectory_Result') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__joint_trajectory__result cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__joint_trajectory__result cls._CONVERT_TO_PY = module.convert_to_py_msg__action__joint_trajectory__result cls._TYPE_SUPPORT = module.type_support_msg__action__joint_trajectory__result cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__joint_trajectory__result @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class JointTrajectory_Result(metaclass=Metaclass_JointTrajectory_Result): """Message class 'JointTrajectory_Result'.""" __slots__ = [ ] _fields_and_field_types = { } SLOT_TYPES = ( ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_JointTrajectory_Feedback(type): """Metaclass of message 'JointTrajectory_Feedback'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.JointTrajectory_Feedback') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__joint_trajectory__feedback cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__joint_trajectory__feedback cls._CONVERT_TO_PY = module.convert_to_py_msg__action__joint_trajectory__feedback cls._TYPE_SUPPORT = module.type_support_msg__action__joint_trajectory__feedback cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__joint_trajectory__feedback @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class JointTrajectory_Feedback(metaclass=Metaclass_JointTrajectory_Feedback): """Message class 'JointTrajectory_Feedback'.""" __slots__ = [ ] _fields_and_field_types = { } SLOT_TYPES = ( ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_JointTrajectory_SendGoal_Request(type): """Metaclass of message 'JointTrajectory_SendGoal_Request'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.JointTrajectory_SendGoal_Request') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__joint_trajectory__send_goal__request cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__joint_trajectory__send_goal__request cls._CONVERT_TO_PY = module.convert_to_py_msg__action__joint_trajectory__send_goal__request cls._TYPE_SUPPORT = module.type_support_msg__action__joint_trajectory__send_goal__request cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__joint_trajectory__send_goal__request from control_msgs.action import JointTrajectory if JointTrajectory.Goal.__class__._TYPE_SUPPORT is None: JointTrajectory.Goal.__class__.__import_type_support__() from unique_identifier_msgs.msg import UUID if UUID.__class__._TYPE_SUPPORT is None: UUID.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class JointTrajectory_SendGoal_Request(metaclass=Metaclass_JointTrajectory_SendGoal_Request): """Message class 'JointTrajectory_SendGoal_Request'.""" __slots__ = [ '_goal_id', '_goal', ] _fields_and_field_types = { 'goal_id': 'unique_identifier_msgs/UUID', 'goal': 'control_msgs/JointTrajectory_Goal', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['unique_identifier_msgs', 'msg'], 'UUID'), # noqa: E501 rosidl_parser.definition.NamespacedType(['control_msgs', 'action'], 'JointTrajectory_Goal'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from unique_identifier_msgs.msg import UUID self.goal_id = kwargs.get('goal_id', UUID()) from control_msgs.action._joint_trajectory import JointTrajectory_Goal self.goal = kwargs.get('goal', JointTrajectory_Goal()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.goal_id != other.goal_id: return False if self.goal != other.goal: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def goal_id(self): """Message field 'goal_id'.""" return self._goal_id @goal_id.setter def goal_id(self, value): if __debug__: from unique_identifier_msgs.msg import UUID assert \ isinstance(value, UUID), \ "The 'goal_id' field must be a sub message of type 'UUID'" self._goal_id = value @property def goal(self): """Message field 'goal'.""" return self._goal @goal.setter def goal(self, value): if __debug__: from control_msgs.action._joint_trajectory import JointTrajectory_Goal assert \ isinstance(value, JointTrajectory_Goal), \ "The 'goal' field must be a sub message of type 'JointTrajectory_Goal'" self._goal = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_JointTrajectory_SendGoal_Response(type): """Metaclass of message 'JointTrajectory_SendGoal_Response'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.JointTrajectory_SendGoal_Response') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__joint_trajectory__send_goal__response cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__joint_trajectory__send_goal__response cls._CONVERT_TO_PY = module.convert_to_py_msg__action__joint_trajectory__send_goal__response cls._TYPE_SUPPORT = module.type_support_msg__action__joint_trajectory__send_goal__response cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__joint_trajectory__send_goal__response from builtin_interfaces.msg import Time if Time.__class__._TYPE_SUPPORT is None: Time.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class JointTrajectory_SendGoal_Response(metaclass=Metaclass_JointTrajectory_SendGoal_Response): """Message class 'JointTrajectory_SendGoal_Response'.""" __slots__ = [ '_accepted', '_stamp', ] _fields_and_field_types = { 'accepted': 'boolean', 'stamp': 'builtin_interfaces/Time', } SLOT_TYPES = ( rosidl_parser.definition.BasicType('boolean'), # noqa: E501 rosidl_parser.definition.NamespacedType(['builtin_interfaces', 'msg'], 'Time'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.accepted = kwargs.get('accepted', bool()) from builtin_interfaces.msg import Time self.stamp = kwargs.get('stamp', Time()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.accepted != other.accepted: return False if self.stamp != other.stamp: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def accepted(self): """Message field 'accepted'.""" return self._accepted @accepted.setter def accepted(self, value): if __debug__: assert \ isinstance(value, bool), \ "The 'accepted' field must be of type 'bool'" self._accepted = value @property def stamp(self): """Message field 'stamp'.""" return self._stamp @stamp.setter def stamp(self, value): if __debug__: from builtin_interfaces.msg import Time assert \ isinstance(value, Time), \ "The 'stamp' field must be a sub message of type 'Time'" self._stamp = value class Metaclass_JointTrajectory_SendGoal(type): """Metaclass of service 'JointTrajectory_SendGoal'.""" _TYPE_SUPPORT = None @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.JointTrajectory_SendGoal') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._TYPE_SUPPORT = module.type_support_srv__action__joint_trajectory__send_goal from control_msgs.action import _joint_trajectory if _joint_trajectory.Metaclass_JointTrajectory_SendGoal_Request._TYPE_SUPPORT is None: _joint_trajectory.Metaclass_JointTrajectory_SendGoal_Request.__import_type_support__() if _joint_trajectory.Metaclass_JointTrajectory_SendGoal_Response._TYPE_SUPPORT is None: _joint_trajectory.Metaclass_JointTrajectory_SendGoal_Response.__import_type_support__() class JointTrajectory_SendGoal(metaclass=Metaclass_JointTrajectory_SendGoal): from control_msgs.action._joint_trajectory import JointTrajectory_SendGoal_Request as Request from control_msgs.action._joint_trajectory import JointTrajectory_SendGoal_Response as Response def __init__(self): raise NotImplementedError('Service classes can not be instantiated') # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_JointTrajectory_GetResult_Request(type): """Metaclass of message 'JointTrajectory_GetResult_Request'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.JointTrajectory_GetResult_Request') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__joint_trajectory__get_result__request cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__joint_trajectory__get_result__request cls._CONVERT_TO_PY = module.convert_to_py_msg__action__joint_trajectory__get_result__request cls._TYPE_SUPPORT = module.type_support_msg__action__joint_trajectory__get_result__request cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__joint_trajectory__get_result__request from unique_identifier_msgs.msg import UUID if UUID.__class__._TYPE_SUPPORT is None: UUID.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class JointTrajectory_GetResult_Request(metaclass=Metaclass_JointTrajectory_GetResult_Request): """Message class 'JointTrajectory_GetResult_Request'.""" __slots__ = [ '_goal_id', ] _fields_and_field_types = { 'goal_id': 'unique_identifier_msgs/UUID', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['unique_identifier_msgs', 'msg'], 'UUID'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from unique_identifier_msgs.msg import UUID self.goal_id = kwargs.get('goal_id', UUID()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.goal_id != other.goal_id: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def goal_id(self): """Message field 'goal_id'.""" return self._goal_id @goal_id.setter def goal_id(self, value): if __debug__: from unique_identifier_msgs.msg import UUID assert \ isinstance(value, UUID), \ "The 'goal_id' field must be a sub message of type 'UUID'" self._goal_id = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_JointTrajectory_GetResult_Response(type): """Metaclass of message 'JointTrajectory_GetResult_Response'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.JointTrajectory_GetResult_Response') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__joint_trajectory__get_result__response cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__joint_trajectory__get_result__response cls._CONVERT_TO_PY = module.convert_to_py_msg__action__joint_trajectory__get_result__response cls._TYPE_SUPPORT = module.type_support_msg__action__joint_trajectory__get_result__response cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__joint_trajectory__get_result__response from control_msgs.action import JointTrajectory if JointTrajectory.Result.__class__._TYPE_SUPPORT is None: JointTrajectory.Result.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class JointTrajectory_GetResult_Response(metaclass=Metaclass_JointTrajectory_GetResult_Response): """Message class 'JointTrajectory_GetResult_Response'.""" __slots__ = [ '_status', '_result', ] _fields_and_field_types = { 'status': 'int8', 'result': 'control_msgs/JointTrajectory_Result', } SLOT_TYPES = ( rosidl_parser.definition.BasicType('int8'), # noqa: E501 rosidl_parser.definition.NamespacedType(['control_msgs', 'action'], 'JointTrajectory_Result'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.status = kwargs.get('status', int()) from control_msgs.action._joint_trajectory import JointTrajectory_Result self.result = kwargs.get('result', JointTrajectory_Result()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.status != other.status: return False if self.result != other.result: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def status(self): """Message field 'status'.""" return self._status @status.setter def status(self, value): if __debug__: assert \ isinstance(value, int), \ "The 'status' field must be of type 'int'" assert value >= -128 and value < 128, \ "The 'status' field must be an integer in [-128, 127]" self._status = value @property def result(self): """Message field 'result'.""" return self._result @result.setter def result(self, value): if __debug__: from control_msgs.action._joint_trajectory import JointTrajectory_Result assert \ isinstance(value, JointTrajectory_Result), \ "The 'result' field must be a sub message of type 'JointTrajectory_Result'" self._result = value class Metaclass_JointTrajectory_GetResult(type): """Metaclass of service 'JointTrajectory_GetResult'.""" _TYPE_SUPPORT = None @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.JointTrajectory_GetResult') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._TYPE_SUPPORT = module.type_support_srv__action__joint_trajectory__get_result from control_msgs.action import _joint_trajectory if _joint_trajectory.Metaclass_JointTrajectory_GetResult_Request._TYPE_SUPPORT is None: _joint_trajectory.Metaclass_JointTrajectory_GetResult_Request.__import_type_support__() if _joint_trajectory.Metaclass_JointTrajectory_GetResult_Response._TYPE_SUPPORT is None: _joint_trajectory.Metaclass_JointTrajectory_GetResult_Response.__import_type_support__() class JointTrajectory_GetResult(metaclass=Metaclass_JointTrajectory_GetResult): from control_msgs.action._joint_trajectory import JointTrajectory_GetResult_Request as Request from control_msgs.action._joint_trajectory import JointTrajectory_GetResult_Response as Response def __init__(self): raise NotImplementedError('Service classes can not be instantiated') # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_JointTrajectory_FeedbackMessage(type): """Metaclass of message 'JointTrajectory_FeedbackMessage'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.JointTrajectory_FeedbackMessage') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__joint_trajectory__feedback_message cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__joint_trajectory__feedback_message cls._CONVERT_TO_PY = module.convert_to_py_msg__action__joint_trajectory__feedback_message cls._TYPE_SUPPORT = module.type_support_msg__action__joint_trajectory__feedback_message cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__joint_trajectory__feedback_message from control_msgs.action import JointTrajectory if JointTrajectory.Feedback.__class__._TYPE_SUPPORT is None: JointTrajectory.Feedback.__class__.__import_type_support__() from unique_identifier_msgs.msg import UUID if UUID.__class__._TYPE_SUPPORT is None: UUID.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class JointTrajectory_FeedbackMessage(metaclass=Metaclass_JointTrajectory_FeedbackMessage): """Message class 'JointTrajectory_FeedbackMessage'.""" __slots__ = [ '_goal_id', '_feedback', ] _fields_and_field_types = { 'goal_id': 'unique_identifier_msgs/UUID', 'feedback': 'control_msgs/JointTrajectory_Feedback', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['unique_identifier_msgs', 'msg'], 'UUID'), # noqa: E501 rosidl_parser.definition.NamespacedType(['control_msgs', 'action'], 'JointTrajectory_Feedback'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from unique_identifier_msgs.msg import UUID self.goal_id = kwargs.get('goal_id', UUID()) from control_msgs.action._joint_trajectory import JointTrajectory_Feedback self.feedback = kwargs.get('feedback', JointTrajectory_Feedback()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.goal_id != other.goal_id: return False if self.feedback != other.feedback: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def goal_id(self): """Message field 'goal_id'.""" return self._goal_id @goal_id.setter def goal_id(self, value): if __debug__: from unique_identifier_msgs.msg import UUID assert \ isinstance(value, UUID), \ "The 'goal_id' field must be a sub message of type 'UUID'" self._goal_id = value @property def feedback(self): """Message field 'feedback'.""" return self._feedback @feedback.setter def feedback(self, value): if __debug__: from control_msgs.action._joint_trajectory import JointTrajectory_Feedback assert \ isinstance(value, JointTrajectory_Feedback), \ "The 'feedback' field must be a sub message of type 'JointTrajectory_Feedback'" self._feedback = value class Metaclass_JointTrajectory(type): """Metaclass of action 'JointTrajectory'.""" _TYPE_SUPPORT = None @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.JointTrajectory') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._TYPE_SUPPORT = module.type_support_action__action__joint_trajectory from action_msgs.msg import _goal_status_array if _goal_status_array.Metaclass_GoalStatusArray._TYPE_SUPPORT is None: _goal_status_array.Metaclass_GoalStatusArray.__import_type_support__() from action_msgs.srv import _cancel_goal if _cancel_goal.Metaclass_CancelGoal._TYPE_SUPPORT is None: _cancel_goal.Metaclass_CancelGoal.__import_type_support__() from control_msgs.action import _joint_trajectory if _joint_trajectory.Metaclass_JointTrajectory_SendGoal._TYPE_SUPPORT is None: _joint_trajectory.Metaclass_JointTrajectory_SendGoal.__import_type_support__() if _joint_trajectory.Metaclass_JointTrajectory_GetResult._TYPE_SUPPORT is None: _joint_trajectory.Metaclass_JointTrajectory_GetResult.__import_type_support__() if _joint_trajectory.Metaclass_JointTrajectory_FeedbackMessage._TYPE_SUPPORT is None: _joint_trajectory.Metaclass_JointTrajectory_FeedbackMessage.__import_type_support__() class JointTrajectory(metaclass=Metaclass_JointTrajectory): # The goal message defined in the action definition. from control_msgs.action._joint_trajectory import JointTrajectory_Goal as Goal # The result message defined in the action definition. from control_msgs.action._joint_trajectory import JointTrajectory_Result as Result # The feedback message defined in the action definition. from control_msgs.action._joint_trajectory import JointTrajectory_Feedback as Feedback class Impl: # The send_goal service using a wrapped version of the goal message as a request. from control_msgs.action._joint_trajectory import JointTrajectory_SendGoal as SendGoalService # The get_result service using a wrapped version of the result message as a response. from control_msgs.action._joint_trajectory import JointTrajectory_GetResult as GetResultService # The feedback message with generic fields which wraps the feedback message. from control_msgs.action._joint_trajectory import JointTrajectory_FeedbackMessage as FeedbackMessage # The generic service to cancel a goal. from action_msgs.srv._cancel_goal import CancelGoal as CancelGoalService # The generic message for get the status of a goal. from action_msgs.msg._goal_status_array import GoalStatusArray as GoalStatusMessage def __init__(self): raise NotImplementedError('Action classes can not be instantiated')
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/action/_point_head_s.c
// generated from rosidl_generator_py/resource/_idl_support.c.em // with input from control_msgs:action/PointHead.idl // generated code does not contain a copyright notice #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include <Python.h> #include <stdbool.h> #ifndef _WIN32 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-function" #endif #include "numpy/ndarrayobject.h" #ifndef _WIN32 # pragma GCC diagnostic pop #endif #include "rosidl_runtime_c/visibility_control.h" #include "control_msgs/action/detail/point_head__struct.h" #include "control_msgs/action/detail/point_head__functions.h" #include "rosidl_runtime_c/string.h" #include "rosidl_runtime_c/string_functions.h" ROSIDL_GENERATOR_C_IMPORT bool geometry_msgs__msg__point_stamped__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * geometry_msgs__msg__point_stamped__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_IMPORT bool geometry_msgs__msg__vector3__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * geometry_msgs__msg__vector3__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_IMPORT bool builtin_interfaces__msg__duration__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * builtin_interfaces__msg__duration__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__point_head__goal__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[47]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._point_head.PointHead_Goal", full_classname_dest, 46) == 0); } control_msgs__action__PointHead_Goal * ros_message = _ros_message; { // target PyObject * field = PyObject_GetAttrString(_pymsg, "target"); if (!field) { return false; } if (!geometry_msgs__msg__point_stamped__convert_from_py(field, &ros_message->target)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // pointing_axis PyObject * field = PyObject_GetAttrString(_pymsg, "pointing_axis"); if (!field) { return false; } if (!geometry_msgs__msg__vector3__convert_from_py(field, &ros_message->pointing_axis)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // pointing_frame PyObject * field = PyObject_GetAttrString(_pymsg, "pointing_frame"); if (!field) { return false; } assert(PyUnicode_Check(field)); PyObject * encoded_field = PyUnicode_AsUTF8String(field); if (!encoded_field) { Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&ros_message->pointing_frame, PyBytes_AS_STRING(encoded_field)); Py_DECREF(encoded_field); Py_DECREF(field); } { // min_duration PyObject * field = PyObject_GetAttrString(_pymsg, "min_duration"); if (!field) { return false; } if (!builtin_interfaces__msg__duration__convert_from_py(field, &ros_message->min_duration)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // max_velocity PyObject * field = PyObject_GetAttrString(_pymsg, "max_velocity"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->max_velocity = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__point_head__goal__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of PointHead_Goal */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._point_head"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "PointHead_Goal"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__PointHead_Goal * ros_message = (control_msgs__action__PointHead_Goal *)raw_ros_message; { // target PyObject * field = NULL; field = geometry_msgs__msg__point_stamped__convert_to_py(&ros_message->target); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "target", field); Py_DECREF(field); if (rc) { return NULL; } } } { // pointing_axis PyObject * field = NULL; field = geometry_msgs__msg__vector3__convert_to_py(&ros_message->pointing_axis); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "pointing_axis", field); Py_DECREF(field); if (rc) { return NULL; } } } { // pointing_frame PyObject * field = NULL; field = PyUnicode_DecodeUTF8( ros_message->pointing_frame.data, strlen(ros_message->pointing_frame.data), "strict"); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "pointing_frame", field); Py_DECREF(field); if (rc) { return NULL; } } } { // min_duration PyObject * field = NULL; field = builtin_interfaces__msg__duration__convert_to_py(&ros_message->min_duration); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "min_duration", field); Py_DECREF(field); if (rc) { return NULL; } } } { // max_velocity PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->max_velocity); { int rc = PyObject_SetAttrString(_pymessage, "max_velocity", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/point_head__struct.h" // already included above // #include "control_msgs/action/detail/point_head__functions.h" ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__point_head__result__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[49]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._point_head.PointHead_Result", full_classname_dest, 48) == 0); } control_msgs__action__PointHead_Result * ros_message = _ros_message; ros_message->structure_needs_at_least_one_member = 0; return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__point_head__result__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of PointHead_Result */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._point_head"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "PointHead_Result"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } (void)raw_ros_message; // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/point_head__struct.h" // already included above // #include "control_msgs/action/detail/point_head__functions.h" ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__point_head__feedback__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[51]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._point_head.PointHead_Feedback", full_classname_dest, 50) == 0); } control_msgs__action__PointHead_Feedback * ros_message = _ros_message; { // pointing_angle_error PyObject * field = PyObject_GetAttrString(_pymsg, "pointing_angle_error"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->pointing_angle_error = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__point_head__feedback__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of PointHead_Feedback */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._point_head"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "PointHead_Feedback"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__PointHead_Feedback * ros_message = (control_msgs__action__PointHead_Feedback *)raw_ros_message; { // pointing_angle_error PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->pointing_angle_error); { int rc = PyObject_SetAttrString(_pymessage, "pointing_angle_error", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/point_head__struct.h" // already included above // #include "control_msgs/action/detail/point_head__functions.h" ROSIDL_GENERATOR_C_IMPORT bool unique_identifier_msgs__msg__uuid__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * unique_identifier_msgs__msg__uuid__convert_to_py(void * raw_ros_message); bool control_msgs__action__point_head__goal__convert_from_py(PyObject * _pymsg, void * _ros_message); PyObject * control_msgs__action__point_head__goal__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__point_head__send_goal__request__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[59]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._point_head.PointHead_SendGoal_Request", full_classname_dest, 58) == 0); } control_msgs__action__PointHead_SendGoal_Request * ros_message = _ros_message; { // goal_id PyObject * field = PyObject_GetAttrString(_pymsg, "goal_id"); if (!field) { return false; } if (!unique_identifier_msgs__msg__uuid__convert_from_py(field, &ros_message->goal_id)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // goal PyObject * field = PyObject_GetAttrString(_pymsg, "goal"); if (!field) { return false; } if (!control_msgs__action__point_head__goal__convert_from_py(field, &ros_message->goal)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__point_head__send_goal__request__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of PointHead_SendGoal_Request */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._point_head"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "PointHead_SendGoal_Request"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__PointHead_SendGoal_Request * ros_message = (control_msgs__action__PointHead_SendGoal_Request *)raw_ros_message; { // goal_id PyObject * field = NULL; field = unique_identifier_msgs__msg__uuid__convert_to_py(&ros_message->goal_id); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "goal_id", field); Py_DECREF(field); if (rc) { return NULL; } } } { // goal PyObject * field = NULL; field = control_msgs__action__point_head__goal__convert_to_py(&ros_message->goal); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "goal", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/point_head__struct.h" // already included above // #include "control_msgs/action/detail/point_head__functions.h" ROSIDL_GENERATOR_C_IMPORT bool builtin_interfaces__msg__time__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * builtin_interfaces__msg__time__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__point_head__send_goal__response__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[60]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._point_head.PointHead_SendGoal_Response", full_classname_dest, 59) == 0); } control_msgs__action__PointHead_SendGoal_Response * ros_message = _ros_message; { // accepted PyObject * field = PyObject_GetAttrString(_pymsg, "accepted"); if (!field) { return false; } assert(PyBool_Check(field)); ros_message->accepted = (Py_True == field); Py_DECREF(field); } { // stamp PyObject * field = PyObject_GetAttrString(_pymsg, "stamp"); if (!field) { return false; } if (!builtin_interfaces__msg__time__convert_from_py(field, &ros_message->stamp)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__point_head__send_goal__response__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of PointHead_SendGoal_Response */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._point_head"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "PointHead_SendGoal_Response"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__PointHead_SendGoal_Response * ros_message = (control_msgs__action__PointHead_SendGoal_Response *)raw_ros_message; { // accepted PyObject * field = NULL; field = PyBool_FromLong(ros_message->accepted ? 1 : 0); { int rc = PyObject_SetAttrString(_pymessage, "accepted", field); Py_DECREF(field); if (rc) { return NULL; } } } { // stamp PyObject * field = NULL; field = builtin_interfaces__msg__time__convert_to_py(&ros_message->stamp); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "stamp", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/point_head__struct.h" // already included above // #include "control_msgs/action/detail/point_head__functions.h" ROSIDL_GENERATOR_C_IMPORT bool unique_identifier_msgs__msg__uuid__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * unique_identifier_msgs__msg__uuid__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__point_head__get_result__request__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[60]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._point_head.PointHead_GetResult_Request", full_classname_dest, 59) == 0); } control_msgs__action__PointHead_GetResult_Request * ros_message = _ros_message; { // goal_id PyObject * field = PyObject_GetAttrString(_pymsg, "goal_id"); if (!field) { return false; } if (!unique_identifier_msgs__msg__uuid__convert_from_py(field, &ros_message->goal_id)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__point_head__get_result__request__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of PointHead_GetResult_Request */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._point_head"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "PointHead_GetResult_Request"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__PointHead_GetResult_Request * ros_message = (control_msgs__action__PointHead_GetResult_Request *)raw_ros_message; { // goal_id PyObject * field = NULL; field = unique_identifier_msgs__msg__uuid__convert_to_py(&ros_message->goal_id); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "goal_id", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/point_head__struct.h" // already included above // #include "control_msgs/action/detail/point_head__functions.h" bool control_msgs__action__point_head__result__convert_from_py(PyObject * _pymsg, void * _ros_message); PyObject * control_msgs__action__point_head__result__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__point_head__get_result__response__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[61]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._point_head.PointHead_GetResult_Response", full_classname_dest, 60) == 0); } control_msgs__action__PointHead_GetResult_Response * ros_message = _ros_message; { // status PyObject * field = PyObject_GetAttrString(_pymsg, "status"); if (!field) { return false; } assert(PyLong_Check(field)); ros_message->status = (int8_t)PyLong_AsLong(field); Py_DECREF(field); } { // result PyObject * field = PyObject_GetAttrString(_pymsg, "result"); if (!field) { return false; } if (!control_msgs__action__point_head__result__convert_from_py(field, &ros_message->result)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__point_head__get_result__response__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of PointHead_GetResult_Response */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._point_head"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "PointHead_GetResult_Response"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__PointHead_GetResult_Response * ros_message = (control_msgs__action__PointHead_GetResult_Response *)raw_ros_message; { // status PyObject * field = NULL; field = PyLong_FromLong(ros_message->status); { int rc = PyObject_SetAttrString(_pymessage, "status", field); Py_DECREF(field); if (rc) { return NULL; } } } { // result PyObject * field = NULL; field = control_msgs__action__point_head__result__convert_to_py(&ros_message->result); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "result", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/point_head__struct.h" // already included above // #include "control_msgs/action/detail/point_head__functions.h" ROSIDL_GENERATOR_C_IMPORT bool unique_identifier_msgs__msg__uuid__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * unique_identifier_msgs__msg__uuid__convert_to_py(void * raw_ros_message); bool control_msgs__action__point_head__feedback__convert_from_py(PyObject * _pymsg, void * _ros_message); PyObject * control_msgs__action__point_head__feedback__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__point_head__feedback_message__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[58]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._point_head.PointHead_FeedbackMessage", full_classname_dest, 57) == 0); } control_msgs__action__PointHead_FeedbackMessage * ros_message = _ros_message; { // goal_id PyObject * field = PyObject_GetAttrString(_pymsg, "goal_id"); if (!field) { return false; } if (!unique_identifier_msgs__msg__uuid__convert_from_py(field, &ros_message->goal_id)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // feedback PyObject * field = PyObject_GetAttrString(_pymsg, "feedback"); if (!field) { return false; } if (!control_msgs__action__point_head__feedback__convert_from_py(field, &ros_message->feedback)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__point_head__feedback_message__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of PointHead_FeedbackMessage */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._point_head"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "PointHead_FeedbackMessage"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__PointHead_FeedbackMessage * ros_message = (control_msgs__action__PointHead_FeedbackMessage *)raw_ros_message; { // goal_id PyObject * field = NULL; field = unique_identifier_msgs__msg__uuid__convert_to_py(&ros_message->goal_id); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "goal_id", field); Py_DECREF(field); if (rc) { return NULL; } } } { // feedback PyObject * field = NULL; field = control_msgs__action__point_head__feedback__convert_to_py(&ros_message->feedback); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "feedback", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; }
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/action/__init__.py
from control_msgs.action._follow_joint_trajectory import FollowJointTrajectory # noqa: F401 from control_msgs.action._gripper_command import GripperCommand # noqa: F401 from control_msgs.action._joint_trajectory import JointTrajectory # noqa: F401 from control_msgs.action._point_head import PointHead # noqa: F401 from control_msgs.action._single_joint_position import SingleJointPosition # noqa: F401
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/action/_gripper_command_s.c
// generated from rosidl_generator_py/resource/_idl_support.c.em // with input from control_msgs:action/GripperCommand.idl // generated code does not contain a copyright notice #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include <Python.h> #include <stdbool.h> #ifndef _WIN32 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-function" #endif #include "numpy/ndarrayobject.h" #ifndef _WIN32 # pragma GCC diagnostic pop #endif #include "rosidl_runtime_c/visibility_control.h" #include "control_msgs/action/detail/gripper_command__struct.h" #include "control_msgs/action/detail/gripper_command__functions.h" bool control_msgs__msg__gripper_command__convert_from_py(PyObject * _pymsg, void * _ros_message); PyObject * control_msgs__msg__gripper_command__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__gripper_command__goal__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[57]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._gripper_command.GripperCommand_Goal", full_classname_dest, 56) == 0); } control_msgs__action__GripperCommand_Goal * ros_message = _ros_message; { // command PyObject * field = PyObject_GetAttrString(_pymsg, "command"); if (!field) { return false; } if (!control_msgs__msg__gripper_command__convert_from_py(field, &ros_message->command)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__gripper_command__goal__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of GripperCommand_Goal */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._gripper_command"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "GripperCommand_Goal"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__GripperCommand_Goal * ros_message = (control_msgs__action__GripperCommand_Goal *)raw_ros_message; { // command PyObject * field = NULL; field = control_msgs__msg__gripper_command__convert_to_py(&ros_message->command); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "command", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/gripper_command__struct.h" // already included above // #include "control_msgs/action/detail/gripper_command__functions.h" ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__gripper_command__result__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[59]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._gripper_command.GripperCommand_Result", full_classname_dest, 58) == 0); } control_msgs__action__GripperCommand_Result * ros_message = _ros_message; { // position PyObject * field = PyObject_GetAttrString(_pymsg, "position"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->position = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // effort PyObject * field = PyObject_GetAttrString(_pymsg, "effort"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->effort = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // stalled PyObject * field = PyObject_GetAttrString(_pymsg, "stalled"); if (!field) { return false; } assert(PyBool_Check(field)); ros_message->stalled = (Py_True == field); Py_DECREF(field); } { // reached_goal PyObject * field = PyObject_GetAttrString(_pymsg, "reached_goal"); if (!field) { return false; } assert(PyBool_Check(field)); ros_message->reached_goal = (Py_True == field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__gripper_command__result__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of GripperCommand_Result */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._gripper_command"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "GripperCommand_Result"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__GripperCommand_Result * ros_message = (control_msgs__action__GripperCommand_Result *)raw_ros_message; { // position PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->position); { int rc = PyObject_SetAttrString(_pymessage, "position", field); Py_DECREF(field); if (rc) { return NULL; } } } { // effort PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->effort); { int rc = PyObject_SetAttrString(_pymessage, "effort", field); Py_DECREF(field); if (rc) { return NULL; } } } { // stalled PyObject * field = NULL; field = PyBool_FromLong(ros_message->stalled ? 1 : 0); { int rc = PyObject_SetAttrString(_pymessage, "stalled", field); Py_DECREF(field); if (rc) { return NULL; } } } { // reached_goal PyObject * field = NULL; field = PyBool_FromLong(ros_message->reached_goal ? 1 : 0); { int rc = PyObject_SetAttrString(_pymessage, "reached_goal", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/gripper_command__struct.h" // already included above // #include "control_msgs/action/detail/gripper_command__functions.h" ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__gripper_command__feedback__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[61]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._gripper_command.GripperCommand_Feedback", full_classname_dest, 60) == 0); } control_msgs__action__GripperCommand_Feedback * ros_message = _ros_message; { // position PyObject * field = PyObject_GetAttrString(_pymsg, "position"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->position = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // effort PyObject * field = PyObject_GetAttrString(_pymsg, "effort"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->effort = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // stalled PyObject * field = PyObject_GetAttrString(_pymsg, "stalled"); if (!field) { return false; } assert(PyBool_Check(field)); ros_message->stalled = (Py_True == field); Py_DECREF(field); } { // reached_goal PyObject * field = PyObject_GetAttrString(_pymsg, "reached_goal"); if (!field) { return false; } assert(PyBool_Check(field)); ros_message->reached_goal = (Py_True == field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__gripper_command__feedback__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of GripperCommand_Feedback */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._gripper_command"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "GripperCommand_Feedback"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__GripperCommand_Feedback * ros_message = (control_msgs__action__GripperCommand_Feedback *)raw_ros_message; { // position PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->position); { int rc = PyObject_SetAttrString(_pymessage, "position", field); Py_DECREF(field); if (rc) { return NULL; } } } { // effort PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->effort); { int rc = PyObject_SetAttrString(_pymessage, "effort", field); Py_DECREF(field); if (rc) { return NULL; } } } { // stalled PyObject * field = NULL; field = PyBool_FromLong(ros_message->stalled ? 1 : 0); { int rc = PyObject_SetAttrString(_pymessage, "stalled", field); Py_DECREF(field); if (rc) { return NULL; } } } { // reached_goal PyObject * field = NULL; field = PyBool_FromLong(ros_message->reached_goal ? 1 : 0); { int rc = PyObject_SetAttrString(_pymessage, "reached_goal", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/gripper_command__struct.h" // already included above // #include "control_msgs/action/detail/gripper_command__functions.h" ROSIDL_GENERATOR_C_IMPORT bool unique_identifier_msgs__msg__uuid__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * unique_identifier_msgs__msg__uuid__convert_to_py(void * raw_ros_message); bool control_msgs__action__gripper_command__goal__convert_from_py(PyObject * _pymsg, void * _ros_message); PyObject * control_msgs__action__gripper_command__goal__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__gripper_command__send_goal__request__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[69]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._gripper_command.GripperCommand_SendGoal_Request", full_classname_dest, 68) == 0); } control_msgs__action__GripperCommand_SendGoal_Request * ros_message = _ros_message; { // goal_id PyObject * field = PyObject_GetAttrString(_pymsg, "goal_id"); if (!field) { return false; } if (!unique_identifier_msgs__msg__uuid__convert_from_py(field, &ros_message->goal_id)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // goal PyObject * field = PyObject_GetAttrString(_pymsg, "goal"); if (!field) { return false; } if (!control_msgs__action__gripper_command__goal__convert_from_py(field, &ros_message->goal)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__gripper_command__send_goal__request__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of GripperCommand_SendGoal_Request */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._gripper_command"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "GripperCommand_SendGoal_Request"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__GripperCommand_SendGoal_Request * ros_message = (control_msgs__action__GripperCommand_SendGoal_Request *)raw_ros_message; { // goal_id PyObject * field = NULL; field = unique_identifier_msgs__msg__uuid__convert_to_py(&ros_message->goal_id); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "goal_id", field); Py_DECREF(field); if (rc) { return NULL; } } } { // goal PyObject * field = NULL; field = control_msgs__action__gripper_command__goal__convert_to_py(&ros_message->goal); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "goal", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/gripper_command__struct.h" // already included above // #include "control_msgs/action/detail/gripper_command__functions.h" ROSIDL_GENERATOR_C_IMPORT bool builtin_interfaces__msg__time__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * builtin_interfaces__msg__time__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__gripper_command__send_goal__response__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[70]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._gripper_command.GripperCommand_SendGoal_Response", full_classname_dest, 69) == 0); } control_msgs__action__GripperCommand_SendGoal_Response * ros_message = _ros_message; { // accepted PyObject * field = PyObject_GetAttrString(_pymsg, "accepted"); if (!field) { return false; } assert(PyBool_Check(field)); ros_message->accepted = (Py_True == field); Py_DECREF(field); } { // stamp PyObject * field = PyObject_GetAttrString(_pymsg, "stamp"); if (!field) { return false; } if (!builtin_interfaces__msg__time__convert_from_py(field, &ros_message->stamp)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__gripper_command__send_goal__response__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of GripperCommand_SendGoal_Response */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._gripper_command"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "GripperCommand_SendGoal_Response"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__GripperCommand_SendGoal_Response * ros_message = (control_msgs__action__GripperCommand_SendGoal_Response *)raw_ros_message; { // accepted PyObject * field = NULL; field = PyBool_FromLong(ros_message->accepted ? 1 : 0); { int rc = PyObject_SetAttrString(_pymessage, "accepted", field); Py_DECREF(field); if (rc) { return NULL; } } } { // stamp PyObject * field = NULL; field = builtin_interfaces__msg__time__convert_to_py(&ros_message->stamp); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "stamp", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/gripper_command__struct.h" // already included above // #include "control_msgs/action/detail/gripper_command__functions.h" ROSIDL_GENERATOR_C_IMPORT bool unique_identifier_msgs__msg__uuid__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * unique_identifier_msgs__msg__uuid__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__gripper_command__get_result__request__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[70]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._gripper_command.GripperCommand_GetResult_Request", full_classname_dest, 69) == 0); } control_msgs__action__GripperCommand_GetResult_Request * ros_message = _ros_message; { // goal_id PyObject * field = PyObject_GetAttrString(_pymsg, "goal_id"); if (!field) { return false; } if (!unique_identifier_msgs__msg__uuid__convert_from_py(field, &ros_message->goal_id)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__gripper_command__get_result__request__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of GripperCommand_GetResult_Request */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._gripper_command"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "GripperCommand_GetResult_Request"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__GripperCommand_GetResult_Request * ros_message = (control_msgs__action__GripperCommand_GetResult_Request *)raw_ros_message; { // goal_id PyObject * field = NULL; field = unique_identifier_msgs__msg__uuid__convert_to_py(&ros_message->goal_id); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "goal_id", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/gripper_command__struct.h" // already included above // #include "control_msgs/action/detail/gripper_command__functions.h" bool control_msgs__action__gripper_command__result__convert_from_py(PyObject * _pymsg, void * _ros_message); PyObject * control_msgs__action__gripper_command__result__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__gripper_command__get_result__response__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[71]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._gripper_command.GripperCommand_GetResult_Response", full_classname_dest, 70) == 0); } control_msgs__action__GripperCommand_GetResult_Response * ros_message = _ros_message; { // status PyObject * field = PyObject_GetAttrString(_pymsg, "status"); if (!field) { return false; } assert(PyLong_Check(field)); ros_message->status = (int8_t)PyLong_AsLong(field); Py_DECREF(field); } { // result PyObject * field = PyObject_GetAttrString(_pymsg, "result"); if (!field) { return false; } if (!control_msgs__action__gripper_command__result__convert_from_py(field, &ros_message->result)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__gripper_command__get_result__response__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of GripperCommand_GetResult_Response */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._gripper_command"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "GripperCommand_GetResult_Response"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__GripperCommand_GetResult_Response * ros_message = (control_msgs__action__GripperCommand_GetResult_Response *)raw_ros_message; { // status PyObject * field = NULL; field = PyLong_FromLong(ros_message->status); { int rc = PyObject_SetAttrString(_pymessage, "status", field); Py_DECREF(field); if (rc) { return NULL; } } } { // result PyObject * field = NULL; field = control_msgs__action__gripper_command__result__convert_to_py(&ros_message->result); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "result", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/gripper_command__struct.h" // already included above // #include "control_msgs/action/detail/gripper_command__functions.h" ROSIDL_GENERATOR_C_IMPORT bool unique_identifier_msgs__msg__uuid__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * unique_identifier_msgs__msg__uuid__convert_to_py(void * raw_ros_message); bool control_msgs__action__gripper_command__feedback__convert_from_py(PyObject * _pymsg, void * _ros_message); PyObject * control_msgs__action__gripper_command__feedback__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__gripper_command__feedback_message__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[68]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._gripper_command.GripperCommand_FeedbackMessage", full_classname_dest, 67) == 0); } control_msgs__action__GripperCommand_FeedbackMessage * ros_message = _ros_message; { // goal_id PyObject * field = PyObject_GetAttrString(_pymsg, "goal_id"); if (!field) { return false; } if (!unique_identifier_msgs__msg__uuid__convert_from_py(field, &ros_message->goal_id)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // feedback PyObject * field = PyObject_GetAttrString(_pymsg, "feedback"); if (!field) { return false; } if (!control_msgs__action__gripper_command__feedback__convert_from_py(field, &ros_message->feedback)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__gripper_command__feedback_message__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of GripperCommand_FeedbackMessage */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._gripper_command"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "GripperCommand_FeedbackMessage"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__GripperCommand_FeedbackMessage * ros_message = (control_msgs__action__GripperCommand_FeedbackMessage *)raw_ros_message; { // goal_id PyObject * field = NULL; field = unique_identifier_msgs__msg__uuid__convert_to_py(&ros_message->goal_id); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "goal_id", field); Py_DECREF(field); if (rc) { return NULL; } } } { // feedback PyObject * field = NULL; field = control_msgs__action__gripper_command__feedback__convert_to_py(&ros_message->feedback); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "feedback", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; }
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/action/_gripper_command.py
# generated from rosidl_generator_py/resource/_idl.py.em # with input from control_msgs:action/GripperCommand.idl # generated code does not contain a copyright notice # Import statements for member types import rosidl_parser.definition # noqa: E402, I100 class Metaclass_GripperCommand_Goal(type): """Metaclass of message 'GripperCommand_Goal'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.GripperCommand_Goal') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__gripper_command__goal cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__gripper_command__goal cls._CONVERT_TO_PY = module.convert_to_py_msg__action__gripper_command__goal cls._TYPE_SUPPORT = module.type_support_msg__action__gripper_command__goal cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__gripper_command__goal from control_msgs.msg import GripperCommand if GripperCommand.__class__._TYPE_SUPPORT is None: GripperCommand.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class GripperCommand_Goal(metaclass=Metaclass_GripperCommand_Goal): """Message class 'GripperCommand_Goal'.""" __slots__ = [ '_command', ] _fields_and_field_types = { 'command': 'control_msgs/GripperCommand', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['control_msgs', 'msg'], 'GripperCommand'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from control_msgs.msg import GripperCommand self.command = kwargs.get('command', GripperCommand()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.command != other.command: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def command(self): """Message field 'command'.""" return self._command @command.setter def command(self, value): if __debug__: from control_msgs.msg import GripperCommand assert \ isinstance(value, GripperCommand), \ "The 'command' field must be a sub message of type 'GripperCommand'" self._command = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_GripperCommand_Result(type): """Metaclass of message 'GripperCommand_Result'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.GripperCommand_Result') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__gripper_command__result cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__gripper_command__result cls._CONVERT_TO_PY = module.convert_to_py_msg__action__gripper_command__result cls._TYPE_SUPPORT = module.type_support_msg__action__gripper_command__result cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__gripper_command__result @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class GripperCommand_Result(metaclass=Metaclass_GripperCommand_Result): """Message class 'GripperCommand_Result'.""" __slots__ = [ '_position', '_effort', '_stalled', '_reached_goal', ] _fields_and_field_types = { 'position': 'double', 'effort': 'double', 'stalled': 'boolean', 'reached_goal': 'boolean', } SLOT_TYPES = ( rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('boolean'), # noqa: E501 rosidl_parser.definition.BasicType('boolean'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.position = kwargs.get('position', float()) self.effort = kwargs.get('effort', float()) self.stalled = kwargs.get('stalled', bool()) self.reached_goal = kwargs.get('reached_goal', bool()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.position != other.position: return False if self.effort != other.effort: return False if self.stalled != other.stalled: return False if self.reached_goal != other.reached_goal: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def position(self): """Message field 'position'.""" return self._position @position.setter def position(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'position' field must be of type 'float'" self._position = value @property def effort(self): """Message field 'effort'.""" return self._effort @effort.setter def effort(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'effort' field must be of type 'float'" self._effort = value @property def stalled(self): """Message field 'stalled'.""" return self._stalled @stalled.setter def stalled(self, value): if __debug__: assert \ isinstance(value, bool), \ "The 'stalled' field must be of type 'bool'" self._stalled = value @property def reached_goal(self): """Message field 'reached_goal'.""" return self._reached_goal @reached_goal.setter def reached_goal(self, value): if __debug__: assert \ isinstance(value, bool), \ "The 'reached_goal' field must be of type 'bool'" self._reached_goal = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_GripperCommand_Feedback(type): """Metaclass of message 'GripperCommand_Feedback'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.GripperCommand_Feedback') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__gripper_command__feedback cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__gripper_command__feedback cls._CONVERT_TO_PY = module.convert_to_py_msg__action__gripper_command__feedback cls._TYPE_SUPPORT = module.type_support_msg__action__gripper_command__feedback cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__gripper_command__feedback @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class GripperCommand_Feedback(metaclass=Metaclass_GripperCommand_Feedback): """Message class 'GripperCommand_Feedback'.""" __slots__ = [ '_position', '_effort', '_stalled', '_reached_goal', ] _fields_and_field_types = { 'position': 'double', 'effort': 'double', 'stalled': 'boolean', 'reached_goal': 'boolean', } SLOT_TYPES = ( rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('boolean'), # noqa: E501 rosidl_parser.definition.BasicType('boolean'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.position = kwargs.get('position', float()) self.effort = kwargs.get('effort', float()) self.stalled = kwargs.get('stalled', bool()) self.reached_goal = kwargs.get('reached_goal', bool()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.position != other.position: return False if self.effort != other.effort: return False if self.stalled != other.stalled: return False if self.reached_goal != other.reached_goal: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def position(self): """Message field 'position'.""" return self._position @position.setter def position(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'position' field must be of type 'float'" self._position = value @property def effort(self): """Message field 'effort'.""" return self._effort @effort.setter def effort(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'effort' field must be of type 'float'" self._effort = value @property def stalled(self): """Message field 'stalled'.""" return self._stalled @stalled.setter def stalled(self, value): if __debug__: assert \ isinstance(value, bool), \ "The 'stalled' field must be of type 'bool'" self._stalled = value @property def reached_goal(self): """Message field 'reached_goal'.""" return self._reached_goal @reached_goal.setter def reached_goal(self, value): if __debug__: assert \ isinstance(value, bool), \ "The 'reached_goal' field must be of type 'bool'" self._reached_goal = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_GripperCommand_SendGoal_Request(type): """Metaclass of message 'GripperCommand_SendGoal_Request'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.GripperCommand_SendGoal_Request') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__gripper_command__send_goal__request cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__gripper_command__send_goal__request cls._CONVERT_TO_PY = module.convert_to_py_msg__action__gripper_command__send_goal__request cls._TYPE_SUPPORT = module.type_support_msg__action__gripper_command__send_goal__request cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__gripper_command__send_goal__request from control_msgs.action import GripperCommand if GripperCommand.Goal.__class__._TYPE_SUPPORT is None: GripperCommand.Goal.__class__.__import_type_support__() from unique_identifier_msgs.msg import UUID if UUID.__class__._TYPE_SUPPORT is None: UUID.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class GripperCommand_SendGoal_Request(metaclass=Metaclass_GripperCommand_SendGoal_Request): """Message class 'GripperCommand_SendGoal_Request'.""" __slots__ = [ '_goal_id', '_goal', ] _fields_and_field_types = { 'goal_id': 'unique_identifier_msgs/UUID', 'goal': 'control_msgs/GripperCommand_Goal', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['unique_identifier_msgs', 'msg'], 'UUID'), # noqa: E501 rosidl_parser.definition.NamespacedType(['control_msgs', 'action'], 'GripperCommand_Goal'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from unique_identifier_msgs.msg import UUID self.goal_id = kwargs.get('goal_id', UUID()) from control_msgs.action._gripper_command import GripperCommand_Goal self.goal = kwargs.get('goal', GripperCommand_Goal()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.goal_id != other.goal_id: return False if self.goal != other.goal: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def goal_id(self): """Message field 'goal_id'.""" return self._goal_id @goal_id.setter def goal_id(self, value): if __debug__: from unique_identifier_msgs.msg import UUID assert \ isinstance(value, UUID), \ "The 'goal_id' field must be a sub message of type 'UUID'" self._goal_id = value @property def goal(self): """Message field 'goal'.""" return self._goal @goal.setter def goal(self, value): if __debug__: from control_msgs.action._gripper_command import GripperCommand_Goal assert \ isinstance(value, GripperCommand_Goal), \ "The 'goal' field must be a sub message of type 'GripperCommand_Goal'" self._goal = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_GripperCommand_SendGoal_Response(type): """Metaclass of message 'GripperCommand_SendGoal_Response'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.GripperCommand_SendGoal_Response') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__gripper_command__send_goal__response cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__gripper_command__send_goal__response cls._CONVERT_TO_PY = module.convert_to_py_msg__action__gripper_command__send_goal__response cls._TYPE_SUPPORT = module.type_support_msg__action__gripper_command__send_goal__response cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__gripper_command__send_goal__response from builtin_interfaces.msg import Time if Time.__class__._TYPE_SUPPORT is None: Time.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class GripperCommand_SendGoal_Response(metaclass=Metaclass_GripperCommand_SendGoal_Response): """Message class 'GripperCommand_SendGoal_Response'.""" __slots__ = [ '_accepted', '_stamp', ] _fields_and_field_types = { 'accepted': 'boolean', 'stamp': 'builtin_interfaces/Time', } SLOT_TYPES = ( rosidl_parser.definition.BasicType('boolean'), # noqa: E501 rosidl_parser.definition.NamespacedType(['builtin_interfaces', 'msg'], 'Time'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.accepted = kwargs.get('accepted', bool()) from builtin_interfaces.msg import Time self.stamp = kwargs.get('stamp', Time()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.accepted != other.accepted: return False if self.stamp != other.stamp: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def accepted(self): """Message field 'accepted'.""" return self._accepted @accepted.setter def accepted(self, value): if __debug__: assert \ isinstance(value, bool), \ "The 'accepted' field must be of type 'bool'" self._accepted = value @property def stamp(self): """Message field 'stamp'.""" return self._stamp @stamp.setter def stamp(self, value): if __debug__: from builtin_interfaces.msg import Time assert \ isinstance(value, Time), \ "The 'stamp' field must be a sub message of type 'Time'" self._stamp = value class Metaclass_GripperCommand_SendGoal(type): """Metaclass of service 'GripperCommand_SendGoal'.""" _TYPE_SUPPORT = None @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.GripperCommand_SendGoal') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._TYPE_SUPPORT = module.type_support_srv__action__gripper_command__send_goal from control_msgs.action import _gripper_command if _gripper_command.Metaclass_GripperCommand_SendGoal_Request._TYPE_SUPPORT is None: _gripper_command.Metaclass_GripperCommand_SendGoal_Request.__import_type_support__() if _gripper_command.Metaclass_GripperCommand_SendGoal_Response._TYPE_SUPPORT is None: _gripper_command.Metaclass_GripperCommand_SendGoal_Response.__import_type_support__() class GripperCommand_SendGoal(metaclass=Metaclass_GripperCommand_SendGoal): from control_msgs.action._gripper_command import GripperCommand_SendGoal_Request as Request from control_msgs.action._gripper_command import GripperCommand_SendGoal_Response as Response def __init__(self): raise NotImplementedError('Service classes can not be instantiated') # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_GripperCommand_GetResult_Request(type): """Metaclass of message 'GripperCommand_GetResult_Request'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.GripperCommand_GetResult_Request') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__gripper_command__get_result__request cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__gripper_command__get_result__request cls._CONVERT_TO_PY = module.convert_to_py_msg__action__gripper_command__get_result__request cls._TYPE_SUPPORT = module.type_support_msg__action__gripper_command__get_result__request cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__gripper_command__get_result__request from unique_identifier_msgs.msg import UUID if UUID.__class__._TYPE_SUPPORT is None: UUID.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class GripperCommand_GetResult_Request(metaclass=Metaclass_GripperCommand_GetResult_Request): """Message class 'GripperCommand_GetResult_Request'.""" __slots__ = [ '_goal_id', ] _fields_and_field_types = { 'goal_id': 'unique_identifier_msgs/UUID', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['unique_identifier_msgs', 'msg'], 'UUID'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from unique_identifier_msgs.msg import UUID self.goal_id = kwargs.get('goal_id', UUID()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.goal_id != other.goal_id: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def goal_id(self): """Message field 'goal_id'.""" return self._goal_id @goal_id.setter def goal_id(self, value): if __debug__: from unique_identifier_msgs.msg import UUID assert \ isinstance(value, UUID), \ "The 'goal_id' field must be a sub message of type 'UUID'" self._goal_id = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_GripperCommand_GetResult_Response(type): """Metaclass of message 'GripperCommand_GetResult_Response'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.GripperCommand_GetResult_Response') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__gripper_command__get_result__response cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__gripper_command__get_result__response cls._CONVERT_TO_PY = module.convert_to_py_msg__action__gripper_command__get_result__response cls._TYPE_SUPPORT = module.type_support_msg__action__gripper_command__get_result__response cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__gripper_command__get_result__response from control_msgs.action import GripperCommand if GripperCommand.Result.__class__._TYPE_SUPPORT is None: GripperCommand.Result.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class GripperCommand_GetResult_Response(metaclass=Metaclass_GripperCommand_GetResult_Response): """Message class 'GripperCommand_GetResult_Response'.""" __slots__ = [ '_status', '_result', ] _fields_and_field_types = { 'status': 'int8', 'result': 'control_msgs/GripperCommand_Result', } SLOT_TYPES = ( rosidl_parser.definition.BasicType('int8'), # noqa: E501 rosidl_parser.definition.NamespacedType(['control_msgs', 'action'], 'GripperCommand_Result'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.status = kwargs.get('status', int()) from control_msgs.action._gripper_command import GripperCommand_Result self.result = kwargs.get('result', GripperCommand_Result()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.status != other.status: return False if self.result != other.result: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def status(self): """Message field 'status'.""" return self._status @status.setter def status(self, value): if __debug__: assert \ isinstance(value, int), \ "The 'status' field must be of type 'int'" assert value >= -128 and value < 128, \ "The 'status' field must be an integer in [-128, 127]" self._status = value @property def result(self): """Message field 'result'.""" return self._result @result.setter def result(self, value): if __debug__: from control_msgs.action._gripper_command import GripperCommand_Result assert \ isinstance(value, GripperCommand_Result), \ "The 'result' field must be a sub message of type 'GripperCommand_Result'" self._result = value class Metaclass_GripperCommand_GetResult(type): """Metaclass of service 'GripperCommand_GetResult'.""" _TYPE_SUPPORT = None @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.GripperCommand_GetResult') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._TYPE_SUPPORT = module.type_support_srv__action__gripper_command__get_result from control_msgs.action import _gripper_command if _gripper_command.Metaclass_GripperCommand_GetResult_Request._TYPE_SUPPORT is None: _gripper_command.Metaclass_GripperCommand_GetResult_Request.__import_type_support__() if _gripper_command.Metaclass_GripperCommand_GetResult_Response._TYPE_SUPPORT is None: _gripper_command.Metaclass_GripperCommand_GetResult_Response.__import_type_support__() class GripperCommand_GetResult(metaclass=Metaclass_GripperCommand_GetResult): from control_msgs.action._gripper_command import GripperCommand_GetResult_Request as Request from control_msgs.action._gripper_command import GripperCommand_GetResult_Response as Response def __init__(self): raise NotImplementedError('Service classes can not be instantiated') # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_GripperCommand_FeedbackMessage(type): """Metaclass of message 'GripperCommand_FeedbackMessage'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.GripperCommand_FeedbackMessage') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__gripper_command__feedback_message cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__gripper_command__feedback_message cls._CONVERT_TO_PY = module.convert_to_py_msg__action__gripper_command__feedback_message cls._TYPE_SUPPORT = module.type_support_msg__action__gripper_command__feedback_message cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__gripper_command__feedback_message from control_msgs.action import GripperCommand if GripperCommand.Feedback.__class__._TYPE_SUPPORT is None: GripperCommand.Feedback.__class__.__import_type_support__() from unique_identifier_msgs.msg import UUID if UUID.__class__._TYPE_SUPPORT is None: UUID.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class GripperCommand_FeedbackMessage(metaclass=Metaclass_GripperCommand_FeedbackMessage): """Message class 'GripperCommand_FeedbackMessage'.""" __slots__ = [ '_goal_id', '_feedback', ] _fields_and_field_types = { 'goal_id': 'unique_identifier_msgs/UUID', 'feedback': 'control_msgs/GripperCommand_Feedback', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['unique_identifier_msgs', 'msg'], 'UUID'), # noqa: E501 rosidl_parser.definition.NamespacedType(['control_msgs', 'action'], 'GripperCommand_Feedback'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from unique_identifier_msgs.msg import UUID self.goal_id = kwargs.get('goal_id', UUID()) from control_msgs.action._gripper_command import GripperCommand_Feedback self.feedback = kwargs.get('feedback', GripperCommand_Feedback()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.goal_id != other.goal_id: return False if self.feedback != other.feedback: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def goal_id(self): """Message field 'goal_id'.""" return self._goal_id @goal_id.setter def goal_id(self, value): if __debug__: from unique_identifier_msgs.msg import UUID assert \ isinstance(value, UUID), \ "The 'goal_id' field must be a sub message of type 'UUID'" self._goal_id = value @property def feedback(self): """Message field 'feedback'.""" return self._feedback @feedback.setter def feedback(self, value): if __debug__: from control_msgs.action._gripper_command import GripperCommand_Feedback assert \ isinstance(value, GripperCommand_Feedback), \ "The 'feedback' field must be a sub message of type 'GripperCommand_Feedback'" self._feedback = value class Metaclass_GripperCommand(type): """Metaclass of action 'GripperCommand'.""" _TYPE_SUPPORT = None @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.GripperCommand') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._TYPE_SUPPORT = module.type_support_action__action__gripper_command from action_msgs.msg import _goal_status_array if _goal_status_array.Metaclass_GoalStatusArray._TYPE_SUPPORT is None: _goal_status_array.Metaclass_GoalStatusArray.__import_type_support__() from action_msgs.srv import _cancel_goal if _cancel_goal.Metaclass_CancelGoal._TYPE_SUPPORT is None: _cancel_goal.Metaclass_CancelGoal.__import_type_support__() from control_msgs.action import _gripper_command if _gripper_command.Metaclass_GripperCommand_SendGoal._TYPE_SUPPORT is None: _gripper_command.Metaclass_GripperCommand_SendGoal.__import_type_support__() if _gripper_command.Metaclass_GripperCommand_GetResult._TYPE_SUPPORT is None: _gripper_command.Metaclass_GripperCommand_GetResult.__import_type_support__() if _gripper_command.Metaclass_GripperCommand_FeedbackMessage._TYPE_SUPPORT is None: _gripper_command.Metaclass_GripperCommand_FeedbackMessage.__import_type_support__() class GripperCommand(metaclass=Metaclass_GripperCommand): # The goal message defined in the action definition. from control_msgs.action._gripper_command import GripperCommand_Goal as Goal # The result message defined in the action definition. from control_msgs.action._gripper_command import GripperCommand_Result as Result # The feedback message defined in the action definition. from control_msgs.action._gripper_command import GripperCommand_Feedback as Feedback class Impl: # The send_goal service using a wrapped version of the goal message as a request. from control_msgs.action._gripper_command import GripperCommand_SendGoal as SendGoalService # The get_result service using a wrapped version of the result message as a response. from control_msgs.action._gripper_command import GripperCommand_GetResult as GetResultService # The feedback message with generic fields which wraps the feedback message. from control_msgs.action._gripper_command import GripperCommand_FeedbackMessage as FeedbackMessage # The generic service to cancel a goal. from action_msgs.srv._cancel_goal import CancelGoal as CancelGoalService # The generic message for get the status of a goal. from action_msgs.msg._goal_status_array import GoalStatusArray as GoalStatusMessage def __init__(self): raise NotImplementedError('Action classes can not be instantiated')
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/action/_single_joint_position.py
# generated from rosidl_generator_py/resource/_idl.py.em # with input from control_msgs:action/SingleJointPosition.idl # generated code does not contain a copyright notice # Import statements for member types import rosidl_parser.definition # noqa: E402, I100 class Metaclass_SingleJointPosition_Goal(type): """Metaclass of message 'SingleJointPosition_Goal'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.SingleJointPosition_Goal') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__single_joint_position__goal cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__single_joint_position__goal cls._CONVERT_TO_PY = module.convert_to_py_msg__action__single_joint_position__goal cls._TYPE_SUPPORT = module.type_support_msg__action__single_joint_position__goal cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__single_joint_position__goal from builtin_interfaces.msg import Duration if Duration.__class__._TYPE_SUPPORT is None: Duration.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class SingleJointPosition_Goal(metaclass=Metaclass_SingleJointPosition_Goal): """Message class 'SingleJointPosition_Goal'.""" __slots__ = [ '_position', '_min_duration', '_max_velocity', ] _fields_and_field_types = { 'position': 'double', 'min_duration': 'builtin_interfaces/Duration', 'max_velocity': 'double', } SLOT_TYPES = ( rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.NamespacedType(['builtin_interfaces', 'msg'], 'Duration'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.position = kwargs.get('position', float()) from builtin_interfaces.msg import Duration self.min_duration = kwargs.get('min_duration', Duration()) self.max_velocity = kwargs.get('max_velocity', float()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.position != other.position: return False if self.min_duration != other.min_duration: return False if self.max_velocity != other.max_velocity: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def position(self): """Message field 'position'.""" return self._position @position.setter def position(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'position' field must be of type 'float'" self._position = value @property def min_duration(self): """Message field 'min_duration'.""" return self._min_duration @min_duration.setter def min_duration(self, value): if __debug__: from builtin_interfaces.msg import Duration assert \ isinstance(value, Duration), \ "The 'min_duration' field must be a sub message of type 'Duration'" self._min_duration = value @property def max_velocity(self): """Message field 'max_velocity'.""" return self._max_velocity @max_velocity.setter def max_velocity(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'max_velocity' field must be of type 'float'" self._max_velocity = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_SingleJointPosition_Result(type): """Metaclass of message 'SingleJointPosition_Result'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.SingleJointPosition_Result') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__single_joint_position__result cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__single_joint_position__result cls._CONVERT_TO_PY = module.convert_to_py_msg__action__single_joint_position__result cls._TYPE_SUPPORT = module.type_support_msg__action__single_joint_position__result cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__single_joint_position__result @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class SingleJointPosition_Result(metaclass=Metaclass_SingleJointPosition_Result): """Message class 'SingleJointPosition_Result'.""" __slots__ = [ ] _fields_and_field_types = { } SLOT_TYPES = ( ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_SingleJointPosition_Feedback(type): """Metaclass of message 'SingleJointPosition_Feedback'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.SingleJointPosition_Feedback') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__single_joint_position__feedback cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__single_joint_position__feedback cls._CONVERT_TO_PY = module.convert_to_py_msg__action__single_joint_position__feedback cls._TYPE_SUPPORT = module.type_support_msg__action__single_joint_position__feedback cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__single_joint_position__feedback from std_msgs.msg import Header if Header.__class__._TYPE_SUPPORT is None: Header.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class SingleJointPosition_Feedback(metaclass=Metaclass_SingleJointPosition_Feedback): """Message class 'SingleJointPosition_Feedback'.""" __slots__ = [ '_header', '_position', '_velocity', '_error', ] _fields_and_field_types = { 'header': 'std_msgs/Header', 'position': 'double', 'velocity': 'double', 'error': 'double', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['std_msgs', 'msg'], 'Header'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from std_msgs.msg import Header self.header = kwargs.get('header', Header()) self.position = kwargs.get('position', float()) self.velocity = kwargs.get('velocity', float()) self.error = kwargs.get('error', float()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.header != other.header: return False if self.position != other.position: return False if self.velocity != other.velocity: return False if self.error != other.error: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def header(self): """Message field 'header'.""" return self._header @header.setter def header(self, value): if __debug__: from std_msgs.msg import Header assert \ isinstance(value, Header), \ "The 'header' field must be a sub message of type 'Header'" self._header = value @property def position(self): """Message field 'position'.""" return self._position @position.setter def position(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'position' field must be of type 'float'" self._position = value @property def velocity(self): """Message field 'velocity'.""" return self._velocity @velocity.setter def velocity(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'velocity' field must be of type 'float'" self._velocity = value @property def error(self): """Message field 'error'.""" return self._error @error.setter def error(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'error' field must be of type 'float'" self._error = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_SingleJointPosition_SendGoal_Request(type): """Metaclass of message 'SingleJointPosition_SendGoal_Request'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.SingleJointPosition_SendGoal_Request') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__single_joint_position__send_goal__request cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__single_joint_position__send_goal__request cls._CONVERT_TO_PY = module.convert_to_py_msg__action__single_joint_position__send_goal__request cls._TYPE_SUPPORT = module.type_support_msg__action__single_joint_position__send_goal__request cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__single_joint_position__send_goal__request from control_msgs.action import SingleJointPosition if SingleJointPosition.Goal.__class__._TYPE_SUPPORT is None: SingleJointPosition.Goal.__class__.__import_type_support__() from unique_identifier_msgs.msg import UUID if UUID.__class__._TYPE_SUPPORT is None: UUID.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class SingleJointPosition_SendGoal_Request(metaclass=Metaclass_SingleJointPosition_SendGoal_Request): """Message class 'SingleJointPosition_SendGoal_Request'.""" __slots__ = [ '_goal_id', '_goal', ] _fields_and_field_types = { 'goal_id': 'unique_identifier_msgs/UUID', 'goal': 'control_msgs/SingleJointPosition_Goal', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['unique_identifier_msgs', 'msg'], 'UUID'), # noqa: E501 rosidl_parser.definition.NamespacedType(['control_msgs', 'action'], 'SingleJointPosition_Goal'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from unique_identifier_msgs.msg import UUID self.goal_id = kwargs.get('goal_id', UUID()) from control_msgs.action._single_joint_position import SingleJointPosition_Goal self.goal = kwargs.get('goal', SingleJointPosition_Goal()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.goal_id != other.goal_id: return False if self.goal != other.goal: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def goal_id(self): """Message field 'goal_id'.""" return self._goal_id @goal_id.setter def goal_id(self, value): if __debug__: from unique_identifier_msgs.msg import UUID assert \ isinstance(value, UUID), \ "The 'goal_id' field must be a sub message of type 'UUID'" self._goal_id = value @property def goal(self): """Message field 'goal'.""" return self._goal @goal.setter def goal(self, value): if __debug__: from control_msgs.action._single_joint_position import SingleJointPosition_Goal assert \ isinstance(value, SingleJointPosition_Goal), \ "The 'goal' field must be a sub message of type 'SingleJointPosition_Goal'" self._goal = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_SingleJointPosition_SendGoal_Response(type): """Metaclass of message 'SingleJointPosition_SendGoal_Response'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.SingleJointPosition_SendGoal_Response') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__single_joint_position__send_goal__response cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__single_joint_position__send_goal__response cls._CONVERT_TO_PY = module.convert_to_py_msg__action__single_joint_position__send_goal__response cls._TYPE_SUPPORT = module.type_support_msg__action__single_joint_position__send_goal__response cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__single_joint_position__send_goal__response from builtin_interfaces.msg import Time if Time.__class__._TYPE_SUPPORT is None: Time.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class SingleJointPosition_SendGoal_Response(metaclass=Metaclass_SingleJointPosition_SendGoal_Response): """Message class 'SingleJointPosition_SendGoal_Response'.""" __slots__ = [ '_accepted', '_stamp', ] _fields_and_field_types = { 'accepted': 'boolean', 'stamp': 'builtin_interfaces/Time', } SLOT_TYPES = ( rosidl_parser.definition.BasicType('boolean'), # noqa: E501 rosidl_parser.definition.NamespacedType(['builtin_interfaces', 'msg'], 'Time'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.accepted = kwargs.get('accepted', bool()) from builtin_interfaces.msg import Time self.stamp = kwargs.get('stamp', Time()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.accepted != other.accepted: return False if self.stamp != other.stamp: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def accepted(self): """Message field 'accepted'.""" return self._accepted @accepted.setter def accepted(self, value): if __debug__: assert \ isinstance(value, bool), \ "The 'accepted' field must be of type 'bool'" self._accepted = value @property def stamp(self): """Message field 'stamp'.""" return self._stamp @stamp.setter def stamp(self, value): if __debug__: from builtin_interfaces.msg import Time assert \ isinstance(value, Time), \ "The 'stamp' field must be a sub message of type 'Time'" self._stamp = value class Metaclass_SingleJointPosition_SendGoal(type): """Metaclass of service 'SingleJointPosition_SendGoal'.""" _TYPE_SUPPORT = None @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.SingleJointPosition_SendGoal') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._TYPE_SUPPORT = module.type_support_srv__action__single_joint_position__send_goal from control_msgs.action import _single_joint_position if _single_joint_position.Metaclass_SingleJointPosition_SendGoal_Request._TYPE_SUPPORT is None: _single_joint_position.Metaclass_SingleJointPosition_SendGoal_Request.__import_type_support__() if _single_joint_position.Metaclass_SingleJointPosition_SendGoal_Response._TYPE_SUPPORT is None: _single_joint_position.Metaclass_SingleJointPosition_SendGoal_Response.__import_type_support__() class SingleJointPosition_SendGoal(metaclass=Metaclass_SingleJointPosition_SendGoal): from control_msgs.action._single_joint_position import SingleJointPosition_SendGoal_Request as Request from control_msgs.action._single_joint_position import SingleJointPosition_SendGoal_Response as Response def __init__(self): raise NotImplementedError('Service classes can not be instantiated') # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_SingleJointPosition_GetResult_Request(type): """Metaclass of message 'SingleJointPosition_GetResult_Request'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.SingleJointPosition_GetResult_Request') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__single_joint_position__get_result__request cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__single_joint_position__get_result__request cls._CONVERT_TO_PY = module.convert_to_py_msg__action__single_joint_position__get_result__request cls._TYPE_SUPPORT = module.type_support_msg__action__single_joint_position__get_result__request cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__single_joint_position__get_result__request from unique_identifier_msgs.msg import UUID if UUID.__class__._TYPE_SUPPORT is None: UUID.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class SingleJointPosition_GetResult_Request(metaclass=Metaclass_SingleJointPosition_GetResult_Request): """Message class 'SingleJointPosition_GetResult_Request'.""" __slots__ = [ '_goal_id', ] _fields_and_field_types = { 'goal_id': 'unique_identifier_msgs/UUID', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['unique_identifier_msgs', 'msg'], 'UUID'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from unique_identifier_msgs.msg import UUID self.goal_id = kwargs.get('goal_id', UUID()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.goal_id != other.goal_id: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def goal_id(self): """Message field 'goal_id'.""" return self._goal_id @goal_id.setter def goal_id(self, value): if __debug__: from unique_identifier_msgs.msg import UUID assert \ isinstance(value, UUID), \ "The 'goal_id' field must be a sub message of type 'UUID'" self._goal_id = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_SingleJointPosition_GetResult_Response(type): """Metaclass of message 'SingleJointPosition_GetResult_Response'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.SingleJointPosition_GetResult_Response') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__single_joint_position__get_result__response cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__single_joint_position__get_result__response cls._CONVERT_TO_PY = module.convert_to_py_msg__action__single_joint_position__get_result__response cls._TYPE_SUPPORT = module.type_support_msg__action__single_joint_position__get_result__response cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__single_joint_position__get_result__response from control_msgs.action import SingleJointPosition if SingleJointPosition.Result.__class__._TYPE_SUPPORT is None: SingleJointPosition.Result.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class SingleJointPosition_GetResult_Response(metaclass=Metaclass_SingleJointPosition_GetResult_Response): """Message class 'SingleJointPosition_GetResult_Response'.""" __slots__ = [ '_status', '_result', ] _fields_and_field_types = { 'status': 'int8', 'result': 'control_msgs/SingleJointPosition_Result', } SLOT_TYPES = ( rosidl_parser.definition.BasicType('int8'), # noqa: E501 rosidl_parser.definition.NamespacedType(['control_msgs', 'action'], 'SingleJointPosition_Result'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.status = kwargs.get('status', int()) from control_msgs.action._single_joint_position import SingleJointPosition_Result self.result = kwargs.get('result', SingleJointPosition_Result()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.status != other.status: return False if self.result != other.result: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def status(self): """Message field 'status'.""" return self._status @status.setter def status(self, value): if __debug__: assert \ isinstance(value, int), \ "The 'status' field must be of type 'int'" assert value >= -128 and value < 128, \ "The 'status' field must be an integer in [-128, 127]" self._status = value @property def result(self): """Message field 'result'.""" return self._result @result.setter def result(self, value): if __debug__: from control_msgs.action._single_joint_position import SingleJointPosition_Result assert \ isinstance(value, SingleJointPosition_Result), \ "The 'result' field must be a sub message of type 'SingleJointPosition_Result'" self._result = value class Metaclass_SingleJointPosition_GetResult(type): """Metaclass of service 'SingleJointPosition_GetResult'.""" _TYPE_SUPPORT = None @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.SingleJointPosition_GetResult') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._TYPE_SUPPORT = module.type_support_srv__action__single_joint_position__get_result from control_msgs.action import _single_joint_position if _single_joint_position.Metaclass_SingleJointPosition_GetResult_Request._TYPE_SUPPORT is None: _single_joint_position.Metaclass_SingleJointPosition_GetResult_Request.__import_type_support__() if _single_joint_position.Metaclass_SingleJointPosition_GetResult_Response._TYPE_SUPPORT is None: _single_joint_position.Metaclass_SingleJointPosition_GetResult_Response.__import_type_support__() class SingleJointPosition_GetResult(metaclass=Metaclass_SingleJointPosition_GetResult): from control_msgs.action._single_joint_position import SingleJointPosition_GetResult_Request as Request from control_msgs.action._single_joint_position import SingleJointPosition_GetResult_Response as Response def __init__(self): raise NotImplementedError('Service classes can not be instantiated') # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_SingleJointPosition_FeedbackMessage(type): """Metaclass of message 'SingleJointPosition_FeedbackMessage'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.SingleJointPosition_FeedbackMessage') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__single_joint_position__feedback_message cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__single_joint_position__feedback_message cls._CONVERT_TO_PY = module.convert_to_py_msg__action__single_joint_position__feedback_message cls._TYPE_SUPPORT = module.type_support_msg__action__single_joint_position__feedback_message cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__single_joint_position__feedback_message from control_msgs.action import SingleJointPosition if SingleJointPosition.Feedback.__class__._TYPE_SUPPORT is None: SingleJointPosition.Feedback.__class__.__import_type_support__() from unique_identifier_msgs.msg import UUID if UUID.__class__._TYPE_SUPPORT is None: UUID.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class SingleJointPosition_FeedbackMessage(metaclass=Metaclass_SingleJointPosition_FeedbackMessage): """Message class 'SingleJointPosition_FeedbackMessage'.""" __slots__ = [ '_goal_id', '_feedback', ] _fields_and_field_types = { 'goal_id': 'unique_identifier_msgs/UUID', 'feedback': 'control_msgs/SingleJointPosition_Feedback', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['unique_identifier_msgs', 'msg'], 'UUID'), # noqa: E501 rosidl_parser.definition.NamespacedType(['control_msgs', 'action'], 'SingleJointPosition_Feedback'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from unique_identifier_msgs.msg import UUID self.goal_id = kwargs.get('goal_id', UUID()) from control_msgs.action._single_joint_position import SingleJointPosition_Feedback self.feedback = kwargs.get('feedback', SingleJointPosition_Feedback()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.goal_id != other.goal_id: return False if self.feedback != other.feedback: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def goal_id(self): """Message field 'goal_id'.""" return self._goal_id @goal_id.setter def goal_id(self, value): if __debug__: from unique_identifier_msgs.msg import UUID assert \ isinstance(value, UUID), \ "The 'goal_id' field must be a sub message of type 'UUID'" self._goal_id = value @property def feedback(self): """Message field 'feedback'.""" return self._feedback @feedback.setter def feedback(self, value): if __debug__: from control_msgs.action._single_joint_position import SingleJointPosition_Feedback assert \ isinstance(value, SingleJointPosition_Feedback), \ "The 'feedback' field must be a sub message of type 'SingleJointPosition_Feedback'" self._feedback = value class Metaclass_SingleJointPosition(type): """Metaclass of action 'SingleJointPosition'.""" _TYPE_SUPPORT = None @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.SingleJointPosition') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._TYPE_SUPPORT = module.type_support_action__action__single_joint_position from action_msgs.msg import _goal_status_array if _goal_status_array.Metaclass_GoalStatusArray._TYPE_SUPPORT is None: _goal_status_array.Metaclass_GoalStatusArray.__import_type_support__() from action_msgs.srv import _cancel_goal if _cancel_goal.Metaclass_CancelGoal._TYPE_SUPPORT is None: _cancel_goal.Metaclass_CancelGoal.__import_type_support__() from control_msgs.action import _single_joint_position if _single_joint_position.Metaclass_SingleJointPosition_SendGoal._TYPE_SUPPORT is None: _single_joint_position.Metaclass_SingleJointPosition_SendGoal.__import_type_support__() if _single_joint_position.Metaclass_SingleJointPosition_GetResult._TYPE_SUPPORT is None: _single_joint_position.Metaclass_SingleJointPosition_GetResult.__import_type_support__() if _single_joint_position.Metaclass_SingleJointPosition_FeedbackMessage._TYPE_SUPPORT is None: _single_joint_position.Metaclass_SingleJointPosition_FeedbackMessage.__import_type_support__() class SingleJointPosition(metaclass=Metaclass_SingleJointPosition): # The goal message defined in the action definition. from control_msgs.action._single_joint_position import SingleJointPosition_Goal as Goal # The result message defined in the action definition. from control_msgs.action._single_joint_position import SingleJointPosition_Result as Result # The feedback message defined in the action definition. from control_msgs.action._single_joint_position import SingleJointPosition_Feedback as Feedback class Impl: # The send_goal service using a wrapped version of the goal message as a request. from control_msgs.action._single_joint_position import SingleJointPosition_SendGoal as SendGoalService # The get_result service using a wrapped version of the result message as a response. from control_msgs.action._single_joint_position import SingleJointPosition_GetResult as GetResultService # The feedback message with generic fields which wraps the feedback message. from control_msgs.action._single_joint_position import SingleJointPosition_FeedbackMessage as FeedbackMessage # The generic service to cancel a goal. from action_msgs.srv._cancel_goal import CancelGoal as CancelGoalService # The generic message for get the status of a goal. from action_msgs.msg._goal_status_array import GoalStatusArray as GoalStatusMessage def __init__(self): raise NotImplementedError('Action classes can not be instantiated')
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/action/_follow_joint_trajectory.py
# generated from rosidl_generator_py/resource/_idl.py.em # with input from control_msgs:action/FollowJointTrajectory.idl # generated code does not contain a copyright notice # Import statements for member types import rosidl_parser.definition # noqa: E402, I100 class Metaclass_FollowJointTrajectory_Goal(type): """Metaclass of message 'FollowJointTrajectory_Goal'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.FollowJointTrajectory_Goal') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__follow_joint_trajectory__goal cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__follow_joint_trajectory__goal cls._CONVERT_TO_PY = module.convert_to_py_msg__action__follow_joint_trajectory__goal cls._TYPE_SUPPORT = module.type_support_msg__action__follow_joint_trajectory__goal cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__follow_joint_trajectory__goal from builtin_interfaces.msg import Duration if Duration.__class__._TYPE_SUPPORT is None: Duration.__class__.__import_type_support__() from control_msgs.msg import JointTolerance if JointTolerance.__class__._TYPE_SUPPORT is None: JointTolerance.__class__.__import_type_support__() from trajectory_msgs.msg import JointTrajectory if JointTrajectory.__class__._TYPE_SUPPORT is None: JointTrajectory.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class FollowJointTrajectory_Goal(metaclass=Metaclass_FollowJointTrajectory_Goal): """Message class 'FollowJointTrajectory_Goal'.""" __slots__ = [ '_trajectory', '_path_tolerance', '_goal_tolerance', '_goal_time_tolerance', ] _fields_and_field_types = { 'trajectory': 'trajectory_msgs/JointTrajectory', 'path_tolerance': 'sequence<control_msgs/JointTolerance>', 'goal_tolerance': 'sequence<control_msgs/JointTolerance>', 'goal_time_tolerance': 'builtin_interfaces/Duration', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['trajectory_msgs', 'msg'], 'JointTrajectory'), # noqa: E501 rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.NamespacedType(['control_msgs', 'msg'], 'JointTolerance')), # noqa: E501 rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.NamespacedType(['control_msgs', 'msg'], 'JointTolerance')), # noqa: E501 rosidl_parser.definition.NamespacedType(['builtin_interfaces', 'msg'], 'Duration'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from trajectory_msgs.msg import JointTrajectory self.trajectory = kwargs.get('trajectory', JointTrajectory()) self.path_tolerance = kwargs.get('path_tolerance', []) self.goal_tolerance = kwargs.get('goal_tolerance', []) from builtin_interfaces.msg import Duration self.goal_time_tolerance = kwargs.get('goal_time_tolerance', Duration()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.trajectory != other.trajectory: return False if self.path_tolerance != other.path_tolerance: return False if self.goal_tolerance != other.goal_tolerance: return False if self.goal_time_tolerance != other.goal_time_tolerance: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def trajectory(self): """Message field 'trajectory'.""" return self._trajectory @trajectory.setter def trajectory(self, value): if __debug__: from trajectory_msgs.msg import JointTrajectory assert \ isinstance(value, JointTrajectory), \ "The 'trajectory' field must be a sub message of type 'JointTrajectory'" self._trajectory = value @property def path_tolerance(self): """Message field 'path_tolerance'.""" return self._path_tolerance @path_tolerance.setter def path_tolerance(self, value): if __debug__: from control_msgs.msg import JointTolerance from collections.abc import Sequence from collections.abc import Set from collections import UserList from collections import UserString assert \ ((isinstance(value, Sequence) or isinstance(value, Set) or isinstance(value, UserList)) and not isinstance(value, str) and not isinstance(value, UserString) and all(isinstance(v, JointTolerance) for v in value) and True), \ "The 'path_tolerance' field must be a set or sequence and each value of type 'JointTolerance'" self._path_tolerance = value @property def goal_tolerance(self): """Message field 'goal_tolerance'.""" return self._goal_tolerance @goal_tolerance.setter def goal_tolerance(self, value): if __debug__: from control_msgs.msg import JointTolerance from collections.abc import Sequence from collections.abc import Set from collections import UserList from collections import UserString assert \ ((isinstance(value, Sequence) or isinstance(value, Set) or isinstance(value, UserList)) and not isinstance(value, str) and not isinstance(value, UserString) and all(isinstance(v, JointTolerance) for v in value) and True), \ "The 'goal_tolerance' field must be a set or sequence and each value of type 'JointTolerance'" self._goal_tolerance = value @property def goal_time_tolerance(self): """Message field 'goal_time_tolerance'.""" return self._goal_time_tolerance @goal_time_tolerance.setter def goal_time_tolerance(self, value): if __debug__: from builtin_interfaces.msg import Duration assert \ isinstance(value, Duration), \ "The 'goal_time_tolerance' field must be a sub message of type 'Duration'" self._goal_time_tolerance = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_FollowJointTrajectory_Result(type): """Metaclass of message 'FollowJointTrajectory_Result'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { 'SUCCESSFUL': 0, 'INVALID_GOAL': -1, 'INVALID_JOINTS': -2, 'OLD_HEADER_TIMESTAMP': -3, 'PATH_TOLERANCE_VIOLATED': -4, 'GOAL_TOLERANCE_VIOLATED': -5, } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.FollowJointTrajectory_Result') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__follow_joint_trajectory__result cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__follow_joint_trajectory__result cls._CONVERT_TO_PY = module.convert_to_py_msg__action__follow_joint_trajectory__result cls._TYPE_SUPPORT = module.type_support_msg__action__follow_joint_trajectory__result cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__follow_joint_trajectory__result @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { 'SUCCESSFUL': cls.__constants['SUCCESSFUL'], 'INVALID_GOAL': cls.__constants['INVALID_GOAL'], 'INVALID_JOINTS': cls.__constants['INVALID_JOINTS'], 'OLD_HEADER_TIMESTAMP': cls.__constants['OLD_HEADER_TIMESTAMP'], 'PATH_TOLERANCE_VIOLATED': cls.__constants['PATH_TOLERANCE_VIOLATED'], 'GOAL_TOLERANCE_VIOLATED': cls.__constants['GOAL_TOLERANCE_VIOLATED'], } @property def SUCCESSFUL(self): """Message constant 'SUCCESSFUL'.""" return Metaclass_FollowJointTrajectory_Result.__constants['SUCCESSFUL'] @property def INVALID_GOAL(self): """Message constant 'INVALID_GOAL'.""" return Metaclass_FollowJointTrajectory_Result.__constants['INVALID_GOAL'] @property def INVALID_JOINTS(self): """Message constant 'INVALID_JOINTS'.""" return Metaclass_FollowJointTrajectory_Result.__constants['INVALID_JOINTS'] @property def OLD_HEADER_TIMESTAMP(self): """Message constant 'OLD_HEADER_TIMESTAMP'.""" return Metaclass_FollowJointTrajectory_Result.__constants['OLD_HEADER_TIMESTAMP'] @property def PATH_TOLERANCE_VIOLATED(self): """Message constant 'PATH_TOLERANCE_VIOLATED'.""" return Metaclass_FollowJointTrajectory_Result.__constants['PATH_TOLERANCE_VIOLATED'] @property def GOAL_TOLERANCE_VIOLATED(self): """Message constant 'GOAL_TOLERANCE_VIOLATED'.""" return Metaclass_FollowJointTrajectory_Result.__constants['GOAL_TOLERANCE_VIOLATED'] class FollowJointTrajectory_Result(metaclass=Metaclass_FollowJointTrajectory_Result): """ Message class 'FollowJointTrajectory_Result'. Constants: SUCCESSFUL INVALID_GOAL INVALID_JOINTS OLD_HEADER_TIMESTAMP PATH_TOLERANCE_VIOLATED GOAL_TOLERANCE_VIOLATED """ __slots__ = [ '_error_code', '_error_string', ] _fields_and_field_types = { 'error_code': 'int32', 'error_string': 'string', } SLOT_TYPES = ( rosidl_parser.definition.BasicType('int32'), # noqa: E501 rosidl_parser.definition.UnboundedString(), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.error_code = kwargs.get('error_code', int()) self.error_string = kwargs.get('error_string', str()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.error_code != other.error_code: return False if self.error_string != other.error_string: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def error_code(self): """Message field 'error_code'.""" return self._error_code @error_code.setter def error_code(self, value): if __debug__: assert \ isinstance(value, int), \ "The 'error_code' field must be of type 'int'" assert value >= -2147483648 and value < 2147483648, \ "The 'error_code' field must be an integer in [-2147483648, 2147483647]" self._error_code = value @property def error_string(self): """Message field 'error_string'.""" return self._error_string @error_string.setter def error_string(self, value): if __debug__: assert \ isinstance(value, str), \ "The 'error_string' field must be of type 'str'" self._error_string = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_FollowJointTrajectory_Feedback(type): """Metaclass of message 'FollowJointTrajectory_Feedback'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.FollowJointTrajectory_Feedback') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__follow_joint_trajectory__feedback cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__follow_joint_trajectory__feedback cls._CONVERT_TO_PY = module.convert_to_py_msg__action__follow_joint_trajectory__feedback cls._TYPE_SUPPORT = module.type_support_msg__action__follow_joint_trajectory__feedback cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__follow_joint_trajectory__feedback from std_msgs.msg import Header if Header.__class__._TYPE_SUPPORT is None: Header.__class__.__import_type_support__() from trajectory_msgs.msg import JointTrajectoryPoint if JointTrajectoryPoint.__class__._TYPE_SUPPORT is None: JointTrajectoryPoint.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class FollowJointTrajectory_Feedback(metaclass=Metaclass_FollowJointTrajectory_Feedback): """Message class 'FollowJointTrajectory_Feedback'.""" __slots__ = [ '_header', '_joint_names', '_desired', '_actual', '_error', ] _fields_and_field_types = { 'header': 'std_msgs/Header', 'joint_names': 'sequence<string>', 'desired': 'trajectory_msgs/JointTrajectoryPoint', 'actual': 'trajectory_msgs/JointTrajectoryPoint', 'error': 'trajectory_msgs/JointTrajectoryPoint', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['std_msgs', 'msg'], 'Header'), # noqa: E501 rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.UnboundedString()), # noqa: E501 rosidl_parser.definition.NamespacedType(['trajectory_msgs', 'msg'], 'JointTrajectoryPoint'), # noqa: E501 rosidl_parser.definition.NamespacedType(['trajectory_msgs', 'msg'], 'JointTrajectoryPoint'), # noqa: E501 rosidl_parser.definition.NamespacedType(['trajectory_msgs', 'msg'], 'JointTrajectoryPoint'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from std_msgs.msg import Header self.header = kwargs.get('header', Header()) self.joint_names = kwargs.get('joint_names', []) from trajectory_msgs.msg import JointTrajectoryPoint self.desired = kwargs.get('desired', JointTrajectoryPoint()) from trajectory_msgs.msg import JointTrajectoryPoint self.actual = kwargs.get('actual', JointTrajectoryPoint()) from trajectory_msgs.msg import JointTrajectoryPoint self.error = kwargs.get('error', JointTrajectoryPoint()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.header != other.header: return False if self.joint_names != other.joint_names: return False if self.desired != other.desired: return False if self.actual != other.actual: return False if self.error != other.error: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def header(self): """Message field 'header'.""" return self._header @header.setter def header(self, value): if __debug__: from std_msgs.msg import Header assert \ isinstance(value, Header), \ "The 'header' field must be a sub message of type 'Header'" self._header = value @property def joint_names(self): """Message field 'joint_names'.""" return self._joint_names @joint_names.setter def joint_names(self, value): if __debug__: from collections.abc import Sequence from collections.abc import Set from collections import UserList from collections import UserString assert \ ((isinstance(value, Sequence) or isinstance(value, Set) or isinstance(value, UserList)) and not isinstance(value, str) and not isinstance(value, UserString) and all(isinstance(v, str) for v in value) and True), \ "The 'joint_names' field must be a set or sequence and each value of type 'str'" self._joint_names = value @property def desired(self): """Message field 'desired'.""" return self._desired @desired.setter def desired(self, value): if __debug__: from trajectory_msgs.msg import JointTrajectoryPoint assert \ isinstance(value, JointTrajectoryPoint), \ "The 'desired' field must be a sub message of type 'JointTrajectoryPoint'" self._desired = value @property def actual(self): """Message field 'actual'.""" return self._actual @actual.setter def actual(self, value): if __debug__: from trajectory_msgs.msg import JointTrajectoryPoint assert \ isinstance(value, JointTrajectoryPoint), \ "The 'actual' field must be a sub message of type 'JointTrajectoryPoint'" self._actual = value @property def error(self): """Message field 'error'.""" return self._error @error.setter def error(self, value): if __debug__: from trajectory_msgs.msg import JointTrajectoryPoint assert \ isinstance(value, JointTrajectoryPoint), \ "The 'error' field must be a sub message of type 'JointTrajectoryPoint'" self._error = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_FollowJointTrajectory_SendGoal_Request(type): """Metaclass of message 'FollowJointTrajectory_SendGoal_Request'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.FollowJointTrajectory_SendGoal_Request') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__follow_joint_trajectory__send_goal__request cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__follow_joint_trajectory__send_goal__request cls._CONVERT_TO_PY = module.convert_to_py_msg__action__follow_joint_trajectory__send_goal__request cls._TYPE_SUPPORT = module.type_support_msg__action__follow_joint_trajectory__send_goal__request cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__follow_joint_trajectory__send_goal__request from control_msgs.action import FollowJointTrajectory if FollowJointTrajectory.Goal.__class__._TYPE_SUPPORT is None: FollowJointTrajectory.Goal.__class__.__import_type_support__() from unique_identifier_msgs.msg import UUID if UUID.__class__._TYPE_SUPPORT is None: UUID.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class FollowJointTrajectory_SendGoal_Request(metaclass=Metaclass_FollowJointTrajectory_SendGoal_Request): """Message class 'FollowJointTrajectory_SendGoal_Request'.""" __slots__ = [ '_goal_id', '_goal', ] _fields_and_field_types = { 'goal_id': 'unique_identifier_msgs/UUID', 'goal': 'control_msgs/FollowJointTrajectory_Goal', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['unique_identifier_msgs', 'msg'], 'UUID'), # noqa: E501 rosidl_parser.definition.NamespacedType(['control_msgs', 'action'], 'FollowJointTrajectory_Goal'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from unique_identifier_msgs.msg import UUID self.goal_id = kwargs.get('goal_id', UUID()) from control_msgs.action._follow_joint_trajectory import FollowJointTrajectory_Goal self.goal = kwargs.get('goal', FollowJointTrajectory_Goal()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.goal_id != other.goal_id: return False if self.goal != other.goal: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def goal_id(self): """Message field 'goal_id'.""" return self._goal_id @goal_id.setter def goal_id(self, value): if __debug__: from unique_identifier_msgs.msg import UUID assert \ isinstance(value, UUID), \ "The 'goal_id' field must be a sub message of type 'UUID'" self._goal_id = value @property def goal(self): """Message field 'goal'.""" return self._goal @goal.setter def goal(self, value): if __debug__: from control_msgs.action._follow_joint_trajectory import FollowJointTrajectory_Goal assert \ isinstance(value, FollowJointTrajectory_Goal), \ "The 'goal' field must be a sub message of type 'FollowJointTrajectory_Goal'" self._goal = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_FollowJointTrajectory_SendGoal_Response(type): """Metaclass of message 'FollowJointTrajectory_SendGoal_Response'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.FollowJointTrajectory_SendGoal_Response') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__follow_joint_trajectory__send_goal__response cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__follow_joint_trajectory__send_goal__response cls._CONVERT_TO_PY = module.convert_to_py_msg__action__follow_joint_trajectory__send_goal__response cls._TYPE_SUPPORT = module.type_support_msg__action__follow_joint_trajectory__send_goal__response cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__follow_joint_trajectory__send_goal__response from builtin_interfaces.msg import Time if Time.__class__._TYPE_SUPPORT is None: Time.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class FollowJointTrajectory_SendGoal_Response(metaclass=Metaclass_FollowJointTrajectory_SendGoal_Response): """Message class 'FollowJointTrajectory_SendGoal_Response'.""" __slots__ = [ '_accepted', '_stamp', ] _fields_and_field_types = { 'accepted': 'boolean', 'stamp': 'builtin_interfaces/Time', } SLOT_TYPES = ( rosidl_parser.definition.BasicType('boolean'), # noqa: E501 rosidl_parser.definition.NamespacedType(['builtin_interfaces', 'msg'], 'Time'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.accepted = kwargs.get('accepted', bool()) from builtin_interfaces.msg import Time self.stamp = kwargs.get('stamp', Time()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.accepted != other.accepted: return False if self.stamp != other.stamp: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def accepted(self): """Message field 'accepted'.""" return self._accepted @accepted.setter def accepted(self, value): if __debug__: assert \ isinstance(value, bool), \ "The 'accepted' field must be of type 'bool'" self._accepted = value @property def stamp(self): """Message field 'stamp'.""" return self._stamp @stamp.setter def stamp(self, value): if __debug__: from builtin_interfaces.msg import Time assert \ isinstance(value, Time), \ "The 'stamp' field must be a sub message of type 'Time'" self._stamp = value class Metaclass_FollowJointTrajectory_SendGoal(type): """Metaclass of service 'FollowJointTrajectory_SendGoal'.""" _TYPE_SUPPORT = None @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.FollowJointTrajectory_SendGoal') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._TYPE_SUPPORT = module.type_support_srv__action__follow_joint_trajectory__send_goal from control_msgs.action import _follow_joint_trajectory if _follow_joint_trajectory.Metaclass_FollowJointTrajectory_SendGoal_Request._TYPE_SUPPORT is None: _follow_joint_trajectory.Metaclass_FollowJointTrajectory_SendGoal_Request.__import_type_support__() if _follow_joint_trajectory.Metaclass_FollowJointTrajectory_SendGoal_Response._TYPE_SUPPORT is None: _follow_joint_trajectory.Metaclass_FollowJointTrajectory_SendGoal_Response.__import_type_support__() class FollowJointTrajectory_SendGoal(metaclass=Metaclass_FollowJointTrajectory_SendGoal): from control_msgs.action._follow_joint_trajectory import FollowJointTrajectory_SendGoal_Request as Request from control_msgs.action._follow_joint_trajectory import FollowJointTrajectory_SendGoal_Response as Response def __init__(self): raise NotImplementedError('Service classes can not be instantiated') # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_FollowJointTrajectory_GetResult_Request(type): """Metaclass of message 'FollowJointTrajectory_GetResult_Request'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.FollowJointTrajectory_GetResult_Request') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__follow_joint_trajectory__get_result__request cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__follow_joint_trajectory__get_result__request cls._CONVERT_TO_PY = module.convert_to_py_msg__action__follow_joint_trajectory__get_result__request cls._TYPE_SUPPORT = module.type_support_msg__action__follow_joint_trajectory__get_result__request cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__follow_joint_trajectory__get_result__request from unique_identifier_msgs.msg import UUID if UUID.__class__._TYPE_SUPPORT is None: UUID.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class FollowJointTrajectory_GetResult_Request(metaclass=Metaclass_FollowJointTrajectory_GetResult_Request): """Message class 'FollowJointTrajectory_GetResult_Request'.""" __slots__ = [ '_goal_id', ] _fields_and_field_types = { 'goal_id': 'unique_identifier_msgs/UUID', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['unique_identifier_msgs', 'msg'], 'UUID'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from unique_identifier_msgs.msg import UUID self.goal_id = kwargs.get('goal_id', UUID()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.goal_id != other.goal_id: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def goal_id(self): """Message field 'goal_id'.""" return self._goal_id @goal_id.setter def goal_id(self, value): if __debug__: from unique_identifier_msgs.msg import UUID assert \ isinstance(value, UUID), \ "The 'goal_id' field must be a sub message of type 'UUID'" self._goal_id = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_FollowJointTrajectory_GetResult_Response(type): """Metaclass of message 'FollowJointTrajectory_GetResult_Response'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.FollowJointTrajectory_GetResult_Response') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__follow_joint_trajectory__get_result__response cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__follow_joint_trajectory__get_result__response cls._CONVERT_TO_PY = module.convert_to_py_msg__action__follow_joint_trajectory__get_result__response cls._TYPE_SUPPORT = module.type_support_msg__action__follow_joint_trajectory__get_result__response cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__follow_joint_trajectory__get_result__response from control_msgs.action import FollowJointTrajectory if FollowJointTrajectory.Result.__class__._TYPE_SUPPORT is None: FollowJointTrajectory.Result.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class FollowJointTrajectory_GetResult_Response(metaclass=Metaclass_FollowJointTrajectory_GetResult_Response): """Message class 'FollowJointTrajectory_GetResult_Response'.""" __slots__ = [ '_status', '_result', ] _fields_and_field_types = { 'status': 'int8', 'result': 'control_msgs/FollowJointTrajectory_Result', } SLOT_TYPES = ( rosidl_parser.definition.BasicType('int8'), # noqa: E501 rosidl_parser.definition.NamespacedType(['control_msgs', 'action'], 'FollowJointTrajectory_Result'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.status = kwargs.get('status', int()) from control_msgs.action._follow_joint_trajectory import FollowJointTrajectory_Result self.result = kwargs.get('result', FollowJointTrajectory_Result()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.status != other.status: return False if self.result != other.result: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def status(self): """Message field 'status'.""" return self._status @status.setter def status(self, value): if __debug__: assert \ isinstance(value, int), \ "The 'status' field must be of type 'int'" assert value >= -128 and value < 128, \ "The 'status' field must be an integer in [-128, 127]" self._status = value @property def result(self): """Message field 'result'.""" return self._result @result.setter def result(self, value): if __debug__: from control_msgs.action._follow_joint_trajectory import FollowJointTrajectory_Result assert \ isinstance(value, FollowJointTrajectory_Result), \ "The 'result' field must be a sub message of type 'FollowJointTrajectory_Result'" self._result = value class Metaclass_FollowJointTrajectory_GetResult(type): """Metaclass of service 'FollowJointTrajectory_GetResult'.""" _TYPE_SUPPORT = None @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.FollowJointTrajectory_GetResult') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._TYPE_SUPPORT = module.type_support_srv__action__follow_joint_trajectory__get_result from control_msgs.action import _follow_joint_trajectory if _follow_joint_trajectory.Metaclass_FollowJointTrajectory_GetResult_Request._TYPE_SUPPORT is None: _follow_joint_trajectory.Metaclass_FollowJointTrajectory_GetResult_Request.__import_type_support__() if _follow_joint_trajectory.Metaclass_FollowJointTrajectory_GetResult_Response._TYPE_SUPPORT is None: _follow_joint_trajectory.Metaclass_FollowJointTrajectory_GetResult_Response.__import_type_support__() class FollowJointTrajectory_GetResult(metaclass=Metaclass_FollowJointTrajectory_GetResult): from control_msgs.action._follow_joint_trajectory import FollowJointTrajectory_GetResult_Request as Request from control_msgs.action._follow_joint_trajectory import FollowJointTrajectory_GetResult_Response as Response def __init__(self): raise NotImplementedError('Service classes can not be instantiated') # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_FollowJointTrajectory_FeedbackMessage(type): """Metaclass of message 'FollowJointTrajectory_FeedbackMessage'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.FollowJointTrajectory_FeedbackMessage') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__follow_joint_trajectory__feedback_message cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__follow_joint_trajectory__feedback_message cls._CONVERT_TO_PY = module.convert_to_py_msg__action__follow_joint_trajectory__feedback_message cls._TYPE_SUPPORT = module.type_support_msg__action__follow_joint_trajectory__feedback_message cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__follow_joint_trajectory__feedback_message from control_msgs.action import FollowJointTrajectory if FollowJointTrajectory.Feedback.__class__._TYPE_SUPPORT is None: FollowJointTrajectory.Feedback.__class__.__import_type_support__() from unique_identifier_msgs.msg import UUID if UUID.__class__._TYPE_SUPPORT is None: UUID.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class FollowJointTrajectory_FeedbackMessage(metaclass=Metaclass_FollowJointTrajectory_FeedbackMessage): """Message class 'FollowJointTrajectory_FeedbackMessage'.""" __slots__ = [ '_goal_id', '_feedback', ] _fields_and_field_types = { 'goal_id': 'unique_identifier_msgs/UUID', 'feedback': 'control_msgs/FollowJointTrajectory_Feedback', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['unique_identifier_msgs', 'msg'], 'UUID'), # noqa: E501 rosidl_parser.definition.NamespacedType(['control_msgs', 'action'], 'FollowJointTrajectory_Feedback'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from unique_identifier_msgs.msg import UUID self.goal_id = kwargs.get('goal_id', UUID()) from control_msgs.action._follow_joint_trajectory import FollowJointTrajectory_Feedback self.feedback = kwargs.get('feedback', FollowJointTrajectory_Feedback()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.goal_id != other.goal_id: return False if self.feedback != other.feedback: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def goal_id(self): """Message field 'goal_id'.""" return self._goal_id @goal_id.setter def goal_id(self, value): if __debug__: from unique_identifier_msgs.msg import UUID assert \ isinstance(value, UUID), \ "The 'goal_id' field must be a sub message of type 'UUID'" self._goal_id = value @property def feedback(self): """Message field 'feedback'.""" return self._feedback @feedback.setter def feedback(self, value): if __debug__: from control_msgs.action._follow_joint_trajectory import FollowJointTrajectory_Feedback assert \ isinstance(value, FollowJointTrajectory_Feedback), \ "The 'feedback' field must be a sub message of type 'FollowJointTrajectory_Feedback'" self._feedback = value class Metaclass_FollowJointTrajectory(type): """Metaclass of action 'FollowJointTrajectory'.""" _TYPE_SUPPORT = None @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.FollowJointTrajectory') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._TYPE_SUPPORT = module.type_support_action__action__follow_joint_trajectory from action_msgs.msg import _goal_status_array if _goal_status_array.Metaclass_GoalStatusArray._TYPE_SUPPORT is None: _goal_status_array.Metaclass_GoalStatusArray.__import_type_support__() from action_msgs.srv import _cancel_goal if _cancel_goal.Metaclass_CancelGoal._TYPE_SUPPORT is None: _cancel_goal.Metaclass_CancelGoal.__import_type_support__() from control_msgs.action import _follow_joint_trajectory if _follow_joint_trajectory.Metaclass_FollowJointTrajectory_SendGoal._TYPE_SUPPORT is None: _follow_joint_trajectory.Metaclass_FollowJointTrajectory_SendGoal.__import_type_support__() if _follow_joint_trajectory.Metaclass_FollowJointTrajectory_GetResult._TYPE_SUPPORT is None: _follow_joint_trajectory.Metaclass_FollowJointTrajectory_GetResult.__import_type_support__() if _follow_joint_trajectory.Metaclass_FollowJointTrajectory_FeedbackMessage._TYPE_SUPPORT is None: _follow_joint_trajectory.Metaclass_FollowJointTrajectory_FeedbackMessage.__import_type_support__() class FollowJointTrajectory(metaclass=Metaclass_FollowJointTrajectory): # The goal message defined in the action definition. from control_msgs.action._follow_joint_trajectory import FollowJointTrajectory_Goal as Goal # The result message defined in the action definition. from control_msgs.action._follow_joint_trajectory import FollowJointTrajectory_Result as Result # The feedback message defined in the action definition. from control_msgs.action._follow_joint_trajectory import FollowJointTrajectory_Feedback as Feedback class Impl: # The send_goal service using a wrapped version of the goal message as a request. from control_msgs.action._follow_joint_trajectory import FollowJointTrajectory_SendGoal as SendGoalService # The get_result service using a wrapped version of the result message as a response. from control_msgs.action._follow_joint_trajectory import FollowJointTrajectory_GetResult as GetResultService # The feedback message with generic fields which wraps the feedback message. from control_msgs.action._follow_joint_trajectory import FollowJointTrajectory_FeedbackMessage as FeedbackMessage # The generic service to cancel a goal. from action_msgs.srv._cancel_goal import CancelGoal as CancelGoalService # The generic message for get the status of a goal. from action_msgs.msg._goal_status_array import GoalStatusArray as GoalStatusMessage def __init__(self): raise NotImplementedError('Action classes can not be instantiated')
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/action/_point_head.py
# generated from rosidl_generator_py/resource/_idl.py.em # with input from control_msgs:action/PointHead.idl # generated code does not contain a copyright notice # Import statements for member types import rosidl_parser.definition # noqa: E402, I100 class Metaclass_PointHead_Goal(type): """Metaclass of message 'PointHead_Goal'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.PointHead_Goal') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__point_head__goal cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__point_head__goal cls._CONVERT_TO_PY = module.convert_to_py_msg__action__point_head__goal cls._TYPE_SUPPORT = module.type_support_msg__action__point_head__goal cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__point_head__goal from builtin_interfaces.msg import Duration if Duration.__class__._TYPE_SUPPORT is None: Duration.__class__.__import_type_support__() from geometry_msgs.msg import PointStamped if PointStamped.__class__._TYPE_SUPPORT is None: PointStamped.__class__.__import_type_support__() from geometry_msgs.msg import Vector3 if Vector3.__class__._TYPE_SUPPORT is None: Vector3.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class PointHead_Goal(metaclass=Metaclass_PointHead_Goal): """Message class 'PointHead_Goal'.""" __slots__ = [ '_target', '_pointing_axis', '_pointing_frame', '_min_duration', '_max_velocity', ] _fields_and_field_types = { 'target': 'geometry_msgs/PointStamped', 'pointing_axis': 'geometry_msgs/Vector3', 'pointing_frame': 'string', 'min_duration': 'builtin_interfaces/Duration', 'max_velocity': 'double', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['geometry_msgs', 'msg'], 'PointStamped'), # noqa: E501 rosidl_parser.definition.NamespacedType(['geometry_msgs', 'msg'], 'Vector3'), # noqa: E501 rosidl_parser.definition.UnboundedString(), # noqa: E501 rosidl_parser.definition.NamespacedType(['builtin_interfaces', 'msg'], 'Duration'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from geometry_msgs.msg import PointStamped self.target = kwargs.get('target', PointStamped()) from geometry_msgs.msg import Vector3 self.pointing_axis = kwargs.get('pointing_axis', Vector3()) self.pointing_frame = kwargs.get('pointing_frame', str()) from builtin_interfaces.msg import Duration self.min_duration = kwargs.get('min_duration', Duration()) self.max_velocity = kwargs.get('max_velocity', float()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.target != other.target: return False if self.pointing_axis != other.pointing_axis: return False if self.pointing_frame != other.pointing_frame: return False if self.min_duration != other.min_duration: return False if self.max_velocity != other.max_velocity: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def target(self): """Message field 'target'.""" return self._target @target.setter def target(self, value): if __debug__: from geometry_msgs.msg import PointStamped assert \ isinstance(value, PointStamped), \ "The 'target' field must be a sub message of type 'PointStamped'" self._target = value @property def pointing_axis(self): """Message field 'pointing_axis'.""" return self._pointing_axis @pointing_axis.setter def pointing_axis(self, value): if __debug__: from geometry_msgs.msg import Vector3 assert \ isinstance(value, Vector3), \ "The 'pointing_axis' field must be a sub message of type 'Vector3'" self._pointing_axis = value @property def pointing_frame(self): """Message field 'pointing_frame'.""" return self._pointing_frame @pointing_frame.setter def pointing_frame(self, value): if __debug__: assert \ isinstance(value, str), \ "The 'pointing_frame' field must be of type 'str'" self._pointing_frame = value @property def min_duration(self): """Message field 'min_duration'.""" return self._min_duration @min_duration.setter def min_duration(self, value): if __debug__: from builtin_interfaces.msg import Duration assert \ isinstance(value, Duration), \ "The 'min_duration' field must be a sub message of type 'Duration'" self._min_duration = value @property def max_velocity(self): """Message field 'max_velocity'.""" return self._max_velocity @max_velocity.setter def max_velocity(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'max_velocity' field must be of type 'float'" self._max_velocity = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_PointHead_Result(type): """Metaclass of message 'PointHead_Result'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.PointHead_Result') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__point_head__result cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__point_head__result cls._CONVERT_TO_PY = module.convert_to_py_msg__action__point_head__result cls._TYPE_SUPPORT = module.type_support_msg__action__point_head__result cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__point_head__result @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class PointHead_Result(metaclass=Metaclass_PointHead_Result): """Message class 'PointHead_Result'.""" __slots__ = [ ] _fields_and_field_types = { } SLOT_TYPES = ( ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_PointHead_Feedback(type): """Metaclass of message 'PointHead_Feedback'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.PointHead_Feedback') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__point_head__feedback cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__point_head__feedback cls._CONVERT_TO_PY = module.convert_to_py_msg__action__point_head__feedback cls._TYPE_SUPPORT = module.type_support_msg__action__point_head__feedback cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__point_head__feedback @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class PointHead_Feedback(metaclass=Metaclass_PointHead_Feedback): """Message class 'PointHead_Feedback'.""" __slots__ = [ '_pointing_angle_error', ] _fields_and_field_types = { 'pointing_angle_error': 'double', } SLOT_TYPES = ( rosidl_parser.definition.BasicType('double'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.pointing_angle_error = kwargs.get('pointing_angle_error', float()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.pointing_angle_error != other.pointing_angle_error: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def pointing_angle_error(self): """Message field 'pointing_angle_error'.""" return self._pointing_angle_error @pointing_angle_error.setter def pointing_angle_error(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'pointing_angle_error' field must be of type 'float'" self._pointing_angle_error = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_PointHead_SendGoal_Request(type): """Metaclass of message 'PointHead_SendGoal_Request'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.PointHead_SendGoal_Request') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__point_head__send_goal__request cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__point_head__send_goal__request cls._CONVERT_TO_PY = module.convert_to_py_msg__action__point_head__send_goal__request cls._TYPE_SUPPORT = module.type_support_msg__action__point_head__send_goal__request cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__point_head__send_goal__request from control_msgs.action import PointHead if PointHead.Goal.__class__._TYPE_SUPPORT is None: PointHead.Goal.__class__.__import_type_support__() from unique_identifier_msgs.msg import UUID if UUID.__class__._TYPE_SUPPORT is None: UUID.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class PointHead_SendGoal_Request(metaclass=Metaclass_PointHead_SendGoal_Request): """Message class 'PointHead_SendGoal_Request'.""" __slots__ = [ '_goal_id', '_goal', ] _fields_and_field_types = { 'goal_id': 'unique_identifier_msgs/UUID', 'goal': 'control_msgs/PointHead_Goal', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['unique_identifier_msgs', 'msg'], 'UUID'), # noqa: E501 rosidl_parser.definition.NamespacedType(['control_msgs', 'action'], 'PointHead_Goal'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from unique_identifier_msgs.msg import UUID self.goal_id = kwargs.get('goal_id', UUID()) from control_msgs.action._point_head import PointHead_Goal self.goal = kwargs.get('goal', PointHead_Goal()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.goal_id != other.goal_id: return False if self.goal != other.goal: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def goal_id(self): """Message field 'goal_id'.""" return self._goal_id @goal_id.setter def goal_id(self, value): if __debug__: from unique_identifier_msgs.msg import UUID assert \ isinstance(value, UUID), \ "The 'goal_id' field must be a sub message of type 'UUID'" self._goal_id = value @property def goal(self): """Message field 'goal'.""" return self._goal @goal.setter def goal(self, value): if __debug__: from control_msgs.action._point_head import PointHead_Goal assert \ isinstance(value, PointHead_Goal), \ "The 'goal' field must be a sub message of type 'PointHead_Goal'" self._goal = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_PointHead_SendGoal_Response(type): """Metaclass of message 'PointHead_SendGoal_Response'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.PointHead_SendGoal_Response') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__point_head__send_goal__response cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__point_head__send_goal__response cls._CONVERT_TO_PY = module.convert_to_py_msg__action__point_head__send_goal__response cls._TYPE_SUPPORT = module.type_support_msg__action__point_head__send_goal__response cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__point_head__send_goal__response from builtin_interfaces.msg import Time if Time.__class__._TYPE_SUPPORT is None: Time.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class PointHead_SendGoal_Response(metaclass=Metaclass_PointHead_SendGoal_Response): """Message class 'PointHead_SendGoal_Response'.""" __slots__ = [ '_accepted', '_stamp', ] _fields_and_field_types = { 'accepted': 'boolean', 'stamp': 'builtin_interfaces/Time', } SLOT_TYPES = ( rosidl_parser.definition.BasicType('boolean'), # noqa: E501 rosidl_parser.definition.NamespacedType(['builtin_interfaces', 'msg'], 'Time'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.accepted = kwargs.get('accepted', bool()) from builtin_interfaces.msg import Time self.stamp = kwargs.get('stamp', Time()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.accepted != other.accepted: return False if self.stamp != other.stamp: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def accepted(self): """Message field 'accepted'.""" return self._accepted @accepted.setter def accepted(self, value): if __debug__: assert \ isinstance(value, bool), \ "The 'accepted' field must be of type 'bool'" self._accepted = value @property def stamp(self): """Message field 'stamp'.""" return self._stamp @stamp.setter def stamp(self, value): if __debug__: from builtin_interfaces.msg import Time assert \ isinstance(value, Time), \ "The 'stamp' field must be a sub message of type 'Time'" self._stamp = value class Metaclass_PointHead_SendGoal(type): """Metaclass of service 'PointHead_SendGoal'.""" _TYPE_SUPPORT = None @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.PointHead_SendGoal') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._TYPE_SUPPORT = module.type_support_srv__action__point_head__send_goal from control_msgs.action import _point_head if _point_head.Metaclass_PointHead_SendGoal_Request._TYPE_SUPPORT is None: _point_head.Metaclass_PointHead_SendGoal_Request.__import_type_support__() if _point_head.Metaclass_PointHead_SendGoal_Response._TYPE_SUPPORT is None: _point_head.Metaclass_PointHead_SendGoal_Response.__import_type_support__() class PointHead_SendGoal(metaclass=Metaclass_PointHead_SendGoal): from control_msgs.action._point_head import PointHead_SendGoal_Request as Request from control_msgs.action._point_head import PointHead_SendGoal_Response as Response def __init__(self): raise NotImplementedError('Service classes can not be instantiated') # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_PointHead_GetResult_Request(type): """Metaclass of message 'PointHead_GetResult_Request'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.PointHead_GetResult_Request') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__point_head__get_result__request cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__point_head__get_result__request cls._CONVERT_TO_PY = module.convert_to_py_msg__action__point_head__get_result__request cls._TYPE_SUPPORT = module.type_support_msg__action__point_head__get_result__request cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__point_head__get_result__request from unique_identifier_msgs.msg import UUID if UUID.__class__._TYPE_SUPPORT is None: UUID.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class PointHead_GetResult_Request(metaclass=Metaclass_PointHead_GetResult_Request): """Message class 'PointHead_GetResult_Request'.""" __slots__ = [ '_goal_id', ] _fields_and_field_types = { 'goal_id': 'unique_identifier_msgs/UUID', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['unique_identifier_msgs', 'msg'], 'UUID'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from unique_identifier_msgs.msg import UUID self.goal_id = kwargs.get('goal_id', UUID()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.goal_id != other.goal_id: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def goal_id(self): """Message field 'goal_id'.""" return self._goal_id @goal_id.setter def goal_id(self, value): if __debug__: from unique_identifier_msgs.msg import UUID assert \ isinstance(value, UUID), \ "The 'goal_id' field must be a sub message of type 'UUID'" self._goal_id = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_PointHead_GetResult_Response(type): """Metaclass of message 'PointHead_GetResult_Response'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.PointHead_GetResult_Response') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__point_head__get_result__response cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__point_head__get_result__response cls._CONVERT_TO_PY = module.convert_to_py_msg__action__point_head__get_result__response cls._TYPE_SUPPORT = module.type_support_msg__action__point_head__get_result__response cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__point_head__get_result__response from control_msgs.action import PointHead if PointHead.Result.__class__._TYPE_SUPPORT is None: PointHead.Result.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class PointHead_GetResult_Response(metaclass=Metaclass_PointHead_GetResult_Response): """Message class 'PointHead_GetResult_Response'.""" __slots__ = [ '_status', '_result', ] _fields_and_field_types = { 'status': 'int8', 'result': 'control_msgs/PointHead_Result', } SLOT_TYPES = ( rosidl_parser.definition.BasicType('int8'), # noqa: E501 rosidl_parser.definition.NamespacedType(['control_msgs', 'action'], 'PointHead_Result'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.status = kwargs.get('status', int()) from control_msgs.action._point_head import PointHead_Result self.result = kwargs.get('result', PointHead_Result()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.status != other.status: return False if self.result != other.result: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def status(self): """Message field 'status'.""" return self._status @status.setter def status(self, value): if __debug__: assert \ isinstance(value, int), \ "The 'status' field must be of type 'int'" assert value >= -128 and value < 128, \ "The 'status' field must be an integer in [-128, 127]" self._status = value @property def result(self): """Message field 'result'.""" return self._result @result.setter def result(self, value): if __debug__: from control_msgs.action._point_head import PointHead_Result assert \ isinstance(value, PointHead_Result), \ "The 'result' field must be a sub message of type 'PointHead_Result'" self._result = value class Metaclass_PointHead_GetResult(type): """Metaclass of service 'PointHead_GetResult'.""" _TYPE_SUPPORT = None @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.PointHead_GetResult') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._TYPE_SUPPORT = module.type_support_srv__action__point_head__get_result from control_msgs.action import _point_head if _point_head.Metaclass_PointHead_GetResult_Request._TYPE_SUPPORT is None: _point_head.Metaclass_PointHead_GetResult_Request.__import_type_support__() if _point_head.Metaclass_PointHead_GetResult_Response._TYPE_SUPPORT is None: _point_head.Metaclass_PointHead_GetResult_Response.__import_type_support__() class PointHead_GetResult(metaclass=Metaclass_PointHead_GetResult): from control_msgs.action._point_head import PointHead_GetResult_Request as Request from control_msgs.action._point_head import PointHead_GetResult_Response as Response def __init__(self): raise NotImplementedError('Service classes can not be instantiated') # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_PointHead_FeedbackMessage(type): """Metaclass of message 'PointHead_FeedbackMessage'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.PointHead_FeedbackMessage') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__action__point_head__feedback_message cls._CONVERT_FROM_PY = module.convert_from_py_msg__action__point_head__feedback_message cls._CONVERT_TO_PY = module.convert_to_py_msg__action__point_head__feedback_message cls._TYPE_SUPPORT = module.type_support_msg__action__point_head__feedback_message cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__action__point_head__feedback_message from control_msgs.action import PointHead if PointHead.Feedback.__class__._TYPE_SUPPORT is None: PointHead.Feedback.__class__.__import_type_support__() from unique_identifier_msgs.msg import UUID if UUID.__class__._TYPE_SUPPORT is None: UUID.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class PointHead_FeedbackMessage(metaclass=Metaclass_PointHead_FeedbackMessage): """Message class 'PointHead_FeedbackMessage'.""" __slots__ = [ '_goal_id', '_feedback', ] _fields_and_field_types = { 'goal_id': 'unique_identifier_msgs/UUID', 'feedback': 'control_msgs/PointHead_Feedback', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['unique_identifier_msgs', 'msg'], 'UUID'), # noqa: E501 rosidl_parser.definition.NamespacedType(['control_msgs', 'action'], 'PointHead_Feedback'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from unique_identifier_msgs.msg import UUID self.goal_id = kwargs.get('goal_id', UUID()) from control_msgs.action._point_head import PointHead_Feedback self.feedback = kwargs.get('feedback', PointHead_Feedback()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.goal_id != other.goal_id: return False if self.feedback != other.feedback: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def goal_id(self): """Message field 'goal_id'.""" return self._goal_id @goal_id.setter def goal_id(self, value): if __debug__: from unique_identifier_msgs.msg import UUID assert \ isinstance(value, UUID), \ "The 'goal_id' field must be a sub message of type 'UUID'" self._goal_id = value @property def feedback(self): """Message field 'feedback'.""" return self._feedback @feedback.setter def feedback(self, value): if __debug__: from control_msgs.action._point_head import PointHead_Feedback assert \ isinstance(value, PointHead_Feedback), \ "The 'feedback' field must be a sub message of type 'PointHead_Feedback'" self._feedback = value class Metaclass_PointHead(type): """Metaclass of action 'PointHead'.""" _TYPE_SUPPORT = None @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.action.PointHead') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._TYPE_SUPPORT = module.type_support_action__action__point_head from action_msgs.msg import _goal_status_array if _goal_status_array.Metaclass_GoalStatusArray._TYPE_SUPPORT is None: _goal_status_array.Metaclass_GoalStatusArray.__import_type_support__() from action_msgs.srv import _cancel_goal if _cancel_goal.Metaclass_CancelGoal._TYPE_SUPPORT is None: _cancel_goal.Metaclass_CancelGoal.__import_type_support__() from control_msgs.action import _point_head if _point_head.Metaclass_PointHead_SendGoal._TYPE_SUPPORT is None: _point_head.Metaclass_PointHead_SendGoal.__import_type_support__() if _point_head.Metaclass_PointHead_GetResult._TYPE_SUPPORT is None: _point_head.Metaclass_PointHead_GetResult.__import_type_support__() if _point_head.Metaclass_PointHead_FeedbackMessage._TYPE_SUPPORT is None: _point_head.Metaclass_PointHead_FeedbackMessage.__import_type_support__() class PointHead(metaclass=Metaclass_PointHead): # The goal message defined in the action definition. from control_msgs.action._point_head import PointHead_Goal as Goal # The result message defined in the action definition. from control_msgs.action._point_head import PointHead_Result as Result # The feedback message defined in the action definition. from control_msgs.action._point_head import PointHead_Feedback as Feedback class Impl: # The send_goal service using a wrapped version of the goal message as a request. from control_msgs.action._point_head import PointHead_SendGoal as SendGoalService # The get_result service using a wrapped version of the result message as a response. from control_msgs.action._point_head import PointHead_GetResult as GetResultService # The feedback message with generic fields which wraps the feedback message. from control_msgs.action._point_head import PointHead_FeedbackMessage as FeedbackMessage # The generic service to cancel a goal. from action_msgs.srv._cancel_goal import CancelGoal as CancelGoalService # The generic message for get the status of a goal. from action_msgs.msg._goal_status_array import GoalStatusArray as GoalStatusMessage def __init__(self): raise NotImplementedError('Action classes can not be instantiated')
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/action/_follow_joint_trajectory_s.c
// generated from rosidl_generator_py/resource/_idl_support.c.em // with input from control_msgs:action/FollowJointTrajectory.idl // generated code does not contain a copyright notice #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include <Python.h> #include <stdbool.h> #ifndef _WIN32 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-function" #endif #include "numpy/ndarrayobject.h" #ifndef _WIN32 # pragma GCC diagnostic pop #endif #include "rosidl_runtime_c/visibility_control.h" #include "control_msgs/action/detail/follow_joint_trajectory__struct.h" #include "control_msgs/action/detail/follow_joint_trajectory__functions.h" #include "rosidl_runtime_c/primitives_sequence.h" #include "rosidl_runtime_c/primitives_sequence_functions.h" // Nested array functions includes #include "control_msgs/msg/detail/joint_tolerance__functions.h" // end nested array functions include ROSIDL_GENERATOR_C_IMPORT bool trajectory_msgs__msg__joint_trajectory__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * trajectory_msgs__msg__joint_trajectory__convert_to_py(void * raw_ros_message); bool control_msgs__msg__joint_tolerance__convert_from_py(PyObject * _pymsg, void * _ros_message); PyObject * control_msgs__msg__joint_tolerance__convert_to_py(void * raw_ros_message); bool control_msgs__msg__joint_tolerance__convert_from_py(PyObject * _pymsg, void * _ros_message); PyObject * control_msgs__msg__joint_tolerance__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_IMPORT bool builtin_interfaces__msg__duration__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * builtin_interfaces__msg__duration__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__follow_joint_trajectory__goal__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[72]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._follow_joint_trajectory.FollowJointTrajectory_Goal", full_classname_dest, 71) == 0); } control_msgs__action__FollowJointTrajectory_Goal * ros_message = _ros_message; { // trajectory PyObject * field = PyObject_GetAttrString(_pymsg, "trajectory"); if (!field) { return false; } if (!trajectory_msgs__msg__joint_trajectory__convert_from_py(field, &ros_message->trajectory)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // path_tolerance PyObject * field = PyObject_GetAttrString(_pymsg, "path_tolerance"); if (!field) { return false; } PyObject * seq_field = PySequence_Fast(field, "expected a sequence in 'path_tolerance'"); if (!seq_field) { Py_DECREF(field); return false; } Py_ssize_t size = PySequence_Size(field); if (-1 == size) { Py_DECREF(seq_field); Py_DECREF(field); return false; } if (!control_msgs__msg__JointTolerance__Sequence__init(&(ros_message->path_tolerance), size)) { PyErr_SetString(PyExc_RuntimeError, "unable to create control_msgs__msg__JointTolerance__Sequence ros_message"); Py_DECREF(seq_field); Py_DECREF(field); return false; } control_msgs__msg__JointTolerance * dest = ros_message->path_tolerance.data; for (Py_ssize_t i = 0; i < size; ++i) { if (!control_msgs__msg__joint_tolerance__convert_from_py(PySequence_Fast_GET_ITEM(seq_field, i), &dest[i])) { Py_DECREF(seq_field); Py_DECREF(field); return false; } } Py_DECREF(seq_field); Py_DECREF(field); } { // goal_tolerance PyObject * field = PyObject_GetAttrString(_pymsg, "goal_tolerance"); if (!field) { return false; } PyObject * seq_field = PySequence_Fast(field, "expected a sequence in 'goal_tolerance'"); if (!seq_field) { Py_DECREF(field); return false; } Py_ssize_t size = PySequence_Size(field); if (-1 == size) { Py_DECREF(seq_field); Py_DECREF(field); return false; } if (!control_msgs__msg__JointTolerance__Sequence__init(&(ros_message->goal_tolerance), size)) { PyErr_SetString(PyExc_RuntimeError, "unable to create control_msgs__msg__JointTolerance__Sequence ros_message"); Py_DECREF(seq_field); Py_DECREF(field); return false; } control_msgs__msg__JointTolerance * dest = ros_message->goal_tolerance.data; for (Py_ssize_t i = 0; i < size; ++i) { if (!control_msgs__msg__joint_tolerance__convert_from_py(PySequence_Fast_GET_ITEM(seq_field, i), &dest[i])) { Py_DECREF(seq_field); Py_DECREF(field); return false; } } Py_DECREF(seq_field); Py_DECREF(field); } { // goal_time_tolerance PyObject * field = PyObject_GetAttrString(_pymsg, "goal_time_tolerance"); if (!field) { return false; } if (!builtin_interfaces__msg__duration__convert_from_py(field, &ros_message->goal_time_tolerance)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__follow_joint_trajectory__goal__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of FollowJointTrajectory_Goal */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._follow_joint_trajectory"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "FollowJointTrajectory_Goal"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__FollowJointTrajectory_Goal * ros_message = (control_msgs__action__FollowJointTrajectory_Goal *)raw_ros_message; { // trajectory PyObject * field = NULL; field = trajectory_msgs__msg__joint_trajectory__convert_to_py(&ros_message->trajectory); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "trajectory", field); Py_DECREF(field); if (rc) { return NULL; } } } { // path_tolerance PyObject * field = NULL; size_t size = ros_message->path_tolerance.size; field = PyList_New(size); if (!field) { return NULL; } control_msgs__msg__JointTolerance * item; for (size_t i = 0; i < size; ++i) { item = &(ros_message->path_tolerance.data[i]); PyObject * pyitem = control_msgs__msg__joint_tolerance__convert_to_py(item); if (!pyitem) { Py_DECREF(field); return NULL; } int rc = PyList_SetItem(field, i, pyitem); (void)rc; assert(rc == 0); } assert(PySequence_Check(field)); { int rc = PyObject_SetAttrString(_pymessage, "path_tolerance", field); Py_DECREF(field); if (rc) { return NULL; } } } { // goal_tolerance PyObject * field = NULL; size_t size = ros_message->goal_tolerance.size; field = PyList_New(size); if (!field) { return NULL; } control_msgs__msg__JointTolerance * item; for (size_t i = 0; i < size; ++i) { item = &(ros_message->goal_tolerance.data[i]); PyObject * pyitem = control_msgs__msg__joint_tolerance__convert_to_py(item); if (!pyitem) { Py_DECREF(field); return NULL; } int rc = PyList_SetItem(field, i, pyitem); (void)rc; assert(rc == 0); } assert(PySequence_Check(field)); { int rc = PyObject_SetAttrString(_pymessage, "goal_tolerance", field); Py_DECREF(field); if (rc) { return NULL; } } } { // goal_time_tolerance PyObject * field = NULL; field = builtin_interfaces__msg__duration__convert_to_py(&ros_message->goal_time_tolerance); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "goal_time_tolerance", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/follow_joint_trajectory__struct.h" // already included above // #include "control_msgs/action/detail/follow_joint_trajectory__functions.h" #include "rosidl_runtime_c/string.h" #include "rosidl_runtime_c/string_functions.h" ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__follow_joint_trajectory__result__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[74]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._follow_joint_trajectory.FollowJointTrajectory_Result", full_classname_dest, 73) == 0); } control_msgs__action__FollowJointTrajectory_Result * ros_message = _ros_message; { // error_code PyObject * field = PyObject_GetAttrString(_pymsg, "error_code"); if (!field) { return false; } assert(PyLong_Check(field)); ros_message->error_code = (int32_t)PyLong_AsLong(field); Py_DECREF(field); } { // error_string PyObject * field = PyObject_GetAttrString(_pymsg, "error_string"); if (!field) { return false; } assert(PyUnicode_Check(field)); PyObject * encoded_field = PyUnicode_AsUTF8String(field); if (!encoded_field) { Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&ros_message->error_string, PyBytes_AS_STRING(encoded_field)); Py_DECREF(encoded_field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__follow_joint_trajectory__result__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of FollowJointTrajectory_Result */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._follow_joint_trajectory"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "FollowJointTrajectory_Result"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__FollowJointTrajectory_Result * ros_message = (control_msgs__action__FollowJointTrajectory_Result *)raw_ros_message; { // error_code PyObject * field = NULL; field = PyLong_FromLong(ros_message->error_code); { int rc = PyObject_SetAttrString(_pymessage, "error_code", field); Py_DECREF(field); if (rc) { return NULL; } } } { // error_string PyObject * field = NULL; field = PyUnicode_DecodeUTF8( ros_message->error_string.data, strlen(ros_message->error_string.data), "strict"); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "error_string", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/follow_joint_trajectory__struct.h" // already included above // #include "control_msgs/action/detail/follow_joint_trajectory__functions.h" // already included above // #include "rosidl_runtime_c/primitives_sequence.h" // already included above // #include "rosidl_runtime_c/primitives_sequence_functions.h" // already included above // #include "rosidl_runtime_c/string.h" // already included above // #include "rosidl_runtime_c/string_functions.h" ROSIDL_GENERATOR_C_IMPORT bool std_msgs__msg__header__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * std_msgs__msg__header__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_IMPORT bool trajectory_msgs__msg__joint_trajectory_point__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * trajectory_msgs__msg__joint_trajectory_point__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_IMPORT bool trajectory_msgs__msg__joint_trajectory_point__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * trajectory_msgs__msg__joint_trajectory_point__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_IMPORT bool trajectory_msgs__msg__joint_trajectory_point__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * trajectory_msgs__msg__joint_trajectory_point__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__follow_joint_trajectory__feedback__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[76]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._follow_joint_trajectory.FollowJointTrajectory_Feedback", full_classname_dest, 75) == 0); } control_msgs__action__FollowJointTrajectory_Feedback * ros_message = _ros_message; { // header PyObject * field = PyObject_GetAttrString(_pymsg, "header"); if (!field) { return false; } if (!std_msgs__msg__header__convert_from_py(field, &ros_message->header)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // joint_names PyObject * field = PyObject_GetAttrString(_pymsg, "joint_names"); if (!field) { return false; } PyObject * seq_field = PySequence_Fast(field, "expected a sequence in 'joint_names'"); if (!seq_field) { Py_DECREF(field); return false; } Py_ssize_t size = PySequence_Size(field); if (-1 == size) { Py_DECREF(seq_field); Py_DECREF(field); return false; } if (!rosidl_runtime_c__String__Sequence__init(&(ros_message->joint_names), size)) { PyErr_SetString(PyExc_RuntimeError, "unable to create String__Sequence ros_message"); Py_DECREF(seq_field); Py_DECREF(field); return false; } rosidl_runtime_c__String * dest = ros_message->joint_names.data; for (Py_ssize_t i = 0; i < size; ++i) { PyObject * item = PySequence_Fast_GET_ITEM(seq_field, i); if (!item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } assert(PyUnicode_Check(item)); PyObject * encoded_item = PyUnicode_AsUTF8String(item); if (!encoded_item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&dest[i], PyBytes_AS_STRING(encoded_item)); Py_DECREF(encoded_item); } Py_DECREF(seq_field); Py_DECREF(field); } { // desired PyObject * field = PyObject_GetAttrString(_pymsg, "desired"); if (!field) { return false; } if (!trajectory_msgs__msg__joint_trajectory_point__convert_from_py(field, &ros_message->desired)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // actual PyObject * field = PyObject_GetAttrString(_pymsg, "actual"); if (!field) { return false; } if (!trajectory_msgs__msg__joint_trajectory_point__convert_from_py(field, &ros_message->actual)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // error PyObject * field = PyObject_GetAttrString(_pymsg, "error"); if (!field) { return false; } if (!trajectory_msgs__msg__joint_trajectory_point__convert_from_py(field, &ros_message->error)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__follow_joint_trajectory__feedback__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of FollowJointTrajectory_Feedback */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._follow_joint_trajectory"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "FollowJointTrajectory_Feedback"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__FollowJointTrajectory_Feedback * ros_message = (control_msgs__action__FollowJointTrajectory_Feedback *)raw_ros_message; { // header PyObject * field = NULL; field = std_msgs__msg__header__convert_to_py(&ros_message->header); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "header", field); Py_DECREF(field); if (rc) { return NULL; } } } { // joint_names PyObject * field = NULL; size_t size = ros_message->joint_names.size; rosidl_runtime_c__String * src = ros_message->joint_names.data; field = PyList_New(size); if (!field) { return NULL; } for (size_t i = 0; i < size; ++i) { PyObject * decoded_item = PyUnicode_DecodeUTF8(src[i].data, strlen(src[i].data), "strict"); if (!decoded_item) { return NULL; } int rc = PyList_SetItem(field, i, decoded_item); (void)rc; assert(rc == 0); } assert(PySequence_Check(field)); { int rc = PyObject_SetAttrString(_pymessage, "joint_names", field); Py_DECREF(field); if (rc) { return NULL; } } } { // desired PyObject * field = NULL; field = trajectory_msgs__msg__joint_trajectory_point__convert_to_py(&ros_message->desired); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "desired", field); Py_DECREF(field); if (rc) { return NULL; } } } { // actual PyObject * field = NULL; field = trajectory_msgs__msg__joint_trajectory_point__convert_to_py(&ros_message->actual); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "actual", field); Py_DECREF(field); if (rc) { return NULL; } } } { // error PyObject * field = NULL; field = trajectory_msgs__msg__joint_trajectory_point__convert_to_py(&ros_message->error); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "error", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/follow_joint_trajectory__struct.h" // already included above // #include "control_msgs/action/detail/follow_joint_trajectory__functions.h" ROSIDL_GENERATOR_C_IMPORT bool unique_identifier_msgs__msg__uuid__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * unique_identifier_msgs__msg__uuid__convert_to_py(void * raw_ros_message); bool control_msgs__action__follow_joint_trajectory__goal__convert_from_py(PyObject * _pymsg, void * _ros_message); PyObject * control_msgs__action__follow_joint_trajectory__goal__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__follow_joint_trajectory__send_goal__request__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[84]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._follow_joint_trajectory.FollowJointTrajectory_SendGoal_Request", full_classname_dest, 83) == 0); } control_msgs__action__FollowJointTrajectory_SendGoal_Request * ros_message = _ros_message; { // goal_id PyObject * field = PyObject_GetAttrString(_pymsg, "goal_id"); if (!field) { return false; } if (!unique_identifier_msgs__msg__uuid__convert_from_py(field, &ros_message->goal_id)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // goal PyObject * field = PyObject_GetAttrString(_pymsg, "goal"); if (!field) { return false; } if (!control_msgs__action__follow_joint_trajectory__goal__convert_from_py(field, &ros_message->goal)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__follow_joint_trajectory__send_goal__request__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of FollowJointTrajectory_SendGoal_Request */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._follow_joint_trajectory"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "FollowJointTrajectory_SendGoal_Request"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__FollowJointTrajectory_SendGoal_Request * ros_message = (control_msgs__action__FollowJointTrajectory_SendGoal_Request *)raw_ros_message; { // goal_id PyObject * field = NULL; field = unique_identifier_msgs__msg__uuid__convert_to_py(&ros_message->goal_id); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "goal_id", field); Py_DECREF(field); if (rc) { return NULL; } } } { // goal PyObject * field = NULL; field = control_msgs__action__follow_joint_trajectory__goal__convert_to_py(&ros_message->goal); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "goal", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/follow_joint_trajectory__struct.h" // already included above // #include "control_msgs/action/detail/follow_joint_trajectory__functions.h" ROSIDL_GENERATOR_C_IMPORT bool builtin_interfaces__msg__time__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * builtin_interfaces__msg__time__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__follow_joint_trajectory__send_goal__response__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[85]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._follow_joint_trajectory.FollowJointTrajectory_SendGoal_Response", full_classname_dest, 84) == 0); } control_msgs__action__FollowJointTrajectory_SendGoal_Response * ros_message = _ros_message; { // accepted PyObject * field = PyObject_GetAttrString(_pymsg, "accepted"); if (!field) { return false; } assert(PyBool_Check(field)); ros_message->accepted = (Py_True == field); Py_DECREF(field); } { // stamp PyObject * field = PyObject_GetAttrString(_pymsg, "stamp"); if (!field) { return false; } if (!builtin_interfaces__msg__time__convert_from_py(field, &ros_message->stamp)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__follow_joint_trajectory__send_goal__response__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of FollowJointTrajectory_SendGoal_Response */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._follow_joint_trajectory"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "FollowJointTrajectory_SendGoal_Response"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__FollowJointTrajectory_SendGoal_Response * ros_message = (control_msgs__action__FollowJointTrajectory_SendGoal_Response *)raw_ros_message; { // accepted PyObject * field = NULL; field = PyBool_FromLong(ros_message->accepted ? 1 : 0); { int rc = PyObject_SetAttrString(_pymessage, "accepted", field); Py_DECREF(field); if (rc) { return NULL; } } } { // stamp PyObject * field = NULL; field = builtin_interfaces__msg__time__convert_to_py(&ros_message->stamp); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "stamp", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/follow_joint_trajectory__struct.h" // already included above // #include "control_msgs/action/detail/follow_joint_trajectory__functions.h" ROSIDL_GENERATOR_C_IMPORT bool unique_identifier_msgs__msg__uuid__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * unique_identifier_msgs__msg__uuid__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__follow_joint_trajectory__get_result__request__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[85]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._follow_joint_trajectory.FollowJointTrajectory_GetResult_Request", full_classname_dest, 84) == 0); } control_msgs__action__FollowJointTrajectory_GetResult_Request * ros_message = _ros_message; { // goal_id PyObject * field = PyObject_GetAttrString(_pymsg, "goal_id"); if (!field) { return false; } if (!unique_identifier_msgs__msg__uuid__convert_from_py(field, &ros_message->goal_id)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__follow_joint_trajectory__get_result__request__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of FollowJointTrajectory_GetResult_Request */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._follow_joint_trajectory"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "FollowJointTrajectory_GetResult_Request"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__FollowJointTrajectory_GetResult_Request * ros_message = (control_msgs__action__FollowJointTrajectory_GetResult_Request *)raw_ros_message; { // goal_id PyObject * field = NULL; field = unique_identifier_msgs__msg__uuid__convert_to_py(&ros_message->goal_id); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "goal_id", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/follow_joint_trajectory__struct.h" // already included above // #include "control_msgs/action/detail/follow_joint_trajectory__functions.h" bool control_msgs__action__follow_joint_trajectory__result__convert_from_py(PyObject * _pymsg, void * _ros_message); PyObject * control_msgs__action__follow_joint_trajectory__result__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__follow_joint_trajectory__get_result__response__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[86]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._follow_joint_trajectory.FollowJointTrajectory_GetResult_Response", full_classname_dest, 85) == 0); } control_msgs__action__FollowJointTrajectory_GetResult_Response * ros_message = _ros_message; { // status PyObject * field = PyObject_GetAttrString(_pymsg, "status"); if (!field) { return false; } assert(PyLong_Check(field)); ros_message->status = (int8_t)PyLong_AsLong(field); Py_DECREF(field); } { // result PyObject * field = PyObject_GetAttrString(_pymsg, "result"); if (!field) { return false; } if (!control_msgs__action__follow_joint_trajectory__result__convert_from_py(field, &ros_message->result)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__follow_joint_trajectory__get_result__response__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of FollowJointTrajectory_GetResult_Response */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._follow_joint_trajectory"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "FollowJointTrajectory_GetResult_Response"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__FollowJointTrajectory_GetResult_Response * ros_message = (control_msgs__action__FollowJointTrajectory_GetResult_Response *)raw_ros_message; { // status PyObject * field = NULL; field = PyLong_FromLong(ros_message->status); { int rc = PyObject_SetAttrString(_pymessage, "status", field); Py_DECREF(field); if (rc) { return NULL; } } } { // result PyObject * field = NULL; field = control_msgs__action__follow_joint_trajectory__result__convert_to_py(&ros_message->result); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "result", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/follow_joint_trajectory__struct.h" // already included above // #include "control_msgs/action/detail/follow_joint_trajectory__functions.h" ROSIDL_GENERATOR_C_IMPORT bool unique_identifier_msgs__msg__uuid__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * unique_identifier_msgs__msg__uuid__convert_to_py(void * raw_ros_message); bool control_msgs__action__follow_joint_trajectory__feedback__convert_from_py(PyObject * _pymsg, void * _ros_message); PyObject * control_msgs__action__follow_joint_trajectory__feedback__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__follow_joint_trajectory__feedback_message__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[83]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._follow_joint_trajectory.FollowJointTrajectory_FeedbackMessage", full_classname_dest, 82) == 0); } control_msgs__action__FollowJointTrajectory_FeedbackMessage * ros_message = _ros_message; { // goal_id PyObject * field = PyObject_GetAttrString(_pymsg, "goal_id"); if (!field) { return false; } if (!unique_identifier_msgs__msg__uuid__convert_from_py(field, &ros_message->goal_id)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // feedback PyObject * field = PyObject_GetAttrString(_pymsg, "feedback"); if (!field) { return false; } if (!control_msgs__action__follow_joint_trajectory__feedback__convert_from_py(field, &ros_message->feedback)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__follow_joint_trajectory__feedback_message__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of FollowJointTrajectory_FeedbackMessage */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._follow_joint_trajectory"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "FollowJointTrajectory_FeedbackMessage"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__FollowJointTrajectory_FeedbackMessage * ros_message = (control_msgs__action__FollowJointTrajectory_FeedbackMessage *)raw_ros_message; { // goal_id PyObject * field = NULL; field = unique_identifier_msgs__msg__uuid__convert_to_py(&ros_message->goal_id); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "goal_id", field); Py_DECREF(field); if (rc) { return NULL; } } } { // feedback PyObject * field = NULL; field = control_msgs__action__follow_joint_trajectory__feedback__convert_to_py(&ros_message->feedback); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "feedback", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; }
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/action/_single_joint_position_s.c
// generated from rosidl_generator_py/resource/_idl_support.c.em // with input from control_msgs:action/SingleJointPosition.idl // generated code does not contain a copyright notice #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include <Python.h> #include <stdbool.h> #ifndef _WIN32 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-function" #endif #include "numpy/ndarrayobject.h" #ifndef _WIN32 # pragma GCC diagnostic pop #endif #include "rosidl_runtime_c/visibility_control.h" #include "control_msgs/action/detail/single_joint_position__struct.h" #include "control_msgs/action/detail/single_joint_position__functions.h" ROSIDL_GENERATOR_C_IMPORT bool builtin_interfaces__msg__duration__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * builtin_interfaces__msg__duration__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__single_joint_position__goal__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[68]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._single_joint_position.SingleJointPosition_Goal", full_classname_dest, 67) == 0); } control_msgs__action__SingleJointPosition_Goal * ros_message = _ros_message; { // position PyObject * field = PyObject_GetAttrString(_pymsg, "position"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->position = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // min_duration PyObject * field = PyObject_GetAttrString(_pymsg, "min_duration"); if (!field) { return false; } if (!builtin_interfaces__msg__duration__convert_from_py(field, &ros_message->min_duration)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // max_velocity PyObject * field = PyObject_GetAttrString(_pymsg, "max_velocity"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->max_velocity = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__single_joint_position__goal__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of SingleJointPosition_Goal */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._single_joint_position"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "SingleJointPosition_Goal"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__SingleJointPosition_Goal * ros_message = (control_msgs__action__SingleJointPosition_Goal *)raw_ros_message; { // position PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->position); { int rc = PyObject_SetAttrString(_pymessage, "position", field); Py_DECREF(field); if (rc) { return NULL; } } } { // min_duration PyObject * field = NULL; field = builtin_interfaces__msg__duration__convert_to_py(&ros_message->min_duration); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "min_duration", field); Py_DECREF(field); if (rc) { return NULL; } } } { // max_velocity PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->max_velocity); { int rc = PyObject_SetAttrString(_pymessage, "max_velocity", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/single_joint_position__struct.h" // already included above // #include "control_msgs/action/detail/single_joint_position__functions.h" ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__single_joint_position__result__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[70]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._single_joint_position.SingleJointPosition_Result", full_classname_dest, 69) == 0); } control_msgs__action__SingleJointPosition_Result * ros_message = _ros_message; ros_message->structure_needs_at_least_one_member = 0; return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__single_joint_position__result__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of SingleJointPosition_Result */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._single_joint_position"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "SingleJointPosition_Result"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } (void)raw_ros_message; // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/single_joint_position__struct.h" // already included above // #include "control_msgs/action/detail/single_joint_position__functions.h" ROSIDL_GENERATOR_C_IMPORT bool std_msgs__msg__header__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * std_msgs__msg__header__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__single_joint_position__feedback__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[72]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._single_joint_position.SingleJointPosition_Feedback", full_classname_dest, 71) == 0); } control_msgs__action__SingleJointPosition_Feedback * ros_message = _ros_message; { // header PyObject * field = PyObject_GetAttrString(_pymsg, "header"); if (!field) { return false; } if (!std_msgs__msg__header__convert_from_py(field, &ros_message->header)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // position PyObject * field = PyObject_GetAttrString(_pymsg, "position"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->position = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // velocity PyObject * field = PyObject_GetAttrString(_pymsg, "velocity"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->velocity = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // error PyObject * field = PyObject_GetAttrString(_pymsg, "error"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->error = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__single_joint_position__feedback__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of SingleJointPosition_Feedback */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._single_joint_position"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "SingleJointPosition_Feedback"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__SingleJointPosition_Feedback * ros_message = (control_msgs__action__SingleJointPosition_Feedback *)raw_ros_message; { // header PyObject * field = NULL; field = std_msgs__msg__header__convert_to_py(&ros_message->header); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "header", field); Py_DECREF(field); if (rc) { return NULL; } } } { // position PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->position); { int rc = PyObject_SetAttrString(_pymessage, "position", field); Py_DECREF(field); if (rc) { return NULL; } } } { // velocity PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->velocity); { int rc = PyObject_SetAttrString(_pymessage, "velocity", field); Py_DECREF(field); if (rc) { return NULL; } } } { // error PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->error); { int rc = PyObject_SetAttrString(_pymessage, "error", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/single_joint_position__struct.h" // already included above // #include "control_msgs/action/detail/single_joint_position__functions.h" ROSIDL_GENERATOR_C_IMPORT bool unique_identifier_msgs__msg__uuid__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * unique_identifier_msgs__msg__uuid__convert_to_py(void * raw_ros_message); bool control_msgs__action__single_joint_position__goal__convert_from_py(PyObject * _pymsg, void * _ros_message); PyObject * control_msgs__action__single_joint_position__goal__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__single_joint_position__send_goal__request__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[80]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._single_joint_position.SingleJointPosition_SendGoal_Request", full_classname_dest, 79) == 0); } control_msgs__action__SingleJointPosition_SendGoal_Request * ros_message = _ros_message; { // goal_id PyObject * field = PyObject_GetAttrString(_pymsg, "goal_id"); if (!field) { return false; } if (!unique_identifier_msgs__msg__uuid__convert_from_py(field, &ros_message->goal_id)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // goal PyObject * field = PyObject_GetAttrString(_pymsg, "goal"); if (!field) { return false; } if (!control_msgs__action__single_joint_position__goal__convert_from_py(field, &ros_message->goal)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__single_joint_position__send_goal__request__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of SingleJointPosition_SendGoal_Request */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._single_joint_position"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "SingleJointPosition_SendGoal_Request"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__SingleJointPosition_SendGoal_Request * ros_message = (control_msgs__action__SingleJointPosition_SendGoal_Request *)raw_ros_message; { // goal_id PyObject * field = NULL; field = unique_identifier_msgs__msg__uuid__convert_to_py(&ros_message->goal_id); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "goal_id", field); Py_DECREF(field); if (rc) { return NULL; } } } { // goal PyObject * field = NULL; field = control_msgs__action__single_joint_position__goal__convert_to_py(&ros_message->goal); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "goal", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/single_joint_position__struct.h" // already included above // #include "control_msgs/action/detail/single_joint_position__functions.h" ROSIDL_GENERATOR_C_IMPORT bool builtin_interfaces__msg__time__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * builtin_interfaces__msg__time__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__single_joint_position__send_goal__response__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[81]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._single_joint_position.SingleJointPosition_SendGoal_Response", full_classname_dest, 80) == 0); } control_msgs__action__SingleJointPosition_SendGoal_Response * ros_message = _ros_message; { // accepted PyObject * field = PyObject_GetAttrString(_pymsg, "accepted"); if (!field) { return false; } assert(PyBool_Check(field)); ros_message->accepted = (Py_True == field); Py_DECREF(field); } { // stamp PyObject * field = PyObject_GetAttrString(_pymsg, "stamp"); if (!field) { return false; } if (!builtin_interfaces__msg__time__convert_from_py(field, &ros_message->stamp)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__single_joint_position__send_goal__response__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of SingleJointPosition_SendGoal_Response */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._single_joint_position"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "SingleJointPosition_SendGoal_Response"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__SingleJointPosition_SendGoal_Response * ros_message = (control_msgs__action__SingleJointPosition_SendGoal_Response *)raw_ros_message; { // accepted PyObject * field = NULL; field = PyBool_FromLong(ros_message->accepted ? 1 : 0); { int rc = PyObject_SetAttrString(_pymessage, "accepted", field); Py_DECREF(field); if (rc) { return NULL; } } } { // stamp PyObject * field = NULL; field = builtin_interfaces__msg__time__convert_to_py(&ros_message->stamp); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "stamp", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/single_joint_position__struct.h" // already included above // #include "control_msgs/action/detail/single_joint_position__functions.h" ROSIDL_GENERATOR_C_IMPORT bool unique_identifier_msgs__msg__uuid__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * unique_identifier_msgs__msg__uuid__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__single_joint_position__get_result__request__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[81]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._single_joint_position.SingleJointPosition_GetResult_Request", full_classname_dest, 80) == 0); } control_msgs__action__SingleJointPosition_GetResult_Request * ros_message = _ros_message; { // goal_id PyObject * field = PyObject_GetAttrString(_pymsg, "goal_id"); if (!field) { return false; } if (!unique_identifier_msgs__msg__uuid__convert_from_py(field, &ros_message->goal_id)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__single_joint_position__get_result__request__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of SingleJointPosition_GetResult_Request */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._single_joint_position"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "SingleJointPosition_GetResult_Request"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__SingleJointPosition_GetResult_Request * ros_message = (control_msgs__action__SingleJointPosition_GetResult_Request *)raw_ros_message; { // goal_id PyObject * field = NULL; field = unique_identifier_msgs__msg__uuid__convert_to_py(&ros_message->goal_id); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "goal_id", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/single_joint_position__struct.h" // already included above // #include "control_msgs/action/detail/single_joint_position__functions.h" bool control_msgs__action__single_joint_position__result__convert_from_py(PyObject * _pymsg, void * _ros_message); PyObject * control_msgs__action__single_joint_position__result__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__single_joint_position__get_result__response__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[82]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._single_joint_position.SingleJointPosition_GetResult_Response", full_classname_dest, 81) == 0); } control_msgs__action__SingleJointPosition_GetResult_Response * ros_message = _ros_message; { // status PyObject * field = PyObject_GetAttrString(_pymsg, "status"); if (!field) { return false; } assert(PyLong_Check(field)); ros_message->status = (int8_t)PyLong_AsLong(field); Py_DECREF(field); } { // result PyObject * field = PyObject_GetAttrString(_pymsg, "result"); if (!field) { return false; } if (!control_msgs__action__single_joint_position__result__convert_from_py(field, &ros_message->result)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__single_joint_position__get_result__response__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of SingleJointPosition_GetResult_Response */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._single_joint_position"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "SingleJointPosition_GetResult_Response"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__SingleJointPosition_GetResult_Response * ros_message = (control_msgs__action__SingleJointPosition_GetResult_Response *)raw_ros_message; { // status PyObject * field = NULL; field = PyLong_FromLong(ros_message->status); { int rc = PyObject_SetAttrString(_pymessage, "status", field); Py_DECREF(field); if (rc) { return NULL; } } } { // result PyObject * field = NULL; field = control_msgs__action__single_joint_position__result__convert_to_py(&ros_message->result); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "result", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "control_msgs/action/detail/single_joint_position__struct.h" // already included above // #include "control_msgs/action/detail/single_joint_position__functions.h" ROSIDL_GENERATOR_C_IMPORT bool unique_identifier_msgs__msg__uuid__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * unique_identifier_msgs__msg__uuid__convert_to_py(void * raw_ros_message); bool control_msgs__action__single_joint_position__feedback__convert_from_py(PyObject * _pymsg, void * _ros_message); PyObject * control_msgs__action__single_joint_position__feedback__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__action__single_joint_position__feedback_message__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[79]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.action._single_joint_position.SingleJointPosition_FeedbackMessage", full_classname_dest, 78) == 0); } control_msgs__action__SingleJointPosition_FeedbackMessage * ros_message = _ros_message; { // goal_id PyObject * field = PyObject_GetAttrString(_pymsg, "goal_id"); if (!field) { return false; } if (!unique_identifier_msgs__msg__uuid__convert_from_py(field, &ros_message->goal_id)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // feedback PyObject * field = PyObject_GetAttrString(_pymsg, "feedback"); if (!field) { return false; } if (!control_msgs__action__single_joint_position__feedback__convert_from_py(field, &ros_message->feedback)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__action__single_joint_position__feedback_message__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of SingleJointPosition_FeedbackMessage */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.action._single_joint_position"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "SingleJointPosition_FeedbackMessage"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__action__SingleJointPosition_FeedbackMessage * ros_message = (control_msgs__action__SingleJointPosition_FeedbackMessage *)raw_ros_message; { // goal_id PyObject * field = NULL; field = unique_identifier_msgs__msg__uuid__convert_to_py(&ros_message->goal_id); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "goal_id", field); Py_DECREF(field); if (rc) { return NULL; } } } { // feedback PyObject * field = NULL; field = control_msgs__action__single_joint_position__feedback__convert_to_py(&ros_message->feedback); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "feedback", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; }
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/msg/_joint_tolerance_s.c
// generated from rosidl_generator_py/resource/_idl_support.c.em // with input from control_msgs:msg/JointTolerance.idl // generated code does not contain a copyright notice #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include <Python.h> #include <stdbool.h> #ifndef _WIN32 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-function" #endif #include "numpy/ndarrayobject.h" #ifndef _WIN32 # pragma GCC diagnostic pop #endif #include "rosidl_runtime_c/visibility_control.h" #include "control_msgs/msg/detail/joint_tolerance__struct.h" #include "control_msgs/msg/detail/joint_tolerance__functions.h" #include "rosidl_runtime_c/string.h" #include "rosidl_runtime_c/string_functions.h" ROSIDL_GENERATOR_C_EXPORT bool control_msgs__msg__joint_tolerance__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[49]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.msg._joint_tolerance.JointTolerance", full_classname_dest, 48) == 0); } control_msgs__msg__JointTolerance * ros_message = _ros_message; { // name PyObject * field = PyObject_GetAttrString(_pymsg, "name"); if (!field) { return false; } assert(PyUnicode_Check(field)); PyObject * encoded_field = PyUnicode_AsUTF8String(field); if (!encoded_field) { Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&ros_message->name, PyBytes_AS_STRING(encoded_field)); Py_DECREF(encoded_field); Py_DECREF(field); } { // position PyObject * field = PyObject_GetAttrString(_pymsg, "position"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->position = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // velocity PyObject * field = PyObject_GetAttrString(_pymsg, "velocity"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->velocity = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // acceleration PyObject * field = PyObject_GetAttrString(_pymsg, "acceleration"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->acceleration = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__msg__joint_tolerance__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of JointTolerance */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.msg._joint_tolerance"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "JointTolerance"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__msg__JointTolerance * ros_message = (control_msgs__msg__JointTolerance *)raw_ros_message; { // name PyObject * field = NULL; field = PyUnicode_DecodeUTF8( ros_message->name.data, strlen(ros_message->name.data), "strict"); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "name", field); Py_DECREF(field); if (rc) { return NULL; } } } { // position PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->position); { int rc = PyObject_SetAttrString(_pymessage, "position", field); Py_DECREF(field); if (rc) { return NULL; } } } { // velocity PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->velocity); { int rc = PyObject_SetAttrString(_pymessage, "velocity", field); Py_DECREF(field); if (rc) { return NULL; } } } { // acceleration PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->acceleration); { int rc = PyObject_SetAttrString(_pymessage, "acceleration", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; }
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/msg/_interface_value.py
# generated from rosidl_generator_py/resource/_idl.py.em # with input from control_msgs:msg/InterfaceValue.idl # generated code does not contain a copyright notice # Import statements for member types # Member 'values' import array # noqa: E402, I100 import rosidl_parser.definition # noqa: E402, I100 class Metaclass_InterfaceValue(type): """Metaclass of message 'InterfaceValue'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.msg.InterfaceValue') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__msg__interface_value cls._CONVERT_FROM_PY = module.convert_from_py_msg__msg__interface_value cls._CONVERT_TO_PY = module.convert_to_py_msg__msg__interface_value cls._TYPE_SUPPORT = module.type_support_msg__msg__interface_value cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__msg__interface_value @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class InterfaceValue(metaclass=Metaclass_InterfaceValue): """Message class 'InterfaceValue'.""" __slots__ = [ '_interface_names', '_values', ] _fields_and_field_types = { 'interface_names': 'sequence<string>', 'values': 'sequence<double>', } SLOT_TYPES = ( rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.UnboundedString()), # noqa: E501 rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.BasicType('double')), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.interface_names = kwargs.get('interface_names', []) self.values = array.array('d', kwargs.get('values', [])) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.interface_names != other.interface_names: return False if self.values != other.values: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def interface_names(self): """Message field 'interface_names'.""" return self._interface_names @interface_names.setter def interface_names(self, value): if __debug__: from collections.abc import Sequence from collections.abc import Set from collections import UserList from collections import UserString assert \ ((isinstance(value, Sequence) or isinstance(value, Set) or isinstance(value, UserList)) and not isinstance(value, str) and not isinstance(value, UserString) and all(isinstance(v, str) for v in value) and True), \ "The 'interface_names' field must be a set or sequence and each value of type 'str'" self._interface_names = value @property def values(self): """Message field 'values'.""" return self._values @values.setter def values(self, value): if isinstance(value, array.array): assert value.typecode == 'd', \ "The 'values' array.array() must have the type code of 'd'" self._values = value return if __debug__: from collections.abc import Sequence from collections.abc import Set from collections import UserList from collections import UserString assert \ ((isinstance(value, Sequence) or isinstance(value, Set) or isinstance(value, UserList)) and not isinstance(value, str) and not isinstance(value, UserString) and all(isinstance(v, float) for v in value) and True), \ "The 'values' field must be a set or sequence and each value of type 'float'" self._values = array.array('d', value)
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/msg/_joint_trajectory_controller_state.py
# generated from rosidl_generator_py/resource/_idl.py.em # with input from control_msgs:msg/JointTrajectoryControllerState.idl # generated code does not contain a copyright notice # Import statements for member types import rosidl_parser.definition # noqa: E402, I100 class Metaclass_JointTrajectoryControllerState(type): """Metaclass of message 'JointTrajectoryControllerState'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.msg.JointTrajectoryControllerState') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__msg__joint_trajectory_controller_state cls._CONVERT_FROM_PY = module.convert_from_py_msg__msg__joint_trajectory_controller_state cls._CONVERT_TO_PY = module.convert_to_py_msg__msg__joint_trajectory_controller_state cls._TYPE_SUPPORT = module.type_support_msg__msg__joint_trajectory_controller_state cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__msg__joint_trajectory_controller_state from std_msgs.msg import Header if Header.__class__._TYPE_SUPPORT is None: Header.__class__.__import_type_support__() from trajectory_msgs.msg import JointTrajectoryPoint if JointTrajectoryPoint.__class__._TYPE_SUPPORT is None: JointTrajectoryPoint.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class JointTrajectoryControllerState(metaclass=Metaclass_JointTrajectoryControllerState): """Message class 'JointTrajectoryControllerState'.""" __slots__ = [ '_header', '_joint_names', '_desired', '_actual', '_error', ] _fields_and_field_types = { 'header': 'std_msgs/Header', 'joint_names': 'sequence<string>', 'desired': 'trajectory_msgs/JointTrajectoryPoint', 'actual': 'trajectory_msgs/JointTrajectoryPoint', 'error': 'trajectory_msgs/JointTrajectoryPoint', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['std_msgs', 'msg'], 'Header'), # noqa: E501 rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.UnboundedString()), # noqa: E501 rosidl_parser.definition.NamespacedType(['trajectory_msgs', 'msg'], 'JointTrajectoryPoint'), # noqa: E501 rosidl_parser.definition.NamespacedType(['trajectory_msgs', 'msg'], 'JointTrajectoryPoint'), # noqa: E501 rosidl_parser.definition.NamespacedType(['trajectory_msgs', 'msg'], 'JointTrajectoryPoint'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from std_msgs.msg import Header self.header = kwargs.get('header', Header()) self.joint_names = kwargs.get('joint_names', []) from trajectory_msgs.msg import JointTrajectoryPoint self.desired = kwargs.get('desired', JointTrajectoryPoint()) from trajectory_msgs.msg import JointTrajectoryPoint self.actual = kwargs.get('actual', JointTrajectoryPoint()) from trajectory_msgs.msg import JointTrajectoryPoint self.error = kwargs.get('error', JointTrajectoryPoint()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.header != other.header: return False if self.joint_names != other.joint_names: return False if self.desired != other.desired: return False if self.actual != other.actual: return False if self.error != other.error: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def header(self): """Message field 'header'.""" return self._header @header.setter def header(self, value): if __debug__: from std_msgs.msg import Header assert \ isinstance(value, Header), \ "The 'header' field must be a sub message of type 'Header'" self._header = value @property def joint_names(self): """Message field 'joint_names'.""" return self._joint_names @joint_names.setter def joint_names(self, value): if __debug__: from collections.abc import Sequence from collections.abc import Set from collections import UserList from collections import UserString assert \ ((isinstance(value, Sequence) or isinstance(value, Set) or isinstance(value, UserList)) and not isinstance(value, str) and not isinstance(value, UserString) and all(isinstance(v, str) for v in value) and True), \ "The 'joint_names' field must be a set or sequence and each value of type 'str'" self._joint_names = value @property def desired(self): """Message field 'desired'.""" return self._desired @desired.setter def desired(self, value): if __debug__: from trajectory_msgs.msg import JointTrajectoryPoint assert \ isinstance(value, JointTrajectoryPoint), \ "The 'desired' field must be a sub message of type 'JointTrajectoryPoint'" self._desired = value @property def actual(self): """Message field 'actual'.""" return self._actual @actual.setter def actual(self, value): if __debug__: from trajectory_msgs.msg import JointTrajectoryPoint assert \ isinstance(value, JointTrajectoryPoint), \ "The 'actual' field must be a sub message of type 'JointTrajectoryPoint'" self._actual = value @property def error(self): """Message field 'error'.""" return self._error @error.setter def error(self, value): if __debug__: from trajectory_msgs.msg import JointTrajectoryPoint assert \ isinstance(value, JointTrajectoryPoint), \ "The 'error' field must be a sub message of type 'JointTrajectoryPoint'" self._error = value
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/msg/_interface_value_s.c
// generated from rosidl_generator_py/resource/_idl_support.c.em // with input from control_msgs:msg/InterfaceValue.idl // generated code does not contain a copyright notice #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include <Python.h> #include <stdbool.h> #ifndef _WIN32 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-function" #endif #include "numpy/ndarrayobject.h" #ifndef _WIN32 # pragma GCC diagnostic pop #endif #include "rosidl_runtime_c/visibility_control.h" #include "control_msgs/msg/detail/interface_value__struct.h" #include "control_msgs/msg/detail/interface_value__functions.h" #include "rosidl_runtime_c/primitives_sequence.h" #include "rosidl_runtime_c/primitives_sequence_functions.h" #include "rosidl_runtime_c/string.h" #include "rosidl_runtime_c/string_functions.h" ROSIDL_GENERATOR_C_EXPORT bool control_msgs__msg__interface_value__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[49]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.msg._interface_value.InterfaceValue", full_classname_dest, 48) == 0); } control_msgs__msg__InterfaceValue * ros_message = _ros_message; { // interface_names PyObject * field = PyObject_GetAttrString(_pymsg, "interface_names"); if (!field) { return false; } PyObject * seq_field = PySequence_Fast(field, "expected a sequence in 'interface_names'"); if (!seq_field) { Py_DECREF(field); return false; } Py_ssize_t size = PySequence_Size(field); if (-1 == size) { Py_DECREF(seq_field); Py_DECREF(field); return false; } if (!rosidl_runtime_c__String__Sequence__init(&(ros_message->interface_names), size)) { PyErr_SetString(PyExc_RuntimeError, "unable to create String__Sequence ros_message"); Py_DECREF(seq_field); Py_DECREF(field); return false; } rosidl_runtime_c__String * dest = ros_message->interface_names.data; for (Py_ssize_t i = 0; i < size; ++i) { PyObject * item = PySequence_Fast_GET_ITEM(seq_field, i); if (!item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } assert(PyUnicode_Check(item)); PyObject * encoded_item = PyUnicode_AsUTF8String(item); if (!encoded_item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&dest[i], PyBytes_AS_STRING(encoded_item)); Py_DECREF(encoded_item); } Py_DECREF(seq_field); Py_DECREF(field); } { // values PyObject * field = PyObject_GetAttrString(_pymsg, "values"); if (!field) { return false; } PyObject * seq_field = PySequence_Fast(field, "expected a sequence in 'values'"); if (!seq_field) { Py_DECREF(field); return false; } Py_ssize_t size = PySequence_Size(field); if (-1 == size) { Py_DECREF(seq_field); Py_DECREF(field); return false; } if (!rosidl_runtime_c__double__Sequence__init(&(ros_message->values), size)) { PyErr_SetString(PyExc_RuntimeError, "unable to create double__Sequence ros_message"); Py_DECREF(seq_field); Py_DECREF(field); return false; } double * dest = ros_message->values.data; for (Py_ssize_t i = 0; i < size; ++i) { PyObject * item = PySequence_Fast_GET_ITEM(seq_field, i); if (!item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } assert(PyFloat_Check(item)); double tmp = PyFloat_AS_DOUBLE(item); memcpy(&dest[i], &tmp, sizeof(double)); } Py_DECREF(seq_field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__msg__interface_value__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of InterfaceValue */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.msg._interface_value"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "InterfaceValue"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__msg__InterfaceValue * ros_message = (control_msgs__msg__InterfaceValue *)raw_ros_message; { // interface_names PyObject * field = NULL; size_t size = ros_message->interface_names.size; rosidl_runtime_c__String * src = ros_message->interface_names.data; field = PyList_New(size); if (!field) { return NULL; } for (size_t i = 0; i < size; ++i) { PyObject * decoded_item = PyUnicode_DecodeUTF8(src[i].data, strlen(src[i].data), "strict"); if (!decoded_item) { return NULL; } int rc = PyList_SetItem(field, i, decoded_item); (void)rc; assert(rc == 0); } assert(PySequence_Check(field)); { int rc = PyObject_SetAttrString(_pymessage, "interface_names", field); Py_DECREF(field); if (rc) { return NULL; } } } { // values PyObject * field = NULL; field = PyObject_GetAttrString(_pymessage, "values"); if (!field) { return NULL; } assert(field->ob_type != NULL); assert(field->ob_type->tp_name != NULL); assert(strcmp(field->ob_type->tp_name, "array.array") == 0); // ensure that itemsize matches the sizeof of the ROS message field PyObject * itemsize_attr = PyObject_GetAttrString(field, "itemsize"); assert(itemsize_attr != NULL); size_t itemsize = PyLong_AsSize_t(itemsize_attr); Py_DECREF(itemsize_attr); if (itemsize != sizeof(double)) { PyErr_SetString(PyExc_RuntimeError, "itemsize doesn't match expectation"); Py_DECREF(field); return NULL; } // clear the array, poor approach to remove potential default values Py_ssize_t length = PyObject_Length(field); if (-1 == length) { Py_DECREF(field); return NULL; } if (length > 0) { PyObject * pop = PyObject_GetAttrString(field, "pop"); assert(pop != NULL); for (Py_ssize_t i = 0; i < length; ++i) { PyObject * ret = PyObject_CallFunctionObjArgs(pop, NULL); if (!ret) { Py_DECREF(pop); Py_DECREF(field); return NULL; } Py_DECREF(ret); } Py_DECREF(pop); } if (ros_message->values.size > 0) { // populating the array.array using the frombytes method PyObject * frombytes = PyObject_GetAttrString(field, "frombytes"); assert(frombytes != NULL); double * src = &(ros_message->values.data[0]); PyObject * data = PyBytes_FromStringAndSize((const char *)src, ros_message->values.size * sizeof(double)); assert(data != NULL); PyObject * ret = PyObject_CallFunctionObjArgs(frombytes, data, NULL); Py_DECREF(data); Py_DECREF(frombytes); if (!ret) { Py_DECREF(field); return NULL; } Py_DECREF(ret); } Py_DECREF(field); } // ownership of _pymessage is transferred to the caller return _pymessage; }
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/msg/_pid_state_s.c
// generated from rosidl_generator_py/resource/_idl_support.c.em // with input from control_msgs:msg/PidState.idl // generated code does not contain a copyright notice #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include <Python.h> #include <stdbool.h> #ifndef _WIN32 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-function" #endif #include "numpy/ndarrayobject.h" #ifndef _WIN32 # pragma GCC diagnostic pop #endif #include "rosidl_runtime_c/visibility_control.h" #include "control_msgs/msg/detail/pid_state__struct.h" #include "control_msgs/msg/detail/pid_state__functions.h" ROSIDL_GENERATOR_C_IMPORT bool std_msgs__msg__header__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * std_msgs__msg__header__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_IMPORT bool builtin_interfaces__msg__duration__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * builtin_interfaces__msg__duration__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__msg__pid_state__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[37]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.msg._pid_state.PidState", full_classname_dest, 36) == 0); } control_msgs__msg__PidState * ros_message = _ros_message; { // header PyObject * field = PyObject_GetAttrString(_pymsg, "header"); if (!field) { return false; } if (!std_msgs__msg__header__convert_from_py(field, &ros_message->header)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // timestep PyObject * field = PyObject_GetAttrString(_pymsg, "timestep"); if (!field) { return false; } if (!builtin_interfaces__msg__duration__convert_from_py(field, &ros_message->timestep)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // error PyObject * field = PyObject_GetAttrString(_pymsg, "error"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->error = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // error_dot PyObject * field = PyObject_GetAttrString(_pymsg, "error_dot"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->error_dot = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // p_error PyObject * field = PyObject_GetAttrString(_pymsg, "p_error"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->p_error = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // i_error PyObject * field = PyObject_GetAttrString(_pymsg, "i_error"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->i_error = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // d_error PyObject * field = PyObject_GetAttrString(_pymsg, "d_error"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->d_error = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // p_term PyObject * field = PyObject_GetAttrString(_pymsg, "p_term"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->p_term = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // i_term PyObject * field = PyObject_GetAttrString(_pymsg, "i_term"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->i_term = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // d_term PyObject * field = PyObject_GetAttrString(_pymsg, "d_term"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->d_term = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // i_max PyObject * field = PyObject_GetAttrString(_pymsg, "i_max"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->i_max = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // i_min PyObject * field = PyObject_GetAttrString(_pymsg, "i_min"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->i_min = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // output PyObject * field = PyObject_GetAttrString(_pymsg, "output"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->output = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__msg__pid_state__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of PidState */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.msg._pid_state"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "PidState"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__msg__PidState * ros_message = (control_msgs__msg__PidState *)raw_ros_message; { // header PyObject * field = NULL; field = std_msgs__msg__header__convert_to_py(&ros_message->header); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "header", field); Py_DECREF(field); if (rc) { return NULL; } } } { // timestep PyObject * field = NULL; field = builtin_interfaces__msg__duration__convert_to_py(&ros_message->timestep); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "timestep", field); Py_DECREF(field); if (rc) { return NULL; } } } { // error PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->error); { int rc = PyObject_SetAttrString(_pymessage, "error", field); Py_DECREF(field); if (rc) { return NULL; } } } { // error_dot PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->error_dot); { int rc = PyObject_SetAttrString(_pymessage, "error_dot", field); Py_DECREF(field); if (rc) { return NULL; } } } { // p_error PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->p_error); { int rc = PyObject_SetAttrString(_pymessage, "p_error", field); Py_DECREF(field); if (rc) { return NULL; } } } { // i_error PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->i_error); { int rc = PyObject_SetAttrString(_pymessage, "i_error", field); Py_DECREF(field); if (rc) { return NULL; } } } { // d_error PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->d_error); { int rc = PyObject_SetAttrString(_pymessage, "d_error", field); Py_DECREF(field); if (rc) { return NULL; } } } { // p_term PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->p_term); { int rc = PyObject_SetAttrString(_pymessage, "p_term", field); Py_DECREF(field); if (rc) { return NULL; } } } { // i_term PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->i_term); { int rc = PyObject_SetAttrString(_pymessage, "i_term", field); Py_DECREF(field); if (rc) { return NULL; } } } { // d_term PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->d_term); { int rc = PyObject_SetAttrString(_pymessage, "d_term", field); Py_DECREF(field); if (rc) { return NULL; } } } { // i_max PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->i_max); { int rc = PyObject_SetAttrString(_pymessage, "i_max", field); Py_DECREF(field); if (rc) { return NULL; } } } { // i_min PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->i_min); { int rc = PyObject_SetAttrString(_pymessage, "i_min", field); Py_DECREF(field); if (rc) { return NULL; } } } { // output PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->output); { int rc = PyObject_SetAttrString(_pymessage, "output", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; }
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/msg/_joint_tolerance.py
# generated from rosidl_generator_py/resource/_idl.py.em # with input from control_msgs:msg/JointTolerance.idl # generated code does not contain a copyright notice # Import statements for member types import rosidl_parser.definition # noqa: E402, I100 class Metaclass_JointTolerance(type): """Metaclass of message 'JointTolerance'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.msg.JointTolerance') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__msg__joint_tolerance cls._CONVERT_FROM_PY = module.convert_from_py_msg__msg__joint_tolerance cls._CONVERT_TO_PY = module.convert_to_py_msg__msg__joint_tolerance cls._TYPE_SUPPORT = module.type_support_msg__msg__joint_tolerance cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__msg__joint_tolerance @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class JointTolerance(metaclass=Metaclass_JointTolerance): """Message class 'JointTolerance'.""" __slots__ = [ '_name', '_position', '_velocity', '_acceleration', ] _fields_and_field_types = { 'name': 'string', 'position': 'double', 'velocity': 'double', 'acceleration': 'double', } SLOT_TYPES = ( rosidl_parser.definition.UnboundedString(), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.name = kwargs.get('name', str()) self.position = kwargs.get('position', float()) self.velocity = kwargs.get('velocity', float()) self.acceleration = kwargs.get('acceleration', float()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.name != other.name: return False if self.position != other.position: return False if self.velocity != other.velocity: return False if self.acceleration != other.acceleration: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def name(self): """Message field 'name'.""" return self._name @name.setter def name(self, value): if __debug__: assert \ isinstance(value, str), \ "The 'name' field must be of type 'str'" self._name = value @property def position(self): """Message field 'position'.""" return self._position @position.setter def position(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'position' field must be of type 'float'" self._position = value @property def velocity(self): """Message field 'velocity'.""" return self._velocity @velocity.setter def velocity(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'velocity' field must be of type 'float'" self._velocity = value @property def acceleration(self): """Message field 'acceleration'.""" return self._acceleration @acceleration.setter def acceleration(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'acceleration' field must be of type 'float'" self._acceleration = value
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/msg/_dynamic_joint_state_s.c
// generated from rosidl_generator_py/resource/_idl_support.c.em // with input from control_msgs:msg/DynamicJointState.idl // generated code does not contain a copyright notice #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include <Python.h> #include <stdbool.h> #ifndef _WIN32 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-function" #endif #include "numpy/ndarrayobject.h" #ifndef _WIN32 # pragma GCC diagnostic pop #endif #include "rosidl_runtime_c/visibility_control.h" #include "control_msgs/msg/detail/dynamic_joint_state__struct.h" #include "control_msgs/msg/detail/dynamic_joint_state__functions.h" #include "rosidl_runtime_c/primitives_sequence.h" #include "rosidl_runtime_c/primitives_sequence_functions.h" #include "rosidl_runtime_c/string.h" #include "rosidl_runtime_c/string_functions.h" // Nested array functions includes #include "control_msgs/msg/detail/interface_value__functions.h" // end nested array functions include ROSIDL_GENERATOR_C_IMPORT bool std_msgs__msg__header__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * std_msgs__msg__header__convert_to_py(void * raw_ros_message); bool control_msgs__msg__interface_value__convert_from_py(PyObject * _pymsg, void * _ros_message); PyObject * control_msgs__msg__interface_value__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__msg__dynamic_joint_state__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[56]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.msg._dynamic_joint_state.DynamicJointState", full_classname_dest, 55) == 0); } control_msgs__msg__DynamicJointState * ros_message = _ros_message; { // header PyObject * field = PyObject_GetAttrString(_pymsg, "header"); if (!field) { return false; } if (!std_msgs__msg__header__convert_from_py(field, &ros_message->header)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // joint_names PyObject * field = PyObject_GetAttrString(_pymsg, "joint_names"); if (!field) { return false; } PyObject * seq_field = PySequence_Fast(field, "expected a sequence in 'joint_names'"); if (!seq_field) { Py_DECREF(field); return false; } Py_ssize_t size = PySequence_Size(field); if (-1 == size) { Py_DECREF(seq_field); Py_DECREF(field); return false; } if (!rosidl_runtime_c__String__Sequence__init(&(ros_message->joint_names), size)) { PyErr_SetString(PyExc_RuntimeError, "unable to create String__Sequence ros_message"); Py_DECREF(seq_field); Py_DECREF(field); return false; } rosidl_runtime_c__String * dest = ros_message->joint_names.data; for (Py_ssize_t i = 0; i < size; ++i) { PyObject * item = PySequence_Fast_GET_ITEM(seq_field, i); if (!item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } assert(PyUnicode_Check(item)); PyObject * encoded_item = PyUnicode_AsUTF8String(item); if (!encoded_item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&dest[i], PyBytes_AS_STRING(encoded_item)); Py_DECREF(encoded_item); } Py_DECREF(seq_field); Py_DECREF(field); } { // interface_values PyObject * field = PyObject_GetAttrString(_pymsg, "interface_values"); if (!field) { return false; } PyObject * seq_field = PySequence_Fast(field, "expected a sequence in 'interface_values'"); if (!seq_field) { Py_DECREF(field); return false; } Py_ssize_t size = PySequence_Size(field); if (-1 == size) { Py_DECREF(seq_field); Py_DECREF(field); return false; } if (!control_msgs__msg__InterfaceValue__Sequence__init(&(ros_message->interface_values), size)) { PyErr_SetString(PyExc_RuntimeError, "unable to create control_msgs__msg__InterfaceValue__Sequence ros_message"); Py_DECREF(seq_field); Py_DECREF(field); return false; } control_msgs__msg__InterfaceValue * dest = ros_message->interface_values.data; for (Py_ssize_t i = 0; i < size; ++i) { if (!control_msgs__msg__interface_value__convert_from_py(PySequence_Fast_GET_ITEM(seq_field, i), &dest[i])) { Py_DECREF(seq_field); Py_DECREF(field); return false; } } Py_DECREF(seq_field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__msg__dynamic_joint_state__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of DynamicJointState */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.msg._dynamic_joint_state"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "DynamicJointState"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__msg__DynamicJointState * ros_message = (control_msgs__msg__DynamicJointState *)raw_ros_message; { // header PyObject * field = NULL; field = std_msgs__msg__header__convert_to_py(&ros_message->header); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "header", field); Py_DECREF(field); if (rc) { return NULL; } } } { // joint_names PyObject * field = NULL; size_t size = ros_message->joint_names.size; rosidl_runtime_c__String * src = ros_message->joint_names.data; field = PyList_New(size); if (!field) { return NULL; } for (size_t i = 0; i < size; ++i) { PyObject * decoded_item = PyUnicode_DecodeUTF8(src[i].data, strlen(src[i].data), "strict"); if (!decoded_item) { return NULL; } int rc = PyList_SetItem(field, i, decoded_item); (void)rc; assert(rc == 0); } assert(PySequence_Check(field)); { int rc = PyObject_SetAttrString(_pymessage, "joint_names", field); Py_DECREF(field); if (rc) { return NULL; } } } { // interface_values PyObject * field = NULL; size_t size = ros_message->interface_values.size; field = PyList_New(size); if (!field) { return NULL; } control_msgs__msg__InterfaceValue * item; for (size_t i = 0; i < size; ++i) { item = &(ros_message->interface_values.data[i]); PyObject * pyitem = control_msgs__msg__interface_value__convert_to_py(item); if (!pyitem) { Py_DECREF(field); return NULL; } int rc = PyList_SetItem(field, i, pyitem); (void)rc; assert(rc == 0); } assert(PySequence_Check(field)); { int rc = PyObject_SetAttrString(_pymessage, "interface_values", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; }
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/msg/_joint_controller_state_s.c
// generated from rosidl_generator_py/resource/_idl_support.c.em // with input from control_msgs:msg/JointControllerState.idl // generated code does not contain a copyright notice #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include <Python.h> #include <stdbool.h> #ifndef _WIN32 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-function" #endif #include "numpy/ndarrayobject.h" #ifndef _WIN32 # pragma GCC diagnostic pop #endif #include "rosidl_runtime_c/visibility_control.h" #include "control_msgs/msg/detail/joint_controller_state__struct.h" #include "control_msgs/msg/detail/joint_controller_state__functions.h" ROSIDL_GENERATOR_C_IMPORT bool std_msgs__msg__header__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * std_msgs__msg__header__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__msg__joint_controller_state__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[62]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.msg._joint_controller_state.JointControllerState", full_classname_dest, 61) == 0); } control_msgs__msg__JointControllerState * ros_message = _ros_message; { // header PyObject * field = PyObject_GetAttrString(_pymsg, "header"); if (!field) { return false; } if (!std_msgs__msg__header__convert_from_py(field, &ros_message->header)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // set_point PyObject * field = PyObject_GetAttrString(_pymsg, "set_point"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->set_point = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // process_value PyObject * field = PyObject_GetAttrString(_pymsg, "process_value"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->process_value = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // process_value_dot PyObject * field = PyObject_GetAttrString(_pymsg, "process_value_dot"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->process_value_dot = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // error PyObject * field = PyObject_GetAttrString(_pymsg, "error"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->error = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // time_step PyObject * field = PyObject_GetAttrString(_pymsg, "time_step"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->time_step = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // command PyObject * field = PyObject_GetAttrString(_pymsg, "command"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->command = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // p PyObject * field = PyObject_GetAttrString(_pymsg, "p"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->p = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // i PyObject * field = PyObject_GetAttrString(_pymsg, "i"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->i = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // d PyObject * field = PyObject_GetAttrString(_pymsg, "d"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->d = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // i_clamp PyObject * field = PyObject_GetAttrString(_pymsg, "i_clamp"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->i_clamp = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // antiwindup PyObject * field = PyObject_GetAttrString(_pymsg, "antiwindup"); if (!field) { return false; } assert(PyBool_Check(field)); ros_message->antiwindup = (Py_True == field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__msg__joint_controller_state__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of JointControllerState */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.msg._joint_controller_state"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "JointControllerState"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__msg__JointControllerState * ros_message = (control_msgs__msg__JointControllerState *)raw_ros_message; { // header PyObject * field = NULL; field = std_msgs__msg__header__convert_to_py(&ros_message->header); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "header", field); Py_DECREF(field); if (rc) { return NULL; } } } { // set_point PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->set_point); { int rc = PyObject_SetAttrString(_pymessage, "set_point", field); Py_DECREF(field); if (rc) { return NULL; } } } { // process_value PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->process_value); { int rc = PyObject_SetAttrString(_pymessage, "process_value", field); Py_DECREF(field); if (rc) { return NULL; } } } { // process_value_dot PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->process_value_dot); { int rc = PyObject_SetAttrString(_pymessage, "process_value_dot", field); Py_DECREF(field); if (rc) { return NULL; } } } { // error PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->error); { int rc = PyObject_SetAttrString(_pymessage, "error", field); Py_DECREF(field); if (rc) { return NULL; } } } { // time_step PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->time_step); { int rc = PyObject_SetAttrString(_pymessage, "time_step", field); Py_DECREF(field); if (rc) { return NULL; } } } { // command PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->command); { int rc = PyObject_SetAttrString(_pymessage, "command", field); Py_DECREF(field); if (rc) { return NULL; } } } { // p PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->p); { int rc = PyObject_SetAttrString(_pymessage, "p", field); Py_DECREF(field); if (rc) { return NULL; } } } { // i PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->i); { int rc = PyObject_SetAttrString(_pymessage, "i", field); Py_DECREF(field); if (rc) { return NULL; } } } { // d PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->d); { int rc = PyObject_SetAttrString(_pymessage, "d", field); Py_DECREF(field); if (rc) { return NULL; } } } { // i_clamp PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->i_clamp); { int rc = PyObject_SetAttrString(_pymessage, "i_clamp", field); Py_DECREF(field); if (rc) { return NULL; } } } { // antiwindup PyObject * field = NULL; field = PyBool_FromLong(ros_message->antiwindup ? 1 : 0); { int rc = PyObject_SetAttrString(_pymessage, "antiwindup", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; }
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/msg/_pid_state.py
# generated from rosidl_generator_py/resource/_idl.py.em # with input from control_msgs:msg/PidState.idl # generated code does not contain a copyright notice # Import statements for member types import rosidl_parser.definition # noqa: E402, I100 class Metaclass_PidState(type): """Metaclass of message 'PidState'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.msg.PidState') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__msg__pid_state cls._CONVERT_FROM_PY = module.convert_from_py_msg__msg__pid_state cls._CONVERT_TO_PY = module.convert_to_py_msg__msg__pid_state cls._TYPE_SUPPORT = module.type_support_msg__msg__pid_state cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__msg__pid_state from builtin_interfaces.msg import Duration if Duration.__class__._TYPE_SUPPORT is None: Duration.__class__.__import_type_support__() from std_msgs.msg import Header if Header.__class__._TYPE_SUPPORT is None: Header.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class PidState(metaclass=Metaclass_PidState): """Message class 'PidState'.""" __slots__ = [ '_header', '_timestep', '_error', '_error_dot', '_p_error', '_i_error', '_d_error', '_p_term', '_i_term', '_d_term', '_i_max', '_i_min', '_output', ] _fields_and_field_types = { 'header': 'std_msgs/Header', 'timestep': 'builtin_interfaces/Duration', 'error': 'double', 'error_dot': 'double', 'p_error': 'double', 'i_error': 'double', 'd_error': 'double', 'p_term': 'double', 'i_term': 'double', 'd_term': 'double', 'i_max': 'double', 'i_min': 'double', 'output': 'double', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['std_msgs', 'msg'], 'Header'), # noqa: E501 rosidl_parser.definition.NamespacedType(['builtin_interfaces', 'msg'], 'Duration'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from std_msgs.msg import Header self.header = kwargs.get('header', Header()) from builtin_interfaces.msg import Duration self.timestep = kwargs.get('timestep', Duration()) self.error = kwargs.get('error', float()) self.error_dot = kwargs.get('error_dot', float()) self.p_error = kwargs.get('p_error', float()) self.i_error = kwargs.get('i_error', float()) self.d_error = kwargs.get('d_error', float()) self.p_term = kwargs.get('p_term', float()) self.i_term = kwargs.get('i_term', float()) self.d_term = kwargs.get('d_term', float()) self.i_max = kwargs.get('i_max', float()) self.i_min = kwargs.get('i_min', float()) self.output = kwargs.get('output', float()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.header != other.header: return False if self.timestep != other.timestep: return False if self.error != other.error: return False if self.error_dot != other.error_dot: return False if self.p_error != other.p_error: return False if self.i_error != other.i_error: return False if self.d_error != other.d_error: return False if self.p_term != other.p_term: return False if self.i_term != other.i_term: return False if self.d_term != other.d_term: return False if self.i_max != other.i_max: return False if self.i_min != other.i_min: return False if self.output != other.output: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def header(self): """Message field 'header'.""" return self._header @header.setter def header(self, value): if __debug__: from std_msgs.msg import Header assert \ isinstance(value, Header), \ "The 'header' field must be a sub message of type 'Header'" self._header = value @property def timestep(self): """Message field 'timestep'.""" return self._timestep @timestep.setter def timestep(self, value): if __debug__: from builtin_interfaces.msg import Duration assert \ isinstance(value, Duration), \ "The 'timestep' field must be a sub message of type 'Duration'" self._timestep = value @property def error(self): """Message field 'error'.""" return self._error @error.setter def error(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'error' field must be of type 'float'" self._error = value @property def error_dot(self): """Message field 'error_dot'.""" return self._error_dot @error_dot.setter def error_dot(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'error_dot' field must be of type 'float'" self._error_dot = value @property def p_error(self): """Message field 'p_error'.""" return self._p_error @p_error.setter def p_error(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'p_error' field must be of type 'float'" self._p_error = value @property def i_error(self): """Message field 'i_error'.""" return self._i_error @i_error.setter def i_error(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'i_error' field must be of type 'float'" self._i_error = value @property def d_error(self): """Message field 'd_error'.""" return self._d_error @d_error.setter def d_error(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'd_error' field must be of type 'float'" self._d_error = value @property def p_term(self): """Message field 'p_term'.""" return self._p_term @p_term.setter def p_term(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'p_term' field must be of type 'float'" self._p_term = value @property def i_term(self): """Message field 'i_term'.""" return self._i_term @i_term.setter def i_term(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'i_term' field must be of type 'float'" self._i_term = value @property def d_term(self): """Message field 'd_term'.""" return self._d_term @d_term.setter def d_term(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'd_term' field must be of type 'float'" self._d_term = value @property def i_max(self): """Message field 'i_max'.""" return self._i_max @i_max.setter def i_max(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'i_max' field must be of type 'float'" self._i_max = value @property def i_min(self): """Message field 'i_min'.""" return self._i_min @i_min.setter def i_min(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'i_min' field must be of type 'float'" self._i_min = value @property def output(self): """Message field 'output'.""" return self._output @output.setter def output(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'output' field must be of type 'float'" self._output = value
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/msg/_joint_controller_state.py
# generated from rosidl_generator_py/resource/_idl.py.em # with input from control_msgs:msg/JointControllerState.idl # generated code does not contain a copyright notice # Import statements for member types import rosidl_parser.definition # noqa: E402, I100 class Metaclass_JointControllerState(type): """Metaclass of message 'JointControllerState'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.msg.JointControllerState') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__msg__joint_controller_state cls._CONVERT_FROM_PY = module.convert_from_py_msg__msg__joint_controller_state cls._CONVERT_TO_PY = module.convert_to_py_msg__msg__joint_controller_state cls._TYPE_SUPPORT = module.type_support_msg__msg__joint_controller_state cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__msg__joint_controller_state from std_msgs.msg import Header if Header.__class__._TYPE_SUPPORT is None: Header.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class JointControllerState(metaclass=Metaclass_JointControllerState): """Message class 'JointControllerState'.""" __slots__ = [ '_header', '_set_point', '_process_value', '_process_value_dot', '_error', '_time_step', '_command', '_p', '_i', '_d', '_i_clamp', '_antiwindup', ] _fields_and_field_types = { 'header': 'std_msgs/Header', 'set_point': 'double', 'process_value': 'double', 'process_value_dot': 'double', 'error': 'double', 'time_step': 'double', 'command': 'double', 'p': 'double', 'i': 'double', 'd': 'double', 'i_clamp': 'double', 'antiwindup': 'boolean', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['std_msgs', 'msg'], 'Header'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('boolean'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from std_msgs.msg import Header self.header = kwargs.get('header', Header()) self.set_point = kwargs.get('set_point', float()) self.process_value = kwargs.get('process_value', float()) self.process_value_dot = kwargs.get('process_value_dot', float()) self.error = kwargs.get('error', float()) self.time_step = kwargs.get('time_step', float()) self.command = kwargs.get('command', float()) self.p = kwargs.get('p', float()) self.i = kwargs.get('i', float()) self.d = kwargs.get('d', float()) self.i_clamp = kwargs.get('i_clamp', float()) self.antiwindup = kwargs.get('antiwindup', bool()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.header != other.header: return False if self.set_point != other.set_point: return False if self.process_value != other.process_value: return False if self.process_value_dot != other.process_value_dot: return False if self.error != other.error: return False if self.time_step != other.time_step: return False if self.command != other.command: return False if self.p != other.p: return False if self.i != other.i: return False if self.d != other.d: return False if self.i_clamp != other.i_clamp: return False if self.antiwindup != other.antiwindup: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def header(self): """Message field 'header'.""" return self._header @header.setter def header(self, value): if __debug__: from std_msgs.msg import Header assert \ isinstance(value, Header), \ "The 'header' field must be a sub message of type 'Header'" self._header = value @property def set_point(self): """Message field 'set_point'.""" return self._set_point @set_point.setter def set_point(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'set_point' field must be of type 'float'" self._set_point = value @property def process_value(self): """Message field 'process_value'.""" return self._process_value @process_value.setter def process_value(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'process_value' field must be of type 'float'" self._process_value = value @property def process_value_dot(self): """Message field 'process_value_dot'.""" return self._process_value_dot @process_value_dot.setter def process_value_dot(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'process_value_dot' field must be of type 'float'" self._process_value_dot = value @property def error(self): """Message field 'error'.""" return self._error @error.setter def error(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'error' field must be of type 'float'" self._error = value @property def time_step(self): """Message field 'time_step'.""" return self._time_step @time_step.setter def time_step(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'time_step' field must be of type 'float'" self._time_step = value @property def command(self): """Message field 'command'.""" return self._command @command.setter def command(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'command' field must be of type 'float'" self._command = value @property def p(self): """Message field 'p'.""" return self._p @p.setter def p(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'p' field must be of type 'float'" self._p = value @property def i(self): """Message field 'i'.""" return self._i @i.setter def i(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'i' field must be of type 'float'" self._i = value @property def d(self): """Message field 'd'.""" return self._d @d.setter def d(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'd' field must be of type 'float'" self._d = value @property def i_clamp(self): """Message field 'i_clamp'.""" return self._i_clamp @i_clamp.setter def i_clamp(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'i_clamp' field must be of type 'float'" self._i_clamp = value @property def antiwindup(self): """Message field 'antiwindup'.""" return self._antiwindup @antiwindup.setter def antiwindup(self, value): if __debug__: assert \ isinstance(value, bool), \ "The 'antiwindup' field must be of type 'bool'" self._antiwindup = value
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/msg/__init__.py
from control_msgs.msg._dynamic_joint_state import DynamicJointState # noqa: F401 from control_msgs.msg._gripper_command import GripperCommand # noqa: F401 from control_msgs.msg._interface_value import InterfaceValue # noqa: F401 from control_msgs.msg._joint_controller_state import JointControllerState # noqa: F401 from control_msgs.msg._joint_jog import JointJog # noqa: F401 from control_msgs.msg._joint_tolerance import JointTolerance # noqa: F401 from control_msgs.msg._joint_trajectory_controller_state import JointTrajectoryControllerState # noqa: F401 from control_msgs.msg._pid_state import PidState # noqa: F401
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/msg/_gripper_command_s.c
// generated from rosidl_generator_py/resource/_idl_support.c.em // with input from control_msgs:msg/GripperCommand.idl // generated code does not contain a copyright notice #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include <Python.h> #include <stdbool.h> #ifndef _WIN32 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-function" #endif #include "numpy/ndarrayobject.h" #ifndef _WIN32 # pragma GCC diagnostic pop #endif #include "rosidl_runtime_c/visibility_control.h" #include "control_msgs/msg/detail/gripper_command__struct.h" #include "control_msgs/msg/detail/gripper_command__functions.h" ROSIDL_GENERATOR_C_EXPORT bool control_msgs__msg__gripper_command__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[49]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.msg._gripper_command.GripperCommand", full_classname_dest, 48) == 0); } control_msgs__msg__GripperCommand * ros_message = _ros_message; { // position PyObject * field = PyObject_GetAttrString(_pymsg, "position"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->position = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } { // max_effort PyObject * field = PyObject_GetAttrString(_pymsg, "max_effort"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->max_effort = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__msg__gripper_command__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of GripperCommand */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.msg._gripper_command"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "GripperCommand"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__msg__GripperCommand * ros_message = (control_msgs__msg__GripperCommand *)raw_ros_message; { // position PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->position); { int rc = PyObject_SetAttrString(_pymessage, "position", field); Py_DECREF(field); if (rc) { return NULL; } } } { // max_effort PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->max_effort); { int rc = PyObject_SetAttrString(_pymessage, "max_effort", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; }
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/msg/_gripper_command.py
# generated from rosidl_generator_py/resource/_idl.py.em # with input from control_msgs:msg/GripperCommand.idl # generated code does not contain a copyright notice # Import statements for member types import rosidl_parser.definition # noqa: E402, I100 class Metaclass_GripperCommand(type): """Metaclass of message 'GripperCommand'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.msg.GripperCommand') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__msg__gripper_command cls._CONVERT_FROM_PY = module.convert_from_py_msg__msg__gripper_command cls._CONVERT_TO_PY = module.convert_to_py_msg__msg__gripper_command cls._TYPE_SUPPORT = module.type_support_msg__msg__gripper_command cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__msg__gripper_command @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class GripperCommand(metaclass=Metaclass_GripperCommand): """Message class 'GripperCommand'.""" __slots__ = [ '_position', '_max_effort', ] _fields_and_field_types = { 'position': 'double', 'max_effort': 'double', } SLOT_TYPES = ( rosidl_parser.definition.BasicType('double'), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.position = kwargs.get('position', float()) self.max_effort = kwargs.get('max_effort', float()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.position != other.position: return False if self.max_effort != other.max_effort: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def position(self): """Message field 'position'.""" return self._position @position.setter def position(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'position' field must be of type 'float'" self._position = value @property def max_effort(self): """Message field 'max_effort'.""" return self._max_effort @max_effort.setter def max_effort(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'max_effort' field must be of type 'float'" self._max_effort = value
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/msg/_joint_trajectory_controller_state_s.c
// generated from rosidl_generator_py/resource/_idl_support.c.em // with input from control_msgs:msg/JointTrajectoryControllerState.idl // generated code does not contain a copyright notice #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include <Python.h> #include <stdbool.h> #ifndef _WIN32 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-function" #endif #include "numpy/ndarrayobject.h" #ifndef _WIN32 # pragma GCC diagnostic pop #endif #include "rosidl_runtime_c/visibility_control.h" #include "control_msgs/msg/detail/joint_trajectory_controller_state__struct.h" #include "control_msgs/msg/detail/joint_trajectory_controller_state__functions.h" #include "rosidl_runtime_c/primitives_sequence.h" #include "rosidl_runtime_c/primitives_sequence_functions.h" #include "rosidl_runtime_c/string.h" #include "rosidl_runtime_c/string_functions.h" ROSIDL_GENERATOR_C_IMPORT bool std_msgs__msg__header__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * std_msgs__msg__header__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_IMPORT bool trajectory_msgs__msg__joint_trajectory_point__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * trajectory_msgs__msg__joint_trajectory_point__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_IMPORT bool trajectory_msgs__msg__joint_trajectory_point__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * trajectory_msgs__msg__joint_trajectory_point__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_IMPORT bool trajectory_msgs__msg__joint_trajectory_point__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * trajectory_msgs__msg__joint_trajectory_point__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__msg__joint_trajectory_controller_state__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[83]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.msg._joint_trajectory_controller_state.JointTrajectoryControllerState", full_classname_dest, 82) == 0); } control_msgs__msg__JointTrajectoryControllerState * ros_message = _ros_message; { // header PyObject * field = PyObject_GetAttrString(_pymsg, "header"); if (!field) { return false; } if (!std_msgs__msg__header__convert_from_py(field, &ros_message->header)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // joint_names PyObject * field = PyObject_GetAttrString(_pymsg, "joint_names"); if (!field) { return false; } PyObject * seq_field = PySequence_Fast(field, "expected a sequence in 'joint_names'"); if (!seq_field) { Py_DECREF(field); return false; } Py_ssize_t size = PySequence_Size(field); if (-1 == size) { Py_DECREF(seq_field); Py_DECREF(field); return false; } if (!rosidl_runtime_c__String__Sequence__init(&(ros_message->joint_names), size)) { PyErr_SetString(PyExc_RuntimeError, "unable to create String__Sequence ros_message"); Py_DECREF(seq_field); Py_DECREF(field); return false; } rosidl_runtime_c__String * dest = ros_message->joint_names.data; for (Py_ssize_t i = 0; i < size; ++i) { PyObject * item = PySequence_Fast_GET_ITEM(seq_field, i); if (!item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } assert(PyUnicode_Check(item)); PyObject * encoded_item = PyUnicode_AsUTF8String(item); if (!encoded_item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&dest[i], PyBytes_AS_STRING(encoded_item)); Py_DECREF(encoded_item); } Py_DECREF(seq_field); Py_DECREF(field); } { // desired PyObject * field = PyObject_GetAttrString(_pymsg, "desired"); if (!field) { return false; } if (!trajectory_msgs__msg__joint_trajectory_point__convert_from_py(field, &ros_message->desired)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // actual PyObject * field = PyObject_GetAttrString(_pymsg, "actual"); if (!field) { return false; } if (!trajectory_msgs__msg__joint_trajectory_point__convert_from_py(field, &ros_message->actual)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // error PyObject * field = PyObject_GetAttrString(_pymsg, "error"); if (!field) { return false; } if (!trajectory_msgs__msg__joint_trajectory_point__convert_from_py(field, &ros_message->error)) { Py_DECREF(field); return false; } Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__msg__joint_trajectory_controller_state__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of JointTrajectoryControllerState */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.msg._joint_trajectory_controller_state"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "JointTrajectoryControllerState"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__msg__JointTrajectoryControllerState * ros_message = (control_msgs__msg__JointTrajectoryControllerState *)raw_ros_message; { // header PyObject * field = NULL; field = std_msgs__msg__header__convert_to_py(&ros_message->header); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "header", field); Py_DECREF(field); if (rc) { return NULL; } } } { // joint_names PyObject * field = NULL; size_t size = ros_message->joint_names.size; rosidl_runtime_c__String * src = ros_message->joint_names.data; field = PyList_New(size); if (!field) { return NULL; } for (size_t i = 0; i < size; ++i) { PyObject * decoded_item = PyUnicode_DecodeUTF8(src[i].data, strlen(src[i].data), "strict"); if (!decoded_item) { return NULL; } int rc = PyList_SetItem(field, i, decoded_item); (void)rc; assert(rc == 0); } assert(PySequence_Check(field)); { int rc = PyObject_SetAttrString(_pymessage, "joint_names", field); Py_DECREF(field); if (rc) { return NULL; } } } { // desired PyObject * field = NULL; field = trajectory_msgs__msg__joint_trajectory_point__convert_to_py(&ros_message->desired); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "desired", field); Py_DECREF(field); if (rc) { return NULL; } } } { // actual PyObject * field = NULL; field = trajectory_msgs__msg__joint_trajectory_point__convert_to_py(&ros_message->actual); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "actual", field); Py_DECREF(field); if (rc) { return NULL; } } } { // error PyObject * field = NULL; field = trajectory_msgs__msg__joint_trajectory_point__convert_to_py(&ros_message->error); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "error", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; }
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/msg/_dynamic_joint_state.py
# generated from rosidl_generator_py/resource/_idl.py.em # with input from control_msgs:msg/DynamicJointState.idl # generated code does not contain a copyright notice # Import statements for member types import rosidl_parser.definition # noqa: E402, I100 class Metaclass_DynamicJointState(type): """Metaclass of message 'DynamicJointState'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.msg.DynamicJointState') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__msg__dynamic_joint_state cls._CONVERT_FROM_PY = module.convert_from_py_msg__msg__dynamic_joint_state cls._CONVERT_TO_PY = module.convert_to_py_msg__msg__dynamic_joint_state cls._TYPE_SUPPORT = module.type_support_msg__msg__dynamic_joint_state cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__msg__dynamic_joint_state from control_msgs.msg import InterfaceValue if InterfaceValue.__class__._TYPE_SUPPORT is None: InterfaceValue.__class__.__import_type_support__() from std_msgs.msg import Header if Header.__class__._TYPE_SUPPORT is None: Header.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class DynamicJointState(metaclass=Metaclass_DynamicJointState): """Message class 'DynamicJointState'.""" __slots__ = [ '_header', '_joint_names', '_interface_values', ] _fields_and_field_types = { 'header': 'std_msgs/Header', 'joint_names': 'sequence<string>', 'interface_values': 'sequence<control_msgs/InterfaceValue>', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['std_msgs', 'msg'], 'Header'), # noqa: E501 rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.UnboundedString()), # noqa: E501 rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.NamespacedType(['control_msgs', 'msg'], 'InterfaceValue')), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from std_msgs.msg import Header self.header = kwargs.get('header', Header()) self.joint_names = kwargs.get('joint_names', []) self.interface_values = kwargs.get('interface_values', []) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.header != other.header: return False if self.joint_names != other.joint_names: return False if self.interface_values != other.interface_values: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def header(self): """Message field 'header'.""" return self._header @header.setter def header(self, value): if __debug__: from std_msgs.msg import Header assert \ isinstance(value, Header), \ "The 'header' field must be a sub message of type 'Header'" self._header = value @property def joint_names(self): """Message field 'joint_names'.""" return self._joint_names @joint_names.setter def joint_names(self, value): if __debug__: from collections.abc import Sequence from collections.abc import Set from collections import UserList from collections import UserString assert \ ((isinstance(value, Sequence) or isinstance(value, Set) or isinstance(value, UserList)) and not isinstance(value, str) and not isinstance(value, UserString) and all(isinstance(v, str) for v in value) and True), \ "The 'joint_names' field must be a set or sequence and each value of type 'str'" self._joint_names = value @property def interface_values(self): """Message field 'interface_values'.""" return self._interface_values @interface_values.setter def interface_values(self, value): if __debug__: from control_msgs.msg import InterfaceValue from collections.abc import Sequence from collections.abc import Set from collections import UserList from collections import UserString assert \ ((isinstance(value, Sequence) or isinstance(value, Set) or isinstance(value, UserList)) and not isinstance(value, str) and not isinstance(value, UserString) and all(isinstance(v, InterfaceValue) for v in value) and True), \ "The 'interface_values' field must be a set or sequence and each value of type 'InterfaceValue'" self._interface_values = value
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/msg/_joint_jog_s.c
// generated from rosidl_generator_py/resource/_idl_support.c.em // with input from control_msgs:msg/JointJog.idl // generated code does not contain a copyright notice #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include <Python.h> #include <stdbool.h> #ifndef _WIN32 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-function" #endif #include "numpy/ndarrayobject.h" #ifndef _WIN32 # pragma GCC diagnostic pop #endif #include "rosidl_runtime_c/visibility_control.h" #include "control_msgs/msg/detail/joint_jog__struct.h" #include "control_msgs/msg/detail/joint_jog__functions.h" #include "rosidl_runtime_c/primitives_sequence.h" #include "rosidl_runtime_c/primitives_sequence_functions.h" #include "rosidl_runtime_c/string.h" #include "rosidl_runtime_c/string_functions.h" ROSIDL_GENERATOR_C_IMPORT bool std_msgs__msg__header__convert_from_py(PyObject * _pymsg, void * _ros_message); ROSIDL_GENERATOR_C_IMPORT PyObject * std_msgs__msg__header__convert_to_py(void * raw_ros_message); ROSIDL_GENERATOR_C_EXPORT bool control_msgs__msg__joint_jog__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[37]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("control_msgs.msg._joint_jog.JointJog", full_classname_dest, 36) == 0); } control_msgs__msg__JointJog * ros_message = _ros_message; { // header PyObject * field = PyObject_GetAttrString(_pymsg, "header"); if (!field) { return false; } if (!std_msgs__msg__header__convert_from_py(field, &ros_message->header)) { Py_DECREF(field); return false; } Py_DECREF(field); } { // joint_names PyObject * field = PyObject_GetAttrString(_pymsg, "joint_names"); if (!field) { return false; } PyObject * seq_field = PySequence_Fast(field, "expected a sequence in 'joint_names'"); if (!seq_field) { Py_DECREF(field); return false; } Py_ssize_t size = PySequence_Size(field); if (-1 == size) { Py_DECREF(seq_field); Py_DECREF(field); return false; } if (!rosidl_runtime_c__String__Sequence__init(&(ros_message->joint_names), size)) { PyErr_SetString(PyExc_RuntimeError, "unable to create String__Sequence ros_message"); Py_DECREF(seq_field); Py_DECREF(field); return false; } rosidl_runtime_c__String * dest = ros_message->joint_names.data; for (Py_ssize_t i = 0; i < size; ++i) { PyObject * item = PySequence_Fast_GET_ITEM(seq_field, i); if (!item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } assert(PyUnicode_Check(item)); PyObject * encoded_item = PyUnicode_AsUTF8String(item); if (!encoded_item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&dest[i], PyBytes_AS_STRING(encoded_item)); Py_DECREF(encoded_item); } Py_DECREF(seq_field); Py_DECREF(field); } { // displacements PyObject * field = PyObject_GetAttrString(_pymsg, "displacements"); if (!field) { return false; } PyObject * seq_field = PySequence_Fast(field, "expected a sequence in 'displacements'"); if (!seq_field) { Py_DECREF(field); return false; } Py_ssize_t size = PySequence_Size(field); if (-1 == size) { Py_DECREF(seq_field); Py_DECREF(field); return false; } if (!rosidl_runtime_c__double__Sequence__init(&(ros_message->displacements), size)) { PyErr_SetString(PyExc_RuntimeError, "unable to create double__Sequence ros_message"); Py_DECREF(seq_field); Py_DECREF(field); return false; } double * dest = ros_message->displacements.data; for (Py_ssize_t i = 0; i < size; ++i) { PyObject * item = PySequence_Fast_GET_ITEM(seq_field, i); if (!item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } assert(PyFloat_Check(item)); double tmp = PyFloat_AS_DOUBLE(item); memcpy(&dest[i], &tmp, sizeof(double)); } Py_DECREF(seq_field); Py_DECREF(field); } { // velocities PyObject * field = PyObject_GetAttrString(_pymsg, "velocities"); if (!field) { return false; } PyObject * seq_field = PySequence_Fast(field, "expected a sequence in 'velocities'"); if (!seq_field) { Py_DECREF(field); return false; } Py_ssize_t size = PySequence_Size(field); if (-1 == size) { Py_DECREF(seq_field); Py_DECREF(field); return false; } if (!rosidl_runtime_c__double__Sequence__init(&(ros_message->velocities), size)) { PyErr_SetString(PyExc_RuntimeError, "unable to create double__Sequence ros_message"); Py_DECREF(seq_field); Py_DECREF(field); return false; } double * dest = ros_message->velocities.data; for (Py_ssize_t i = 0; i < size; ++i) { PyObject * item = PySequence_Fast_GET_ITEM(seq_field, i); if (!item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } assert(PyFloat_Check(item)); double tmp = PyFloat_AS_DOUBLE(item); memcpy(&dest[i], &tmp, sizeof(double)); } Py_DECREF(seq_field); Py_DECREF(field); } { // duration PyObject * field = PyObject_GetAttrString(_pymsg, "duration"); if (!field) { return false; } assert(PyFloat_Check(field)); ros_message->duration = PyFloat_AS_DOUBLE(field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * control_msgs__msg__joint_jog__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of JointJog */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("control_msgs.msg._joint_jog"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "JointJog"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } control_msgs__msg__JointJog * ros_message = (control_msgs__msg__JointJog *)raw_ros_message; { // header PyObject * field = NULL; field = std_msgs__msg__header__convert_to_py(&ros_message->header); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "header", field); Py_DECREF(field); if (rc) { return NULL; } } } { // joint_names PyObject * field = NULL; size_t size = ros_message->joint_names.size; rosidl_runtime_c__String * src = ros_message->joint_names.data; field = PyList_New(size); if (!field) { return NULL; } for (size_t i = 0; i < size; ++i) { PyObject * decoded_item = PyUnicode_DecodeUTF8(src[i].data, strlen(src[i].data), "strict"); if (!decoded_item) { return NULL; } int rc = PyList_SetItem(field, i, decoded_item); (void)rc; assert(rc == 0); } assert(PySequence_Check(field)); { int rc = PyObject_SetAttrString(_pymessage, "joint_names", field); Py_DECREF(field); if (rc) { return NULL; } } } { // displacements PyObject * field = NULL; field = PyObject_GetAttrString(_pymessage, "displacements"); if (!field) { return NULL; } assert(field->ob_type != NULL); assert(field->ob_type->tp_name != NULL); assert(strcmp(field->ob_type->tp_name, "array.array") == 0); // ensure that itemsize matches the sizeof of the ROS message field PyObject * itemsize_attr = PyObject_GetAttrString(field, "itemsize"); assert(itemsize_attr != NULL); size_t itemsize = PyLong_AsSize_t(itemsize_attr); Py_DECREF(itemsize_attr); if (itemsize != sizeof(double)) { PyErr_SetString(PyExc_RuntimeError, "itemsize doesn't match expectation"); Py_DECREF(field); return NULL; } // clear the array, poor approach to remove potential default values Py_ssize_t length = PyObject_Length(field); if (-1 == length) { Py_DECREF(field); return NULL; } if (length > 0) { PyObject * pop = PyObject_GetAttrString(field, "pop"); assert(pop != NULL); for (Py_ssize_t i = 0; i < length; ++i) { PyObject * ret = PyObject_CallFunctionObjArgs(pop, NULL); if (!ret) { Py_DECREF(pop); Py_DECREF(field); return NULL; } Py_DECREF(ret); } Py_DECREF(pop); } if (ros_message->displacements.size > 0) { // populating the array.array using the frombytes method PyObject * frombytes = PyObject_GetAttrString(field, "frombytes"); assert(frombytes != NULL); double * src = &(ros_message->displacements.data[0]); PyObject * data = PyBytes_FromStringAndSize((const char *)src, ros_message->displacements.size * sizeof(double)); assert(data != NULL); PyObject * ret = PyObject_CallFunctionObjArgs(frombytes, data, NULL); Py_DECREF(data); Py_DECREF(frombytes); if (!ret) { Py_DECREF(field); return NULL; } Py_DECREF(ret); } Py_DECREF(field); } { // velocities PyObject * field = NULL; field = PyObject_GetAttrString(_pymessage, "velocities"); if (!field) { return NULL; } assert(field->ob_type != NULL); assert(field->ob_type->tp_name != NULL); assert(strcmp(field->ob_type->tp_name, "array.array") == 0); // ensure that itemsize matches the sizeof of the ROS message field PyObject * itemsize_attr = PyObject_GetAttrString(field, "itemsize"); assert(itemsize_attr != NULL); size_t itemsize = PyLong_AsSize_t(itemsize_attr); Py_DECREF(itemsize_attr); if (itemsize != sizeof(double)) { PyErr_SetString(PyExc_RuntimeError, "itemsize doesn't match expectation"); Py_DECREF(field); return NULL; } // clear the array, poor approach to remove potential default values Py_ssize_t length = PyObject_Length(field); if (-1 == length) { Py_DECREF(field); return NULL; } if (length > 0) { PyObject * pop = PyObject_GetAttrString(field, "pop"); assert(pop != NULL); for (Py_ssize_t i = 0; i < length; ++i) { PyObject * ret = PyObject_CallFunctionObjArgs(pop, NULL); if (!ret) { Py_DECREF(pop); Py_DECREF(field); return NULL; } Py_DECREF(ret); } Py_DECREF(pop); } if (ros_message->velocities.size > 0) { // populating the array.array using the frombytes method PyObject * frombytes = PyObject_GetAttrString(field, "frombytes"); assert(frombytes != NULL); double * src = &(ros_message->velocities.data[0]); PyObject * data = PyBytes_FromStringAndSize((const char *)src, ros_message->velocities.size * sizeof(double)); assert(data != NULL); PyObject * ret = PyObject_CallFunctionObjArgs(frombytes, data, NULL); Py_DECREF(data); Py_DECREF(frombytes); if (!ret) { Py_DECREF(field); return NULL; } Py_DECREF(ret); } Py_DECREF(field); } { // duration PyObject * field = NULL; field = PyFloat_FromDouble(ros_message->duration); { int rc = PyObject_SetAttrString(_pymessage, "duration", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; }
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/control_msgs/msg/_joint_jog.py
# generated from rosidl_generator_py/resource/_idl.py.em # with input from control_msgs:msg/JointJog.idl # generated code does not contain a copyright notice # Import statements for member types # Member 'displacements' # Member 'velocities' import array # noqa: E402, I100 import rosidl_parser.definition # noqa: E402, I100 class Metaclass_JointJog(type): """Metaclass of message 'JointJog'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('control_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'control_msgs.msg.JointJog') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__msg__joint_jog cls._CONVERT_FROM_PY = module.convert_from_py_msg__msg__joint_jog cls._CONVERT_TO_PY = module.convert_to_py_msg__msg__joint_jog cls._TYPE_SUPPORT = module.type_support_msg__msg__joint_jog cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__msg__joint_jog from std_msgs.msg import Header if Header.__class__._TYPE_SUPPORT is None: Header.__class__.__import_type_support__() @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class JointJog(metaclass=Metaclass_JointJog): """Message class 'JointJog'.""" __slots__ = [ '_header', '_joint_names', '_displacements', '_velocities', '_duration', ] _fields_and_field_types = { 'header': 'std_msgs/Header', 'joint_names': 'sequence<string>', 'displacements': 'sequence<double>', 'velocities': 'sequence<double>', 'duration': 'double', } SLOT_TYPES = ( rosidl_parser.definition.NamespacedType(['std_msgs', 'msg'], 'Header'), # noqa: E501 rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.UnboundedString()), # noqa: E501 rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.BasicType('double')), # noqa: E501 rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.BasicType('double')), # noqa: E501 rosidl_parser.definition.BasicType('double'), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) from std_msgs.msg import Header self.header = kwargs.get('header', Header()) self.joint_names = kwargs.get('joint_names', []) self.displacements = array.array('d', kwargs.get('displacements', [])) self.velocities = array.array('d', kwargs.get('velocities', [])) self.duration = kwargs.get('duration', float()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.header != other.header: return False if self.joint_names != other.joint_names: return False if self.displacements != other.displacements: return False if self.velocities != other.velocities: return False if self.duration != other.duration: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def header(self): """Message field 'header'.""" return self._header @header.setter def header(self, value): if __debug__: from std_msgs.msg import Header assert \ isinstance(value, Header), \ "The 'header' field must be a sub message of type 'Header'" self._header = value @property def joint_names(self): """Message field 'joint_names'.""" return self._joint_names @joint_names.setter def joint_names(self, value): if __debug__: from collections.abc import Sequence from collections.abc import Set from collections import UserList from collections import UserString assert \ ((isinstance(value, Sequence) or isinstance(value, Set) or isinstance(value, UserList)) and not isinstance(value, str) and not isinstance(value, UserString) and all(isinstance(v, str) for v in value) and True), \ "The 'joint_names' field must be a set or sequence and each value of type 'str'" self._joint_names = value @property def displacements(self): """Message field 'displacements'.""" return self._displacements @displacements.setter def displacements(self, value): if isinstance(value, array.array): assert value.typecode == 'd', \ "The 'displacements' array.array() must have the type code of 'd'" self._displacements = value return if __debug__: from collections.abc import Sequence from collections.abc import Set from collections import UserList from collections import UserString assert \ ((isinstance(value, Sequence) or isinstance(value, Set) or isinstance(value, UserList)) and not isinstance(value, str) and not isinstance(value, UserString) and all(isinstance(v, float) for v in value) and True), \ "The 'displacements' field must be a set or sequence and each value of type 'float'" self._displacements = array.array('d', value) @property def velocities(self): """Message field 'velocities'.""" return self._velocities @velocities.setter def velocities(self, value): if isinstance(value, array.array): assert value.typecode == 'd', \ "The 'velocities' array.array() must have the type code of 'd'" self._velocities = value return if __debug__: from collections.abc import Sequence from collections.abc import Set from collections import UserList from collections import UserString assert \ ((isinstance(value, Sequence) or isinstance(value, Set) or isinstance(value, UserList)) and not isinstance(value, str) and not isinstance(value, UserString) and all(isinstance(v, float) for v in value) and True), \ "The 'velocities' field must be a set or sequence and each value of type 'float'" self._velocities = array.array('d', value) @property def duration(self): """Message field 'duration'.""" return self._duration @duration.setter def duration(self, value): if __debug__: assert \ isinstance(value, float), \ "The 'duration' field must be of type 'float'" self._duration = value
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/add_on_msgs/__init__.py
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/add_on_msgs/srv/_set_prim_attribute.py
# generated from rosidl_generator_py/resource/_idl.py.em # with input from add_on_msgs:srv/SetPrimAttribute.idl # generated code does not contain a copyright notice # Import statements for member types import rosidl_parser.definition # noqa: E402, I100 class Metaclass_SetPrimAttribute_Request(type): """Metaclass of message 'SetPrimAttribute_Request'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('add_on_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'add_on_msgs.srv.SetPrimAttribute_Request') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__srv__set_prim_attribute__request cls._CONVERT_FROM_PY = module.convert_from_py_msg__srv__set_prim_attribute__request cls._CONVERT_TO_PY = module.convert_to_py_msg__srv__set_prim_attribute__request cls._TYPE_SUPPORT = module.type_support_msg__srv__set_prim_attribute__request cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__srv__set_prim_attribute__request @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class SetPrimAttribute_Request(metaclass=Metaclass_SetPrimAttribute_Request): """Message class 'SetPrimAttribute_Request'.""" __slots__ = [ '_path', '_attribute', '_value', ] _fields_and_field_types = { 'path': 'string', 'attribute': 'string', 'value': 'string', } SLOT_TYPES = ( rosidl_parser.definition.UnboundedString(), # noqa: E501 rosidl_parser.definition.UnboundedString(), # noqa: E501 rosidl_parser.definition.UnboundedString(), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.path = kwargs.get('path', str()) self.attribute = kwargs.get('attribute', str()) self.value = kwargs.get('value', str()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.path != other.path: return False if self.attribute != other.attribute: return False if self.value != other.value: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def path(self): """Message field 'path'.""" return self._path @path.setter def path(self, value): if __debug__: assert \ isinstance(value, str), \ "The 'path' field must be of type 'str'" self._path = value @property def attribute(self): """Message field 'attribute'.""" return self._attribute @attribute.setter def attribute(self, value): if __debug__: assert \ isinstance(value, str), \ "The 'attribute' field must be of type 'str'" self._attribute = value @property def value(self): """Message field 'value'.""" return self._value @value.setter def value(self, value): if __debug__: assert \ isinstance(value, str), \ "The 'value' field must be of type 'str'" self._value = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_SetPrimAttribute_Response(type): """Metaclass of message 'SetPrimAttribute_Response'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('add_on_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'add_on_msgs.srv.SetPrimAttribute_Response') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__srv__set_prim_attribute__response cls._CONVERT_FROM_PY = module.convert_from_py_msg__srv__set_prim_attribute__response cls._CONVERT_TO_PY = module.convert_to_py_msg__srv__set_prim_attribute__response cls._TYPE_SUPPORT = module.type_support_msg__srv__set_prim_attribute__response cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__srv__set_prim_attribute__response @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class SetPrimAttribute_Response(metaclass=Metaclass_SetPrimAttribute_Response): """Message class 'SetPrimAttribute_Response'.""" __slots__ = [ '_success', '_message', ] _fields_and_field_types = { 'success': 'boolean', 'message': 'string', } SLOT_TYPES = ( rosidl_parser.definition.BasicType('boolean'), # noqa: E501 rosidl_parser.definition.UnboundedString(), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.success = kwargs.get('success', bool()) self.message = kwargs.get('message', str()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.success != other.success: return False if self.message != other.message: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def success(self): """Message field 'success'.""" return self._success @success.setter def success(self, value): if __debug__: assert \ isinstance(value, bool), \ "The 'success' field must be of type 'bool'" self._success = value @property def message(self): """Message field 'message'.""" return self._message @message.setter def message(self, value): if __debug__: assert \ isinstance(value, str), \ "The 'message' field must be of type 'str'" self._message = value class Metaclass_SetPrimAttribute(type): """Metaclass of service 'SetPrimAttribute'.""" _TYPE_SUPPORT = None @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('add_on_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'add_on_msgs.srv.SetPrimAttribute') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._TYPE_SUPPORT = module.type_support_srv__srv__set_prim_attribute from add_on_msgs.srv import _set_prim_attribute if _set_prim_attribute.Metaclass_SetPrimAttribute_Request._TYPE_SUPPORT is None: _set_prim_attribute.Metaclass_SetPrimAttribute_Request.__import_type_support__() if _set_prim_attribute.Metaclass_SetPrimAttribute_Response._TYPE_SUPPORT is None: _set_prim_attribute.Metaclass_SetPrimAttribute_Response.__import_type_support__() class SetPrimAttribute(metaclass=Metaclass_SetPrimAttribute): from add_on_msgs.srv._set_prim_attribute import SetPrimAttribute_Request as Request from add_on_msgs.srv._set_prim_attribute import SetPrimAttribute_Response as Response def __init__(self): raise NotImplementedError('Service classes can not be instantiated')
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/add_on_msgs/srv/_get_prim_attributes_s.c
// generated from rosidl_generator_py/resource/_idl_support.c.em // with input from add_on_msgs:srv/GetPrimAttributes.idl // generated code does not contain a copyright notice #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include <Python.h> #include <stdbool.h> #ifndef _WIN32 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-function" #endif #include "numpy/ndarrayobject.h" #ifndef _WIN32 # pragma GCC diagnostic pop #endif #include "rosidl_runtime_c/visibility_control.h" #include "add_on_msgs/srv/detail/get_prim_attributes__struct.h" #include "add_on_msgs/srv/detail/get_prim_attributes__functions.h" #include "rosidl_runtime_c/string.h" #include "rosidl_runtime_c/string_functions.h" ROSIDL_GENERATOR_C_EXPORT bool add_on_msgs__srv__get_prim_attributes__request__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[63]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("add_on_msgs.srv._get_prim_attributes.GetPrimAttributes_Request", full_classname_dest, 62) == 0); } add_on_msgs__srv__GetPrimAttributes_Request * ros_message = _ros_message; { // path PyObject * field = PyObject_GetAttrString(_pymsg, "path"); if (!field) { return false; } assert(PyUnicode_Check(field)); PyObject * encoded_field = PyUnicode_AsUTF8String(field); if (!encoded_field) { Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&ros_message->path, PyBytes_AS_STRING(encoded_field)); Py_DECREF(encoded_field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * add_on_msgs__srv__get_prim_attributes__request__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of GetPrimAttributes_Request */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("add_on_msgs.srv._get_prim_attributes"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "GetPrimAttributes_Request"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } add_on_msgs__srv__GetPrimAttributes_Request * ros_message = (add_on_msgs__srv__GetPrimAttributes_Request *)raw_ros_message; { // path PyObject * field = NULL; field = PyUnicode_DecodeUTF8( ros_message->path.data, strlen(ros_message->path.data), "strict"); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "path", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "add_on_msgs/srv/detail/get_prim_attributes__struct.h" // already included above // #include "add_on_msgs/srv/detail/get_prim_attributes__functions.h" #include "rosidl_runtime_c/primitives_sequence.h" #include "rosidl_runtime_c/primitives_sequence_functions.h" // already included above // #include "rosidl_runtime_c/string.h" // already included above // #include "rosidl_runtime_c/string_functions.h" ROSIDL_GENERATOR_C_EXPORT bool add_on_msgs__srv__get_prim_attributes__response__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[64]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("add_on_msgs.srv._get_prim_attributes.GetPrimAttributes_Response", full_classname_dest, 63) == 0); } add_on_msgs__srv__GetPrimAttributes_Response * ros_message = _ros_message; { // names PyObject * field = PyObject_GetAttrString(_pymsg, "names"); if (!field) { return false; } PyObject * seq_field = PySequence_Fast(field, "expected a sequence in 'names'"); if (!seq_field) { Py_DECREF(field); return false; } Py_ssize_t size = PySequence_Size(field); if (-1 == size) { Py_DECREF(seq_field); Py_DECREF(field); return false; } if (!rosidl_runtime_c__String__Sequence__init(&(ros_message->names), size)) { PyErr_SetString(PyExc_RuntimeError, "unable to create String__Sequence ros_message"); Py_DECREF(seq_field); Py_DECREF(field); return false; } rosidl_runtime_c__String * dest = ros_message->names.data; for (Py_ssize_t i = 0; i < size; ++i) { PyObject * item = PySequence_Fast_GET_ITEM(seq_field, i); if (!item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } assert(PyUnicode_Check(item)); PyObject * encoded_item = PyUnicode_AsUTF8String(item); if (!encoded_item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&dest[i], PyBytes_AS_STRING(encoded_item)); Py_DECREF(encoded_item); } Py_DECREF(seq_field); Py_DECREF(field); } { // displays PyObject * field = PyObject_GetAttrString(_pymsg, "displays"); if (!field) { return false; } PyObject * seq_field = PySequence_Fast(field, "expected a sequence in 'displays'"); if (!seq_field) { Py_DECREF(field); return false; } Py_ssize_t size = PySequence_Size(field); if (-1 == size) { Py_DECREF(seq_field); Py_DECREF(field); return false; } if (!rosidl_runtime_c__String__Sequence__init(&(ros_message->displays), size)) { PyErr_SetString(PyExc_RuntimeError, "unable to create String__Sequence ros_message"); Py_DECREF(seq_field); Py_DECREF(field); return false; } rosidl_runtime_c__String * dest = ros_message->displays.data; for (Py_ssize_t i = 0; i < size; ++i) { PyObject * item = PySequence_Fast_GET_ITEM(seq_field, i); if (!item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } assert(PyUnicode_Check(item)); PyObject * encoded_item = PyUnicode_AsUTF8String(item); if (!encoded_item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&dest[i], PyBytes_AS_STRING(encoded_item)); Py_DECREF(encoded_item); } Py_DECREF(seq_field); Py_DECREF(field); } { // types PyObject * field = PyObject_GetAttrString(_pymsg, "types"); if (!field) { return false; } PyObject * seq_field = PySequence_Fast(field, "expected a sequence in 'types'"); if (!seq_field) { Py_DECREF(field); return false; } Py_ssize_t size = PySequence_Size(field); if (-1 == size) { Py_DECREF(seq_field); Py_DECREF(field); return false; } if (!rosidl_runtime_c__String__Sequence__init(&(ros_message->types), size)) { PyErr_SetString(PyExc_RuntimeError, "unable to create String__Sequence ros_message"); Py_DECREF(seq_field); Py_DECREF(field); return false; } rosidl_runtime_c__String * dest = ros_message->types.data; for (Py_ssize_t i = 0; i < size; ++i) { PyObject * item = PySequence_Fast_GET_ITEM(seq_field, i); if (!item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } assert(PyUnicode_Check(item)); PyObject * encoded_item = PyUnicode_AsUTF8String(item); if (!encoded_item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&dest[i], PyBytes_AS_STRING(encoded_item)); Py_DECREF(encoded_item); } Py_DECREF(seq_field); Py_DECREF(field); } { // success PyObject * field = PyObject_GetAttrString(_pymsg, "success"); if (!field) { return false; } assert(PyBool_Check(field)); ros_message->success = (Py_True == field); Py_DECREF(field); } { // message PyObject * field = PyObject_GetAttrString(_pymsg, "message"); if (!field) { return false; } assert(PyUnicode_Check(field)); PyObject * encoded_field = PyUnicode_AsUTF8String(field); if (!encoded_field) { Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&ros_message->message, PyBytes_AS_STRING(encoded_field)); Py_DECREF(encoded_field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * add_on_msgs__srv__get_prim_attributes__response__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of GetPrimAttributes_Response */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("add_on_msgs.srv._get_prim_attributes"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "GetPrimAttributes_Response"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } add_on_msgs__srv__GetPrimAttributes_Response * ros_message = (add_on_msgs__srv__GetPrimAttributes_Response *)raw_ros_message; { // names PyObject * field = NULL; size_t size = ros_message->names.size; rosidl_runtime_c__String * src = ros_message->names.data; field = PyList_New(size); if (!field) { return NULL; } for (size_t i = 0; i < size; ++i) { PyObject * decoded_item = PyUnicode_DecodeUTF8(src[i].data, strlen(src[i].data), "strict"); if (!decoded_item) { return NULL; } int rc = PyList_SetItem(field, i, decoded_item); (void)rc; assert(rc == 0); } assert(PySequence_Check(field)); { int rc = PyObject_SetAttrString(_pymessage, "names", field); Py_DECREF(field); if (rc) { return NULL; } } } { // displays PyObject * field = NULL; size_t size = ros_message->displays.size; rosidl_runtime_c__String * src = ros_message->displays.data; field = PyList_New(size); if (!field) { return NULL; } for (size_t i = 0; i < size; ++i) { PyObject * decoded_item = PyUnicode_DecodeUTF8(src[i].data, strlen(src[i].data), "strict"); if (!decoded_item) { return NULL; } int rc = PyList_SetItem(field, i, decoded_item); (void)rc; assert(rc == 0); } assert(PySequence_Check(field)); { int rc = PyObject_SetAttrString(_pymessage, "displays", field); Py_DECREF(field); if (rc) { return NULL; } } } { // types PyObject * field = NULL; size_t size = ros_message->types.size; rosidl_runtime_c__String * src = ros_message->types.data; field = PyList_New(size); if (!field) { return NULL; } for (size_t i = 0; i < size; ++i) { PyObject * decoded_item = PyUnicode_DecodeUTF8(src[i].data, strlen(src[i].data), "strict"); if (!decoded_item) { return NULL; } int rc = PyList_SetItem(field, i, decoded_item); (void)rc; assert(rc == 0); } assert(PySequence_Check(field)); { int rc = PyObject_SetAttrString(_pymessage, "types", field); Py_DECREF(field); if (rc) { return NULL; } } } { // success PyObject * field = NULL; field = PyBool_FromLong(ros_message->success ? 1 : 0); { int rc = PyObject_SetAttrString(_pymessage, "success", field); Py_DECREF(field); if (rc) { return NULL; } } } { // message PyObject * field = NULL; field = PyUnicode_DecodeUTF8( ros_message->message.data, strlen(ros_message->message.data), "strict"); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "message", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; }
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/add_on_msgs/srv/_get_prim_attribute_s.c
// generated from rosidl_generator_py/resource/_idl_support.c.em // with input from add_on_msgs:srv/GetPrimAttribute.idl // generated code does not contain a copyright notice #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include <Python.h> #include <stdbool.h> #ifndef _WIN32 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-function" #endif #include "numpy/ndarrayobject.h" #ifndef _WIN32 # pragma GCC diagnostic pop #endif #include "rosidl_runtime_c/visibility_control.h" #include "add_on_msgs/srv/detail/get_prim_attribute__struct.h" #include "add_on_msgs/srv/detail/get_prim_attribute__functions.h" #include "rosidl_runtime_c/string.h" #include "rosidl_runtime_c/string_functions.h" ROSIDL_GENERATOR_C_EXPORT bool add_on_msgs__srv__get_prim_attribute__request__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[61]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("add_on_msgs.srv._get_prim_attribute.GetPrimAttribute_Request", full_classname_dest, 60) == 0); } add_on_msgs__srv__GetPrimAttribute_Request * ros_message = _ros_message; { // path PyObject * field = PyObject_GetAttrString(_pymsg, "path"); if (!field) { return false; } assert(PyUnicode_Check(field)); PyObject * encoded_field = PyUnicode_AsUTF8String(field); if (!encoded_field) { Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&ros_message->path, PyBytes_AS_STRING(encoded_field)); Py_DECREF(encoded_field); Py_DECREF(field); } { // attribute PyObject * field = PyObject_GetAttrString(_pymsg, "attribute"); if (!field) { return false; } assert(PyUnicode_Check(field)); PyObject * encoded_field = PyUnicode_AsUTF8String(field); if (!encoded_field) { Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&ros_message->attribute, PyBytes_AS_STRING(encoded_field)); Py_DECREF(encoded_field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * add_on_msgs__srv__get_prim_attribute__request__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of GetPrimAttribute_Request */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("add_on_msgs.srv._get_prim_attribute"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "GetPrimAttribute_Request"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } add_on_msgs__srv__GetPrimAttribute_Request * ros_message = (add_on_msgs__srv__GetPrimAttribute_Request *)raw_ros_message; { // path PyObject * field = NULL; field = PyUnicode_DecodeUTF8( ros_message->path.data, strlen(ros_message->path.data), "strict"); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "path", field); Py_DECREF(field); if (rc) { return NULL; } } } { // attribute PyObject * field = NULL; field = PyUnicode_DecodeUTF8( ros_message->attribute.data, strlen(ros_message->attribute.data), "strict"); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "attribute", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "add_on_msgs/srv/detail/get_prim_attribute__struct.h" // already included above // #include "add_on_msgs/srv/detail/get_prim_attribute__functions.h" // already included above // #include "rosidl_runtime_c/string.h" // already included above // #include "rosidl_runtime_c/string_functions.h" ROSIDL_GENERATOR_C_EXPORT bool add_on_msgs__srv__get_prim_attribute__response__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[62]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("add_on_msgs.srv._get_prim_attribute.GetPrimAttribute_Response", full_classname_dest, 61) == 0); } add_on_msgs__srv__GetPrimAttribute_Response * ros_message = _ros_message; { // value PyObject * field = PyObject_GetAttrString(_pymsg, "value"); if (!field) { return false; } assert(PyUnicode_Check(field)); PyObject * encoded_field = PyUnicode_AsUTF8String(field); if (!encoded_field) { Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&ros_message->value, PyBytes_AS_STRING(encoded_field)); Py_DECREF(encoded_field); Py_DECREF(field); } { // type PyObject * field = PyObject_GetAttrString(_pymsg, "type"); if (!field) { return false; } assert(PyUnicode_Check(field)); PyObject * encoded_field = PyUnicode_AsUTF8String(field); if (!encoded_field) { Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&ros_message->type, PyBytes_AS_STRING(encoded_field)); Py_DECREF(encoded_field); Py_DECREF(field); } { // success PyObject * field = PyObject_GetAttrString(_pymsg, "success"); if (!field) { return false; } assert(PyBool_Check(field)); ros_message->success = (Py_True == field); Py_DECREF(field); } { // message PyObject * field = PyObject_GetAttrString(_pymsg, "message"); if (!field) { return false; } assert(PyUnicode_Check(field)); PyObject * encoded_field = PyUnicode_AsUTF8String(field); if (!encoded_field) { Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&ros_message->message, PyBytes_AS_STRING(encoded_field)); Py_DECREF(encoded_field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * add_on_msgs__srv__get_prim_attribute__response__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of GetPrimAttribute_Response */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("add_on_msgs.srv._get_prim_attribute"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "GetPrimAttribute_Response"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } add_on_msgs__srv__GetPrimAttribute_Response * ros_message = (add_on_msgs__srv__GetPrimAttribute_Response *)raw_ros_message; { // value PyObject * field = NULL; field = PyUnicode_DecodeUTF8( ros_message->value.data, strlen(ros_message->value.data), "strict"); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "value", field); Py_DECREF(field); if (rc) { return NULL; } } } { // type PyObject * field = NULL; field = PyUnicode_DecodeUTF8( ros_message->type.data, strlen(ros_message->type.data), "strict"); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "type", field); Py_DECREF(field); if (rc) { return NULL; } } } { // success PyObject * field = NULL; field = PyBool_FromLong(ros_message->success ? 1 : 0); { int rc = PyObject_SetAttrString(_pymessage, "success", field); Py_DECREF(field); if (rc) { return NULL; } } } { // message PyObject * field = NULL; field = PyUnicode_DecodeUTF8( ros_message->message.data, strlen(ros_message->message.data), "strict"); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "message", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; }
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/add_on_msgs/srv/_set_prim_attribute_s.c
// generated from rosidl_generator_py/resource/_idl_support.c.em // with input from add_on_msgs:srv/SetPrimAttribute.idl // generated code does not contain a copyright notice #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include <Python.h> #include <stdbool.h> #ifndef _WIN32 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-function" #endif #include "numpy/ndarrayobject.h" #ifndef _WIN32 # pragma GCC diagnostic pop #endif #include "rosidl_runtime_c/visibility_control.h" #include "add_on_msgs/srv/detail/set_prim_attribute__struct.h" #include "add_on_msgs/srv/detail/set_prim_attribute__functions.h" #include "rosidl_runtime_c/string.h" #include "rosidl_runtime_c/string_functions.h" ROSIDL_GENERATOR_C_EXPORT bool add_on_msgs__srv__set_prim_attribute__request__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[61]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("add_on_msgs.srv._set_prim_attribute.SetPrimAttribute_Request", full_classname_dest, 60) == 0); } add_on_msgs__srv__SetPrimAttribute_Request * ros_message = _ros_message; { // path PyObject * field = PyObject_GetAttrString(_pymsg, "path"); if (!field) { return false; } assert(PyUnicode_Check(field)); PyObject * encoded_field = PyUnicode_AsUTF8String(field); if (!encoded_field) { Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&ros_message->path, PyBytes_AS_STRING(encoded_field)); Py_DECREF(encoded_field); Py_DECREF(field); } { // attribute PyObject * field = PyObject_GetAttrString(_pymsg, "attribute"); if (!field) { return false; } assert(PyUnicode_Check(field)); PyObject * encoded_field = PyUnicode_AsUTF8String(field); if (!encoded_field) { Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&ros_message->attribute, PyBytes_AS_STRING(encoded_field)); Py_DECREF(encoded_field); Py_DECREF(field); } { // value PyObject * field = PyObject_GetAttrString(_pymsg, "value"); if (!field) { return false; } assert(PyUnicode_Check(field)); PyObject * encoded_field = PyUnicode_AsUTF8String(field); if (!encoded_field) { Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&ros_message->value, PyBytes_AS_STRING(encoded_field)); Py_DECREF(encoded_field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * add_on_msgs__srv__set_prim_attribute__request__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of SetPrimAttribute_Request */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("add_on_msgs.srv._set_prim_attribute"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "SetPrimAttribute_Request"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } add_on_msgs__srv__SetPrimAttribute_Request * ros_message = (add_on_msgs__srv__SetPrimAttribute_Request *)raw_ros_message; { // path PyObject * field = NULL; field = PyUnicode_DecodeUTF8( ros_message->path.data, strlen(ros_message->path.data), "strict"); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "path", field); Py_DECREF(field); if (rc) { return NULL; } } } { // attribute PyObject * field = NULL; field = PyUnicode_DecodeUTF8( ros_message->attribute.data, strlen(ros_message->attribute.data), "strict"); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "attribute", field); Py_DECREF(field); if (rc) { return NULL; } } } { // value PyObject * field = NULL; field = PyUnicode_DecodeUTF8( ros_message->value.data, strlen(ros_message->value.data), "strict"); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "value", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "add_on_msgs/srv/detail/set_prim_attribute__struct.h" // already included above // #include "add_on_msgs/srv/detail/set_prim_attribute__functions.h" // already included above // #include "rosidl_runtime_c/string.h" // already included above // #include "rosidl_runtime_c/string_functions.h" ROSIDL_GENERATOR_C_EXPORT bool add_on_msgs__srv__set_prim_attribute__response__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[62]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("add_on_msgs.srv._set_prim_attribute.SetPrimAttribute_Response", full_classname_dest, 61) == 0); } add_on_msgs__srv__SetPrimAttribute_Response * ros_message = _ros_message; { // success PyObject * field = PyObject_GetAttrString(_pymsg, "success"); if (!field) { return false; } assert(PyBool_Check(field)); ros_message->success = (Py_True == field); Py_DECREF(field); } { // message PyObject * field = PyObject_GetAttrString(_pymsg, "message"); if (!field) { return false; } assert(PyUnicode_Check(field)); PyObject * encoded_field = PyUnicode_AsUTF8String(field); if (!encoded_field) { Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&ros_message->message, PyBytes_AS_STRING(encoded_field)); Py_DECREF(encoded_field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * add_on_msgs__srv__set_prim_attribute__response__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of SetPrimAttribute_Response */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("add_on_msgs.srv._set_prim_attribute"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "SetPrimAttribute_Response"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } add_on_msgs__srv__SetPrimAttribute_Response * ros_message = (add_on_msgs__srv__SetPrimAttribute_Response *)raw_ros_message; { // success PyObject * field = NULL; field = PyBool_FromLong(ros_message->success ? 1 : 0); { int rc = PyObject_SetAttrString(_pymessage, "success", field); Py_DECREF(field); if (rc) { return NULL; } } } { // message PyObject * field = NULL; field = PyUnicode_DecodeUTF8( ros_message->message.data, strlen(ros_message->message.data), "strict"); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "message", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; }
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/add_on_msgs/srv/__init__.py
from add_on_msgs.srv._get_prim_attribute import GetPrimAttribute # noqa: F401 from add_on_msgs.srv._get_prim_attributes import GetPrimAttributes # noqa: F401 from add_on_msgs.srv._get_prims import GetPrims # noqa: F401 from add_on_msgs.srv._set_prim_attribute import SetPrimAttribute # noqa: F401
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/add_on_msgs/srv/_get_prims.py
# generated from rosidl_generator_py/resource/_idl.py.em # with input from add_on_msgs:srv/GetPrims.idl # generated code does not contain a copyright notice # Import statements for member types import rosidl_parser.definition # noqa: E402, I100 class Metaclass_GetPrims_Request(type): """Metaclass of message 'GetPrims_Request'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('add_on_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'add_on_msgs.srv.GetPrims_Request') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__srv__get_prims__request cls._CONVERT_FROM_PY = module.convert_from_py_msg__srv__get_prims__request cls._CONVERT_TO_PY = module.convert_to_py_msg__srv__get_prims__request cls._TYPE_SUPPORT = module.type_support_msg__srv__get_prims__request cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__srv__get_prims__request @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class GetPrims_Request(metaclass=Metaclass_GetPrims_Request): """Message class 'GetPrims_Request'.""" __slots__ = [ '_path', ] _fields_and_field_types = { 'path': 'string', } SLOT_TYPES = ( rosidl_parser.definition.UnboundedString(), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.path = kwargs.get('path', str()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.path != other.path: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def path(self): """Message field 'path'.""" return self._path @path.setter def path(self, value): if __debug__: assert \ isinstance(value, str), \ "The 'path' field must be of type 'str'" self._path = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_GetPrims_Response(type): """Metaclass of message 'GetPrims_Response'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('add_on_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'add_on_msgs.srv.GetPrims_Response') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__srv__get_prims__response cls._CONVERT_FROM_PY = module.convert_from_py_msg__srv__get_prims__response cls._CONVERT_TO_PY = module.convert_to_py_msg__srv__get_prims__response cls._TYPE_SUPPORT = module.type_support_msg__srv__get_prims__response cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__srv__get_prims__response @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class GetPrims_Response(metaclass=Metaclass_GetPrims_Response): """Message class 'GetPrims_Response'.""" __slots__ = [ '_paths', '_types', '_success', '_message', ] _fields_and_field_types = { 'paths': 'sequence<string>', 'types': 'sequence<string>', 'success': 'boolean', 'message': 'string', } SLOT_TYPES = ( rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.UnboundedString()), # noqa: E501 rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.UnboundedString()), # noqa: E501 rosidl_parser.definition.BasicType('boolean'), # noqa: E501 rosidl_parser.definition.UnboundedString(), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.paths = kwargs.get('paths', []) self.types = kwargs.get('types', []) self.success = kwargs.get('success', bool()) self.message = kwargs.get('message', str()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.paths != other.paths: return False if self.types != other.types: return False if self.success != other.success: return False if self.message != other.message: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def paths(self): """Message field 'paths'.""" return self._paths @paths.setter def paths(self, value): if __debug__: from collections.abc import Sequence from collections.abc import Set from collections import UserList from collections import UserString assert \ ((isinstance(value, Sequence) or isinstance(value, Set) or isinstance(value, UserList)) and not isinstance(value, str) and not isinstance(value, UserString) and all(isinstance(v, str) for v in value) and True), \ "The 'paths' field must be a set or sequence and each value of type 'str'" self._paths = value @property def types(self): """Message field 'types'.""" return self._types @types.setter def types(self, value): if __debug__: from collections.abc import Sequence from collections.abc import Set from collections import UserList from collections import UserString assert \ ((isinstance(value, Sequence) or isinstance(value, Set) or isinstance(value, UserList)) and not isinstance(value, str) and not isinstance(value, UserString) and all(isinstance(v, str) for v in value) and True), \ "The 'types' field must be a set or sequence and each value of type 'str'" self._types = value @property def success(self): """Message field 'success'.""" return self._success @success.setter def success(self, value): if __debug__: assert \ isinstance(value, bool), \ "The 'success' field must be of type 'bool'" self._success = value @property def message(self): """Message field 'message'.""" return self._message @message.setter def message(self, value): if __debug__: assert \ isinstance(value, str), \ "The 'message' field must be of type 'str'" self._message = value class Metaclass_GetPrims(type): """Metaclass of service 'GetPrims'.""" _TYPE_SUPPORT = None @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('add_on_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'add_on_msgs.srv.GetPrims') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._TYPE_SUPPORT = module.type_support_srv__srv__get_prims from add_on_msgs.srv import _get_prims if _get_prims.Metaclass_GetPrims_Request._TYPE_SUPPORT is None: _get_prims.Metaclass_GetPrims_Request.__import_type_support__() if _get_prims.Metaclass_GetPrims_Response._TYPE_SUPPORT is None: _get_prims.Metaclass_GetPrims_Response.__import_type_support__() class GetPrims(metaclass=Metaclass_GetPrims): from add_on_msgs.srv._get_prims import GetPrims_Request as Request from add_on_msgs.srv._get_prims import GetPrims_Response as Response def __init__(self): raise NotImplementedError('Service classes can not be instantiated')
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/add_on_msgs/srv/_get_prim_attribute.py
# generated from rosidl_generator_py/resource/_idl.py.em # with input from add_on_msgs:srv/GetPrimAttribute.idl # generated code does not contain a copyright notice # Import statements for member types import rosidl_parser.definition # noqa: E402, I100 class Metaclass_GetPrimAttribute_Request(type): """Metaclass of message 'GetPrimAttribute_Request'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('add_on_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'add_on_msgs.srv.GetPrimAttribute_Request') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__srv__get_prim_attribute__request cls._CONVERT_FROM_PY = module.convert_from_py_msg__srv__get_prim_attribute__request cls._CONVERT_TO_PY = module.convert_to_py_msg__srv__get_prim_attribute__request cls._TYPE_SUPPORT = module.type_support_msg__srv__get_prim_attribute__request cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__srv__get_prim_attribute__request @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class GetPrimAttribute_Request(metaclass=Metaclass_GetPrimAttribute_Request): """Message class 'GetPrimAttribute_Request'.""" __slots__ = [ '_path', '_attribute', ] _fields_and_field_types = { 'path': 'string', 'attribute': 'string', } SLOT_TYPES = ( rosidl_parser.definition.UnboundedString(), # noqa: E501 rosidl_parser.definition.UnboundedString(), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.path = kwargs.get('path', str()) self.attribute = kwargs.get('attribute', str()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.path != other.path: return False if self.attribute != other.attribute: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def path(self): """Message field 'path'.""" return self._path @path.setter def path(self, value): if __debug__: assert \ isinstance(value, str), \ "The 'path' field must be of type 'str'" self._path = value @property def attribute(self): """Message field 'attribute'.""" return self._attribute @attribute.setter def attribute(self, value): if __debug__: assert \ isinstance(value, str), \ "The 'attribute' field must be of type 'str'" self._attribute = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_GetPrimAttribute_Response(type): """Metaclass of message 'GetPrimAttribute_Response'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('add_on_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'add_on_msgs.srv.GetPrimAttribute_Response') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__srv__get_prim_attribute__response cls._CONVERT_FROM_PY = module.convert_from_py_msg__srv__get_prim_attribute__response cls._CONVERT_TO_PY = module.convert_to_py_msg__srv__get_prim_attribute__response cls._TYPE_SUPPORT = module.type_support_msg__srv__get_prim_attribute__response cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__srv__get_prim_attribute__response @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class GetPrimAttribute_Response(metaclass=Metaclass_GetPrimAttribute_Response): """Message class 'GetPrimAttribute_Response'.""" __slots__ = [ '_value', '_type', '_success', '_message', ] _fields_and_field_types = { 'value': 'string', 'type': 'string', 'success': 'boolean', 'message': 'string', } SLOT_TYPES = ( rosidl_parser.definition.UnboundedString(), # noqa: E501 rosidl_parser.definition.UnboundedString(), # noqa: E501 rosidl_parser.definition.BasicType('boolean'), # noqa: E501 rosidl_parser.definition.UnboundedString(), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.value = kwargs.get('value', str()) self.type = kwargs.get('type', str()) self.success = kwargs.get('success', bool()) self.message = kwargs.get('message', str()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.value != other.value: return False if self.type != other.type: return False if self.success != other.success: return False if self.message != other.message: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def value(self): """Message field 'value'.""" return self._value @value.setter def value(self, value): if __debug__: assert \ isinstance(value, str), \ "The 'value' field must be of type 'str'" self._value = value @property # noqa: A003 def type(self): # noqa: A003 """Message field 'type'.""" return self._type @type.setter # noqa: A003 def type(self, value): # noqa: A003 if __debug__: assert \ isinstance(value, str), \ "The 'type' field must be of type 'str'" self._type = value @property def success(self): """Message field 'success'.""" return self._success @success.setter def success(self, value): if __debug__: assert \ isinstance(value, bool), \ "The 'success' field must be of type 'bool'" self._success = value @property def message(self): """Message field 'message'.""" return self._message @message.setter def message(self, value): if __debug__: assert \ isinstance(value, str), \ "The 'message' field must be of type 'str'" self._message = value class Metaclass_GetPrimAttribute(type): """Metaclass of service 'GetPrimAttribute'.""" _TYPE_SUPPORT = None @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('add_on_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'add_on_msgs.srv.GetPrimAttribute') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._TYPE_SUPPORT = module.type_support_srv__srv__get_prim_attribute from add_on_msgs.srv import _get_prim_attribute if _get_prim_attribute.Metaclass_GetPrimAttribute_Request._TYPE_SUPPORT is None: _get_prim_attribute.Metaclass_GetPrimAttribute_Request.__import_type_support__() if _get_prim_attribute.Metaclass_GetPrimAttribute_Response._TYPE_SUPPORT is None: _get_prim_attribute.Metaclass_GetPrimAttribute_Response.__import_type_support__() class GetPrimAttribute(metaclass=Metaclass_GetPrimAttribute): from add_on_msgs.srv._get_prim_attribute import GetPrimAttribute_Request as Request from add_on_msgs.srv._get_prim_attribute import GetPrimAttribute_Response as Response def __init__(self): raise NotImplementedError('Service classes can not be instantiated')
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/add_on_msgs/srv/_get_prim_attributes.py
# generated from rosidl_generator_py/resource/_idl.py.em # with input from add_on_msgs:srv/GetPrimAttributes.idl # generated code does not contain a copyright notice # Import statements for member types import rosidl_parser.definition # noqa: E402, I100 class Metaclass_GetPrimAttributes_Request(type): """Metaclass of message 'GetPrimAttributes_Request'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('add_on_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'add_on_msgs.srv.GetPrimAttributes_Request') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__srv__get_prim_attributes__request cls._CONVERT_FROM_PY = module.convert_from_py_msg__srv__get_prim_attributes__request cls._CONVERT_TO_PY = module.convert_to_py_msg__srv__get_prim_attributes__request cls._TYPE_SUPPORT = module.type_support_msg__srv__get_prim_attributes__request cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__srv__get_prim_attributes__request @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class GetPrimAttributes_Request(metaclass=Metaclass_GetPrimAttributes_Request): """Message class 'GetPrimAttributes_Request'.""" __slots__ = [ '_path', ] _fields_and_field_types = { 'path': 'string', } SLOT_TYPES = ( rosidl_parser.definition.UnboundedString(), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.path = kwargs.get('path', str()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.path != other.path: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def path(self): """Message field 'path'.""" return self._path @path.setter def path(self, value): if __debug__: assert \ isinstance(value, str), \ "The 'path' field must be of type 'str'" self._path = value # Import statements for member types # already imported above # import rosidl_parser.definition class Metaclass_GetPrimAttributes_Response(type): """Metaclass of message 'GetPrimAttributes_Response'.""" _CREATE_ROS_MESSAGE = None _CONVERT_FROM_PY = None _CONVERT_TO_PY = None _DESTROY_ROS_MESSAGE = None _TYPE_SUPPORT = None __constants = { } @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('add_on_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'add_on_msgs.srv.GetPrimAttributes_Response') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._CREATE_ROS_MESSAGE = module.create_ros_message_msg__srv__get_prim_attributes__response cls._CONVERT_FROM_PY = module.convert_from_py_msg__srv__get_prim_attributes__response cls._CONVERT_TO_PY = module.convert_to_py_msg__srv__get_prim_attributes__response cls._TYPE_SUPPORT = module.type_support_msg__srv__get_prim_attributes__response cls._DESTROY_ROS_MESSAGE = module.destroy_ros_message_msg__srv__get_prim_attributes__response @classmethod def __prepare__(cls, name, bases, **kwargs): # list constant names here so that they appear in the help text of # the message class under "Data and other attributes defined here:" # as well as populate each message instance return { } class GetPrimAttributes_Response(metaclass=Metaclass_GetPrimAttributes_Response): """Message class 'GetPrimAttributes_Response'.""" __slots__ = [ '_names', '_displays', '_types', '_success', '_message', ] _fields_and_field_types = { 'names': 'sequence<string>', 'displays': 'sequence<string>', 'types': 'sequence<string>', 'success': 'boolean', 'message': 'string', } SLOT_TYPES = ( rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.UnboundedString()), # noqa: E501 rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.UnboundedString()), # noqa: E501 rosidl_parser.definition.UnboundedSequence(rosidl_parser.definition.UnboundedString()), # noqa: E501 rosidl_parser.definition.BasicType('boolean'), # noqa: E501 rosidl_parser.definition.UnboundedString(), # noqa: E501 ) def __init__(self, **kwargs): assert all('_' + key in self.__slots__ for key in kwargs.keys()), \ 'Invalid arguments passed to constructor: %s' % \ ', '.join(sorted(k for k in kwargs.keys() if '_' + k not in self.__slots__)) self.names = kwargs.get('names', []) self.displays = kwargs.get('displays', []) self.types = kwargs.get('types', []) self.success = kwargs.get('success', bool()) self.message = kwargs.get('message', str()) def __repr__(self): typename = self.__class__.__module__.split('.') typename.pop() typename.append(self.__class__.__name__) args = [] for s, t in zip(self.__slots__, self.SLOT_TYPES): field = getattr(self, s) fieldstr = repr(field) # We use Python array type for fields that can be directly stored # in them, and "normal" sequences for everything else. If it is # a type that we store in an array, strip off the 'array' portion. if ( isinstance(t, rosidl_parser.definition.AbstractSequence) and isinstance(t.value_type, rosidl_parser.definition.BasicType) and t.value_type.typename in ['float', 'double', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', 'uint64'] ): if len(field) == 0: fieldstr = '[]' else: assert fieldstr.startswith('array(') prefix = "array('X', " suffix = ')' fieldstr = fieldstr[len(prefix):-len(suffix)] args.append(s[1:] + '=' + fieldstr) return '%s(%s)' % ('.'.join(typename), ', '.join(args)) def __eq__(self, other): if not isinstance(other, self.__class__): return False if self.names != other.names: return False if self.displays != other.displays: return False if self.types != other.types: return False if self.success != other.success: return False if self.message != other.message: return False return True @classmethod def get_fields_and_field_types(cls): from copy import copy return copy(cls._fields_and_field_types) @property def names(self): """Message field 'names'.""" return self._names @names.setter def names(self, value): if __debug__: from collections.abc import Sequence from collections.abc import Set from collections import UserList from collections import UserString assert \ ((isinstance(value, Sequence) or isinstance(value, Set) or isinstance(value, UserList)) and not isinstance(value, str) and not isinstance(value, UserString) and all(isinstance(v, str) for v in value) and True), \ "The 'names' field must be a set or sequence and each value of type 'str'" self._names = value @property def displays(self): """Message field 'displays'.""" return self._displays @displays.setter def displays(self, value): if __debug__: from collections.abc import Sequence from collections.abc import Set from collections import UserList from collections import UserString assert \ ((isinstance(value, Sequence) or isinstance(value, Set) or isinstance(value, UserList)) and not isinstance(value, str) and not isinstance(value, UserString) and all(isinstance(v, str) for v in value) and True), \ "The 'displays' field must be a set or sequence and each value of type 'str'" self._displays = value @property def types(self): """Message field 'types'.""" return self._types @types.setter def types(self, value): if __debug__: from collections.abc import Sequence from collections.abc import Set from collections import UserList from collections import UserString assert \ ((isinstance(value, Sequence) or isinstance(value, Set) or isinstance(value, UserList)) and not isinstance(value, str) and not isinstance(value, UserString) and all(isinstance(v, str) for v in value) and True), \ "The 'types' field must be a set or sequence and each value of type 'str'" self._types = value @property def success(self): """Message field 'success'.""" return self._success @success.setter def success(self, value): if __debug__: assert \ isinstance(value, bool), \ "The 'success' field must be of type 'bool'" self._success = value @property def message(self): """Message field 'message'.""" return self._message @message.setter def message(self, value): if __debug__: assert \ isinstance(value, str), \ "The 'message' field must be of type 'str'" self._message = value class Metaclass_GetPrimAttributes(type): """Metaclass of service 'GetPrimAttributes'.""" _TYPE_SUPPORT = None @classmethod def __import_type_support__(cls): try: from rosidl_generator_py import import_type_support module = import_type_support('add_on_msgs') except ImportError: import logging import traceback logger = logging.getLogger( 'add_on_msgs.srv.GetPrimAttributes') logger.debug( 'Failed to import needed modules for type support:\n' + traceback.format_exc()) else: cls._TYPE_SUPPORT = module.type_support_srv__srv__get_prim_attributes from add_on_msgs.srv import _get_prim_attributes if _get_prim_attributes.Metaclass_GetPrimAttributes_Request._TYPE_SUPPORT is None: _get_prim_attributes.Metaclass_GetPrimAttributes_Request.__import_type_support__() if _get_prim_attributes.Metaclass_GetPrimAttributes_Response._TYPE_SUPPORT is None: _get_prim_attributes.Metaclass_GetPrimAttributes_Response.__import_type_support__() class GetPrimAttributes(metaclass=Metaclass_GetPrimAttributes): from add_on_msgs.srv._get_prim_attributes import GetPrimAttributes_Request as Request from add_on_msgs.srv._get_prim_attributes import GetPrimAttributes_Response as Response def __init__(self): raise NotImplementedError('Service classes can not be instantiated')
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/packages/add_on_msgs/srv/_get_prims_s.c
// generated from rosidl_generator_py/resource/_idl_support.c.em // with input from add_on_msgs:srv/GetPrims.idl // generated code does not contain a copyright notice #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include <Python.h> #include <stdbool.h> #ifndef _WIN32 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-function" #endif #include "numpy/ndarrayobject.h" #ifndef _WIN32 # pragma GCC diagnostic pop #endif #include "rosidl_runtime_c/visibility_control.h" #include "add_on_msgs/srv/detail/get_prims__struct.h" #include "add_on_msgs/srv/detail/get_prims__functions.h" #include "rosidl_runtime_c/string.h" #include "rosidl_runtime_c/string_functions.h" ROSIDL_GENERATOR_C_EXPORT bool add_on_msgs__srv__get_prims__request__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[44]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("add_on_msgs.srv._get_prims.GetPrims_Request", full_classname_dest, 43) == 0); } add_on_msgs__srv__GetPrims_Request * ros_message = _ros_message; { // path PyObject * field = PyObject_GetAttrString(_pymsg, "path"); if (!field) { return false; } assert(PyUnicode_Check(field)); PyObject * encoded_field = PyUnicode_AsUTF8String(field); if (!encoded_field) { Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&ros_message->path, PyBytes_AS_STRING(encoded_field)); Py_DECREF(encoded_field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * add_on_msgs__srv__get_prims__request__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of GetPrims_Request */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("add_on_msgs.srv._get_prims"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "GetPrims_Request"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } add_on_msgs__srv__GetPrims_Request * ros_message = (add_on_msgs__srv__GetPrims_Request *)raw_ros_message; { // path PyObject * field = NULL; field = PyUnicode_DecodeUTF8( ros_message->path.data, strlen(ros_message->path.data), "strict"); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "path", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; } #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION // already included above // #include <Python.h> // already included above // #include <stdbool.h> // already included above // #include "numpy/ndarrayobject.h" // already included above // #include "rosidl_runtime_c/visibility_control.h" // already included above // #include "add_on_msgs/srv/detail/get_prims__struct.h" // already included above // #include "add_on_msgs/srv/detail/get_prims__functions.h" #include "rosidl_runtime_c/primitives_sequence.h" #include "rosidl_runtime_c/primitives_sequence_functions.h" // already included above // #include "rosidl_runtime_c/string.h" // already included above // #include "rosidl_runtime_c/string_functions.h" ROSIDL_GENERATOR_C_EXPORT bool add_on_msgs__srv__get_prims__response__convert_from_py(PyObject * _pymsg, void * _ros_message) { // check that the passed message is of the expected Python class { char full_classname_dest[45]; { char * class_name = NULL; char * module_name = NULL; { PyObject * class_attr = PyObject_GetAttrString(_pymsg, "__class__"); if (class_attr) { PyObject * name_attr = PyObject_GetAttrString(class_attr, "__name__"); if (name_attr) { class_name = (char *)PyUnicode_1BYTE_DATA(name_attr); Py_DECREF(name_attr); } PyObject * module_attr = PyObject_GetAttrString(class_attr, "__module__"); if (module_attr) { module_name = (char *)PyUnicode_1BYTE_DATA(module_attr); Py_DECREF(module_attr); } Py_DECREF(class_attr); } } if (!class_name || !module_name) { return false; } snprintf(full_classname_dest, sizeof(full_classname_dest), "%s.%s", module_name, class_name); } assert(strncmp("add_on_msgs.srv._get_prims.GetPrims_Response", full_classname_dest, 44) == 0); } add_on_msgs__srv__GetPrims_Response * ros_message = _ros_message; { // paths PyObject * field = PyObject_GetAttrString(_pymsg, "paths"); if (!field) { return false; } PyObject * seq_field = PySequence_Fast(field, "expected a sequence in 'paths'"); if (!seq_field) { Py_DECREF(field); return false; } Py_ssize_t size = PySequence_Size(field); if (-1 == size) { Py_DECREF(seq_field); Py_DECREF(field); return false; } if (!rosidl_runtime_c__String__Sequence__init(&(ros_message->paths), size)) { PyErr_SetString(PyExc_RuntimeError, "unable to create String__Sequence ros_message"); Py_DECREF(seq_field); Py_DECREF(field); return false; } rosidl_runtime_c__String * dest = ros_message->paths.data; for (Py_ssize_t i = 0; i < size; ++i) { PyObject * item = PySequence_Fast_GET_ITEM(seq_field, i); if (!item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } assert(PyUnicode_Check(item)); PyObject * encoded_item = PyUnicode_AsUTF8String(item); if (!encoded_item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&dest[i], PyBytes_AS_STRING(encoded_item)); Py_DECREF(encoded_item); } Py_DECREF(seq_field); Py_DECREF(field); } { // types PyObject * field = PyObject_GetAttrString(_pymsg, "types"); if (!field) { return false; } PyObject * seq_field = PySequence_Fast(field, "expected a sequence in 'types'"); if (!seq_field) { Py_DECREF(field); return false; } Py_ssize_t size = PySequence_Size(field); if (-1 == size) { Py_DECREF(seq_field); Py_DECREF(field); return false; } if (!rosidl_runtime_c__String__Sequence__init(&(ros_message->types), size)) { PyErr_SetString(PyExc_RuntimeError, "unable to create String__Sequence ros_message"); Py_DECREF(seq_field); Py_DECREF(field); return false; } rosidl_runtime_c__String * dest = ros_message->types.data; for (Py_ssize_t i = 0; i < size; ++i) { PyObject * item = PySequence_Fast_GET_ITEM(seq_field, i); if (!item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } assert(PyUnicode_Check(item)); PyObject * encoded_item = PyUnicode_AsUTF8String(item); if (!encoded_item) { Py_DECREF(seq_field); Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&dest[i], PyBytes_AS_STRING(encoded_item)); Py_DECREF(encoded_item); } Py_DECREF(seq_field); Py_DECREF(field); } { // success PyObject * field = PyObject_GetAttrString(_pymsg, "success"); if (!field) { return false; } assert(PyBool_Check(field)); ros_message->success = (Py_True == field); Py_DECREF(field); } { // message PyObject * field = PyObject_GetAttrString(_pymsg, "message"); if (!field) { return false; } assert(PyUnicode_Check(field)); PyObject * encoded_field = PyUnicode_AsUTF8String(field); if (!encoded_field) { Py_DECREF(field); return false; } rosidl_runtime_c__String__assign(&ros_message->message, PyBytes_AS_STRING(encoded_field)); Py_DECREF(encoded_field); Py_DECREF(field); } return true; } ROSIDL_GENERATOR_C_EXPORT PyObject * add_on_msgs__srv__get_prims__response__convert_to_py(void * raw_ros_message) { /* NOTE(esteve): Call constructor of GetPrims_Response */ PyObject * _pymessage = NULL; { PyObject * pymessage_module = PyImport_ImportModule("add_on_msgs.srv._get_prims"); assert(pymessage_module); PyObject * pymessage_class = PyObject_GetAttrString(pymessage_module, "GetPrims_Response"); assert(pymessage_class); Py_DECREF(pymessage_module); _pymessage = PyObject_CallObject(pymessage_class, NULL); Py_DECREF(pymessage_class); if (!_pymessage) { return NULL; } } add_on_msgs__srv__GetPrims_Response * ros_message = (add_on_msgs__srv__GetPrims_Response *)raw_ros_message; { // paths PyObject * field = NULL; size_t size = ros_message->paths.size; rosidl_runtime_c__String * src = ros_message->paths.data; field = PyList_New(size); if (!field) { return NULL; } for (size_t i = 0; i < size; ++i) { PyObject * decoded_item = PyUnicode_DecodeUTF8(src[i].data, strlen(src[i].data), "strict"); if (!decoded_item) { return NULL; } int rc = PyList_SetItem(field, i, decoded_item); (void)rc; assert(rc == 0); } assert(PySequence_Check(field)); { int rc = PyObject_SetAttrString(_pymessage, "paths", field); Py_DECREF(field); if (rc) { return NULL; } } } { // types PyObject * field = NULL; size_t size = ros_message->types.size; rosidl_runtime_c__String * src = ros_message->types.data; field = PyList_New(size); if (!field) { return NULL; } for (size_t i = 0; i < size; ++i) { PyObject * decoded_item = PyUnicode_DecodeUTF8(src[i].data, strlen(src[i].data), "strict"); if (!decoded_item) { return NULL; } int rc = PyList_SetItem(field, i, decoded_item); (void)rc; assert(rc == 0); } assert(PySequence_Check(field)); { int rc = PyObject_SetAttrString(_pymessage, "types", field); Py_DECREF(field); if (rc) { return NULL; } } } { // success PyObject * field = NULL; field = PyBool_FromLong(ros_message->success ? 1 : 0); { int rc = PyObject_SetAttrString(_pymessage, "success", field); Py_DECREF(field); if (rc) { return NULL; } } } { // message PyObject * field = NULL; field = PyUnicode_DecodeUTF8( ros_message->message.data, strlen(ros_message->message.data), "strict"); if (!field) { return NULL; } { int rc = PyObject_SetAttrString(_pymessage, "message", field); Py_DECREF(field); if (rc) { return NULL; } } } // ownership of _pymessage is transferred to the caller return _pymessage; }
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/tests/test_ros2_bridge.py
try: import omni.kit.test TestCase = omni.kit.test.AsyncTestCaseFailOnLogError except: class TestCase: pass import json import rclpy from rclpy.node import Node from rclpy.duration import Duration from rclpy.action import ActionClient from action_msgs.msg import GoalStatus from trajectory_msgs.msg import JointTrajectoryPoint from control_msgs.action import FollowJointTrajectory from control_msgs.action import GripperCommand import add_on_msgs.srv # Having a test class dervived from omni.kit.test.AsyncTestCase declared on the root of module will make it auto-discoverable by omni.kit.test class TestROS2Bridge(TestCase): # Before running each test async def setUp(self): pass # After running each test async def tearDown(self): pass # Actual test, notice it is "async" function, so "await" can be used if needed async def test_ros2_bridge(self): pass class TestROS2BridgeNode(Node): def __init__(self): super().__init__('test_ros2_bridge') self.get_attribute_service_name = '/get_attribute' self.set_attribute_service_name = '/set_attribute' self.gripper_command_action_name = "/panda_hand_controller/gripper_command" self.follow_joint_trajectory_action_name = "/panda_arm_controller/follow_joint_trajectory" self.get_attribute_client = self.create_client(add_on_msgs.srv.GetPrimAttribute, self.get_attribute_service_name) self.set_attribute_client = self.create_client(add_on_msgs.srv.SetPrimAttribute, self.set_attribute_service_name) self.gripper_command_client = ActionClient(self, GripperCommand, self.gripper_command_action_name) self.follow_joint_trajectory_client = ActionClient(self, FollowJointTrajectory, self.follow_joint_trajectory_action_name) self.follow_joint_trajectory_goal_msg = FollowJointTrajectory.Goal() self.follow_joint_trajectory_goal_msg.path_tolerance = [] self.follow_joint_trajectory_goal_msg.goal_tolerance = [] self.follow_joint_trajectory_goal_msg.goal_time_tolerance = Duration().to_msg() self.follow_joint_trajectory_goal_msg.trajectory.header.frame_id = "panda_link0" self.follow_joint_trajectory_goal_msg.trajectory.joint_names = ["panda_joint1", "panda_joint2", "panda_joint3", "panda_joint4", "panda_joint5", "panda_joint6", "panda_joint7"] self.follow_joint_trajectory_goal_msg.trajectory.points = [ JointTrajectoryPoint(positions=[0.012, -0.5689, 0.0, -2.8123, 0.0, 3.0367, 0.741], time_from_start=Duration(seconds=0, nanoseconds=0).to_msg()), JointTrajectoryPoint(positions=[0.011073551914608105, -0.5251352171920526, 6.967729509163362e-06, -2.698296723677182, 7.613460540484924e-06, 2.93314462685839, 0.6840062390114862], time_from_start=Duration(seconds=0, nanoseconds= 524152995).to_msg()), JointTrajectoryPoint(positions=[0.010147103829216212, -0.48137043438410526, 1.3935459018326723e-05, -2.5842934473543644, 1.5226921080969849e-05, 2.82958925371678, 0.6270124780229722], time_from_start=Duration(seconds=1, nanoseconds= 48305989).to_msg()), JointTrajectoryPoint(positions=[0.009220655743824318, -0.43760565157615794, 2.0903188527490087e-05, -2.4702901710315466, 2.2840381621454772e-05, 2.72603388057517, 0.5700187170344584], time_from_start=Duration(seconds=1, nanoseconds= 572458984).to_msg()), JointTrajectoryPoint(positions=[0.008294207658432425, -0.39384086876821056, 2.7870918036653447e-05, -2.3562868947087283, 3.0453842161939697e-05, 2.6224785074335597, 0.5130249560459446], time_from_start=Duration(seconds=2, nanoseconds= 96611978).to_msg()), JointTrajectoryPoint(positions=[0.00736775957304053, -0.3500760859602632, 3.483864754581681e-05, -2.2422836183859105, 3.806730270242462e-05, 2.518923134291949, 0.45603119505743067], time_from_start=Duration(seconds=2, nanoseconds= 620764973).to_msg()), JointTrajectoryPoint(positions=[0.006441311487648636, -0.30631130315231586, 4.1806377054980174e-05, -2.1282803420630927, 4.5680763242909544e-05, 2.415367761150339, 0.3990374340689168], time_from_start=Duration(seconds=3, nanoseconds= 144917968).to_msg()), JointTrajectoryPoint(positions=[0.005514863402256743, -0.2625465203443685, 4.877410656414353e-05, -2.014277065740275, 5.3294223783394466e-05, 2.311812388008729, 0.34204367308040295], time_from_start=Duration(seconds=3, nanoseconds= 669070962).to_msg()), JointTrajectoryPoint(positions=[0.004588415316864848, -0.2187817375364211, 5.5741836073306894e-05, -1.900273789417457, 6.0907684323879394e-05, 2.208257014867119, 0.28504991209188907], time_from_start=Duration(seconds=4, nanoseconds= 193223957).to_msg()), ] self.gripper_command_open_goal_msg = GripperCommand.Goal() self.gripper_command_open_goal_msg.command.position = 0.03990753115697298 self.gripper_command_open_goal_msg.command.max_effort = 0.0 self.gripper_command_close_goal_msg = GripperCommand.Goal() self.gripper_command_close_goal_msg.command.position = 8.962388141080737e-05 self.gripper_command_close_goal_msg.command.max_effort = 0.0 if __name__ == '__main__': rclpy.init() node = TestROS2BridgeNode() # ==== Gripper Command ==== assert node.gripper_command_client.wait_for_server(timeout_sec=1.0), \ "Action server {} not available".format(node.gripper_command_action_name) # close gripper command (with obstacle) future = node.gripper_command_client.send_goal_async(node.gripper_command_close_goal_msg) rclpy.spin_until_future_complete(node, future, timeout_sec=5.0) future = future.result().get_result_async() rclpy.spin_until_future_complete(node, future, timeout_sec=5.0) result = future.result() assert result.status == GoalStatus.STATUS_SUCCEEDED assert result.result.stalled is True assert result.result.reached_goal is False assert abs(result.result.position - 0.0295) < 1e-3 # open gripper command future = node.gripper_command_client.send_goal_async(node.gripper_command_open_goal_msg) rclpy.spin_until_future_complete(node, future, timeout_sec=5.0) future = future.result().get_result_async() rclpy.spin_until_future_complete(node, future, timeout_sec=5.0) result = future.result() assert result.status == GoalStatus.STATUS_SUCCEEDED assert result.result.stalled is False assert result.result.reached_goal is True assert abs(result.result.position - 0.0389) < 1e-3 # ==== Attribute ==== assert node.get_attribute_client.wait_for_service(timeout_sec=5.0), \ "Service {} not available".format(node.get_attribute_service_name) assert node.set_attribute_client.wait_for_service(timeout_sec=5.0), \ "Service {} not available".format(node.set_attribute_service_name) request_get_attribute = add_on_msgs.srv.GetPrimAttribute.Request() request_get_attribute.path = "/Cylinder" request_get_attribute.attribute = "physics:collisionEnabled" request_set_attribute = add_on_msgs.srv.SetPrimAttribute.Request() request_set_attribute.path = request_get_attribute.path request_set_attribute.attribute = request_get_attribute.attribute request_set_attribute.value = json.dumps(False) # get obstacle collisionEnabled attribute future = node.get_attribute_client.call_async(request_get_attribute) rclpy.spin_until_future_complete(node, future, timeout_sec=5.0) result = future.result() assert result.success is True assert json.loads(result.value) is True # disable obstacle collision shape future = node.set_attribute_client.call_async(request_set_attribute) rclpy.spin_until_future_complete(node, future, timeout_sec=5.0) result = future.result() assert result.success is True # get obstacle collisionEnabled attribute future = node.get_attribute_client.call_async(request_get_attribute) rclpy.spin_until_future_complete(node, future, timeout_sec=5.0) result = future.result() assert result.success is True assert json.loads(result.value) is False # ==== Gripper Command ==== assert node.gripper_command_client.wait_for_server(timeout_sec=1.0), \ "Action server {} not available".format(node.gripper_command_action_name) # close gripper command (without obstacle) future = node.gripper_command_client.send_goal_async(node.gripper_command_close_goal_msg) rclpy.spin_until_future_complete(node, future, timeout_sec=5.0) future = future.result().get_result_async() rclpy.spin_until_future_complete(node, future, timeout_sec=5.0) result = future.result() assert result.status == GoalStatus.STATUS_SUCCEEDED assert result.result.stalled is False assert result.result.reached_goal is True assert abs(result.result.position - 0.0) < 1e-3 # ==== Follow Joint Trajectory ==== assert node.follow_joint_trajectory_client.wait_for_server(timeout_sec=1.0), \ "Action server {} not available".format(node.follow_joint_trajectory_action_name) # move to goal future = node.follow_joint_trajectory_client.send_goal_async(node.follow_joint_trajectory_goal_msg) rclpy.spin_until_future_complete(node, future, timeout_sec=5.0) future = future.result().get_result_async() rclpy.spin_until_future_complete(node, future, timeout_sec=10.0) result = future.result() assert result.status == GoalStatus.STATUS_SUCCEEDED assert result.result.error_code == result.result.SUCCESSFUL print("Test passed")
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/semu/robotics/ros2_bridge/tests/__init__.py
from .test_ros2_bridge import *
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/config/extension.toml
[core] reloadable = true order = 0 [package] version = "0.1.1" category = "Simulation" feature = false app = false title = "ROS2 Bridge (semu namespace)" description = "ROS2 interfaces (semu namespace)" authors = ["Toni-SM"] repository = "https://github.com/Toni-SM/semu.robotics.ros2_bridge" keywords = ["ROS2", "control"] changelog = "docs/CHANGELOG.md" readme = "docs/README.md" preview_image = "data/preview.png" icon = "data/icon.png" [package.target] config = ["release"] platform = ["linux-x86_64"] python = ["py37", "cp37"] [dependencies] "omni.kit.uiapp" = {} "omni.isaac.dynamic_control" = {} "omni.isaac.ros2_bridge" = {} "semu.usd.schemas" = {} "semu.robotics.ros_bridge_ui" = {} [[python.module]] name = "semu.robotics.ros2_bridge" [[python.module]] name = "semu.robotics.ros2_bridge.tests" [settings] exts."semu.robotics.ros2_bridge".nodeName = "SemuRos2Bridge" exts."semu.robotics.ros2_bridge".eventTimeout = 5.0 exts."semu.robotics.ros2_bridge".setAttributeUsingAsyncio = false [[native.library]] path = "bin/libadd_on_msgs__python.so" [[native.library]] path = "bin/libadd_on_msgs__rosidl_generator_c.so" [[native.library]] path = "bin/libadd_on_msgs__rosidl_typesupport_c.so" [[native.library]] path = "bin/libadd_on_msgs__rosidl_typesupport_fastrtps_c.so" [[native.library]] path = "bin/libadd_on_msgs__rosidl_typesupport_introspection_c.so" [[native.library]] path = "bin/libcontrol_msgs__rosidl_generator_c.so" [[native.library]] path = "bin/libcontrol_msgs__python.so" [[native.library]] path = "bin/libcontrol_msgs__rosidl_typesupport_c.so" [[native.library]] path = "bin/libcontrol_msgs__rosidl_typesupport_fastrtps_c.so" [[native.library]] path = "bin/libcontrol_msgs__rosidl_typesupport_introspection_c.so"
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/docs/CHANGELOG.md
# Changelog The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [0.1.1] - 2022-05-28 ### Changed - Rename the extension to `semu.robotics.ros2_bridge` ## [0.1.0] - 2022-04-12 ### Added - Source code (src folder) - FollowJointTrajectory action server (contribution with [@09ubberboy90](https://github.com/09ubberboy90)) - GripperCommand action server ### Changed - Improve the extension implementation ## [0.0.1] - 2021-12-18 ### Added - Attribute service - Create extension based on omni.add_on.ros_bridge
Toni-SM/semu.robotics.ros2_bridge/exts/semu.robotics.ros2_bridge/docs/README.md
# semu.robotics.ros2_bridge This extension enables the ROS2 action server interfaces for controlling robots (particularly those used by MoveIt to talk to robot controllers: FollowJointTrajectory and GripperCommand) and enables services for agile prototyping of robotic applications in ROS2 Visit https://github.com/Toni-SM/semu.robotics.ros2_bridge to read more about its use
Toni-SM/semu.misc.vscode/README.md
## Embedded VS Code for NVIDIA Omniverse > This extension can be described as the [VS Code](https://code.visualstudio.com/) version of Omniverse's [Script Editor](https://docs.omniverse.nvidia.com/prod_extensions/prod_extensions/ext_script-editor.html). It allows to execute Python code, embedded in the current NVIDIA Omniverse application scope, from the VS Code editor and displays the results in the OUTPUT panel (under *Embedded VS Code for NVIDIA Omniverse*) of the VS Code editor <br> **Target applications:** Any NVIDIA Omniverse app **Supported OS:** Windows and Linux **Changelog:** [CHANGELOG.md](exts/semu.misc.vscode/docs/CHANGELOG.md) **Table of Contents:** - [Requirements](#requirements) - [Extension setup](#setup) - [Extension usage](#usage) - [VS Code interface](#interface) - [Configuring the extension](#config) - [Limitations](#limitations) - [Contributing](#contributing) <br> ![showcase](exts/semu.misc.vscode/data/preview.png) <hr> <a name="requirements"></a> ### Requirements This extension requires its VS Code pair extension [Embedded VS Code for NVIDIA Omniverse](https://marketplace.visualstudio.com/items?itemName=Toni-SM.embedded-vscode-for-nvidia-omniverse) to be installed and enabled in the VS Code editor instance to be able to execute code in the current NVIDIA Omniverse application scope <br> ![vscode_ext](exts/semu.misc.vscode/data/vscode_ext.png) <hr> <a name="setup"></a> ### Extension setup 1. Add the extension using the [Extension Manager](https://docs.omniverse.nvidia.com/prod_extensions/prod_extensions/ext_extension-manager.html) or by following the steps in [Extension Search Paths](https://docs.omniverse.nvidia.com/py/kit/docs/guide/extensions.html#extension-search-paths) * Git url (git+https) as extension search path :warning: *There seems to be a bug when installing extensions using the git url (git+https) as extension search path in Isaac Sim 2022.1.0. In this case, it is recommended to install the extension by importing the .zip file* ``` git+https://github.com/Toni-SM/semu.misc.vscode.git?branch=main&dir=exts ``` * Compressed (.zip) file for import [semu.misc.vscode.zip](https://github.com/Toni-SM/semu.misc.vscode/releases) 2. Enable the extension using the [Extension Manager](https://docs.omniverse.nvidia.com/prod_extensions/prod_extensions/ext_extension-manager.html) or by following the steps in [Extension Enabling/Disabling](https://docs.omniverse.nvidia.com/py/kit/docs/guide/extensions.html#extension-enabling-disabling) <hr> <a name="usage"></a> ### Extension usage Enabling the extension starts a TCP socket server that executes the code sent to it from the VS Code [Embedded VS Code for NVIDIA Omniverse](https://marketplace.visualstudio.com/items?itemName=Toni-SM.embedded-vscode-for-nvidia-omniverse) pair extension according to the VS Code settings and commands shown in the image below <br> ![preview1](exts/semu.misc.vscode/data/vscode_ext1.png) The VS Code extension communicates via the configured address (`WORKSTATION_IP:PORT`), which is also indicated inside the Omniverse application in the *Windows > Embedded VS Code* menu <br> <p align="center"> <img src="exts/semu.misc.vscode/data/preview1.png" width="75%"> </p> Disabling the extension shutdowns the TCP socket server <hr> <a name="interface"></a> ### VS Code interface <br> ![preview2](exts/semu.misc.vscode/data/vscode_ext2.png) <hr> <a name="config"></a> ### Configuring the extension The extension can be configured by editing the [config.toml](exts/semu.misc.vscode/config/extension.toml) file under `[settings]` section. The following parameters are available: <br> **Extension settings** <table class="table table-striped table-bordered"> <thead> <tr> <th>Parameter</th> <th>Value</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>socket_ip</td> <td>0.0.0.0</td> <td>The IP address on which the TCP socket server will be listening for incoming requests</td> </tr> <tr> <td>socket_port</td> <td>8224</td> <td>The port on which the TCP socket server will be listening for incoming requests. In addition, the same port is used by a UDP socket to send carb logs (carb logging)</td> </tr> <tr> <td>carb_logging</td> <td>true</td> <td>Whether to send carb logging to be displayed in the *Embedded VS Code for NVIDIA Omniverse (carb logging)* output panel in the VS Code editor</td> </tr> </tbody> </table> <hr> <a name="limitations"></a> ### Limitations - Print output will only be available in the VS Code OUTPUT panel after complete execution of the entire or selected code. Very large prints may not be displayed in the output panel - Print output, inside callbacks (such as events), is not displayed in the VS Code OUTPUT panel but in the Omniverse application terminal. For that propose, use the following carb logging functions: `carb.log_info`, `carb.log_warn` or `carb.log_error`. If the carb logging is enabled, the output will be displayed in the *Embedded VS Code for NVIDIA Omniverse (carb logging)* output panel - Carb log displaying is only available from Python calls. Logs generated by NVIDIA Omniverse applications/extensions implemented with another programming language (e.g. C/C++) are not displayed in the output panel - The kit commands snippets (with their parameters, default values and annotations) are automatically generated from the list of commands available from Create, Code and Isaac Sim on Linux. Some commands may not be available in some Omniverse applications <a name="contributing"></a> ### Contributing The source code for both the NVIDIA Omniverse application and VS Code editor extensions are located in the same repository (https://github.com/Toni-SM/semu.misc.vscode): - NVIDIA Omniverse extension: `exts/semu.misc.vscode` - VS Code extension: `exts-vscode/embedded-vscode-for-nvidia-omniverse`
Toni-SM/semu.misc.vscode/exts/semu.misc.vscode/semu/misc/vscode/__init__.py
from .scripts.extension import *
Toni-SM/semu.misc.vscode/exts/semu.misc.vscode/semu/misc/vscode/scripts/extension.py
import __future__ import sys import json import time import types import socket import asyncio import threading import traceback import contextlib import subprocess from io import StringIO from dis import COMPILER_FLAG_NAMES try: from ast import PyCF_ALLOW_TOP_LEVEL_AWAIT except ImportError: PyCF_ALLOW_TOP_LEVEL_AWAIT = 0 import carb import omni.ext _udp_server = None _udp_clients = [] def _log_info(msg): # carb logging file, lno, func, mod = carb._get_caller_info() carb.log(mod, carb.logging.LEVEL_INFO, file, func, lno, msg) # send the message to all connected clients if _udp_server is not None: for client in _udp_clients: _udp_server.sendto(f"[Info][{mod}] {msg}".encode(), client) def _log_warn(msg): # carb logging file, lno, func, mod = carb._get_caller_info() carb.log(mod, carb.logging.LEVEL_WARN, file, func, lno, msg) # send the message to all connected clients if _udp_server is not None: for client in _udp_clients: _udp_server.sendto(f"[Warning][{mod}] {msg}".encode(), client) def _log_error(msg): # carb logging file, lno, func, mod = carb._get_caller_info() carb.log(mod, carb.logging.LEVEL_ERROR, file, func, lno, msg) # send the message to all connected clients if _udp_server is not None: for client in _udp_clients: _udp_server.sendto(f"[Error][{mod}] {msg}".encode(), client) def _get_coroutine_flag() -> int: """Get the coroutine flag for the current Python version """ for k, v in COMPILER_FLAG_NAMES.items(): if v == "COROUTINE": return k return -1 COROUTINE_FLAG = _get_coroutine_flag() def _has_coroutine_flag(code) -> bool: """Check if the code has the coroutine flag set """ if COROUTINE_FLAG == -1: return False return bool(code.co_flags & COROUTINE_FLAG) def _get_compiler_flags() -> int: """Get the compiler flags for the current Python version """ flags = 0 for value in globals().values(): try: if isinstance(value, __future__._Feature): f = value.compiler_flag flags |= f except BaseException: pass flags = flags | PyCF_ALLOW_TOP_LEVEL_AWAIT return flags def _get_event_loop() -> asyncio.AbstractEventLoop: """Backward compatible function for getting the event loop """ try: if sys.version_info >= (3, 7): return asyncio.get_running_loop() else: return asyncio.get_event_loop() except RuntimeError: return asyncio.get_event_loop_policy().get_event_loop() class Extension(omni.ext.IExt): WINDOW_NAME = "Embedded VS Code" MENU_PATH = f"Window/{WINDOW_NAME}" def on_startup(self, ext_id): self._globals = {**globals()} self._locals = self._globals # get extension settings self._settings = carb.settings.get_settings() self._socket_ip = self._settings.get("/exts/semu.misc.vscode/socket_ip") self._socket_port = self._settings.get("/exts/semu.misc.vscode/socket_port") self._carb_logging = self._settings.get("/exts/semu.misc.vscode/carb_logging") kill_processes_with_port_in_use = self._settings.get("/exts/semu.misc.vscode/kill_processes_with_port_in_use") # menu item self._editor_menu = omni.kit.ui.get_editor_menu() if self._editor_menu: self._menu = self._editor_menu.add_item(Extension.MENU_PATH, self._show_notification, toggle=False, value=False) # shutdown stream self.shutdown_stream_ebent = omni.kit.app.get_app().get_shutdown_event_stream() \ .create_subscription_to_pop(self._on_shutdown_event, name="semu.misc.vscode", order=0) # ensure port is free if kill_processes_with_port_in_use: if sys.platform == "win32": pids = [] cmd = ["netstat", "-ano"] p = subprocess.Popen(cmd, stdout=subprocess.PIPE) for line in p.stdout: if str(self._socket_port).encode() in line: pids.append(line.strip().split(b" ")[-1].decode()) p.wait() for pid in pids: carb.log_warn(f"Forced process shutdown with PID {pid}") cmd = ["taskkill", "/PID", pid, "/F"] subprocess.Popen(cmd).wait() # create socket self._socket_last_error = "" self._server = None self._create_socket() # carb logging to VS Code if self._carb_logging: # create UDP socket self._udp_server_running = False threading.Thread(target=self._create_udp_socket).start() # checkpoint carb log functions self._carb_log_info = types.FunctionType(carb.log_info.__code__, carb.log_info.__globals__, carb.log_info.__name__, carb.log_info.__defaults__, carb.log_info.__closure__) self._carb_log_warn = types.FunctionType(carb.log_warn.__code__, carb.log_warn.__globals__, carb.log_warn.__name__, carb.log_warn.__defaults__, carb.log_warn.__closure__) self._carb_log_error = types.FunctionType(carb.log_error.__code__, carb.log_error.__globals__, carb.log_error.__name__, carb.log_error.__defaults__, carb.log_error.__closure__) # override carb log functions carb.log_info = types.FunctionType(_log_info.__code__, _log_info.__globals__, _log_info.__name__, _log_info.__defaults__, _log_info.__closure__) carb.log_warn = types.FunctionType(_log_warn.__code__, _log_warn.__globals__, _log_warn.__name__, _log_warn.__defaults__, _log_warn.__closure__) carb.log_error = types.FunctionType(_log_error.__code__, _log_error.__globals__, _log_error.__name__, _log_error.__defaults__, _log_error.__closure__) def on_shutdown(self): global _udp_server, _udp_clients # restore carb log functions if self._carb_logging: carb.log_info = self._carb_log_info carb.log_warn = self._carb_log_warn carb.log_error = self._carb_log_error # clean up menu item if self._menu is not None: try: self._editor_menu.remove_item(self._menu) except: self._editor_menu.remove_item(Extension.MENU_PATH) self._menu = None # close the socket if self._server: self._server.close() _get_event_loop().run_until_complete(self._server.wait_closed()) # close the UDP socket if self._carb_logging: _udp_server = None _udp_clients = [] # wait for the UDP socket to close while self._udp_server_running: time.sleep(0.1) # extension ui methods def _on_shutdown_event(self, event): if event.type == omni.kit.app.POST_QUIT_EVENT_TYPE: self.on_shutdown() def _show_notification(self, *args, **kwargs) -> None: """Show extension data in the notification area """ if self._server is None: notification = "Unable to start the socket server at {}:{}. {}".format(self._socket_ip, self._socket_port, self._socket_last_error) status=omni.kit.notification_manager.NotificationStatus.WARNING else: notification = "Embedded VS Code socket server is running at {}:{}.\nUDP socket server for carb logging is {}"\ .format(self._socket_ip, self._socket_port, "enabled" if self._carb_logging else "disabled") status=omni.kit.notification_manager.NotificationStatus.INFO ok_button = omni.kit.notification_manager.NotificationButtonInfo("OK", on_complete=None) omni.kit.notification_manager.post_notification(notification, hide_after_timeout=False, duration=0, status=status, button_infos=[ok_button]) print(notification) carb.log_info(notification) # internal socket methods def _create_udp_socket(self) -> None: """Create the UDP socket for broadcasting carb logging """ global _udp_server, _udp_clients self._udp_server_running = True with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as _server: try: _server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) _server.bind((self._socket_ip, self._socket_port)) _server.setblocking(False) _server.settimeout(0.1) except Exception as e: _udp_server = None _udp_clients = [] carb.log_error(str(e)) self._udp_server_running = False return _udp_server = _server _udp_clients = [] while _udp_server is not None: try: _, addr = _server.recvfrom(1024) if addr not in _udp_clients: _udp_clients.append(addr) except socket.timeout: pass except Exception as e: carb.log_error("UDP server error: {}".format(e)) break self._udp_server_running = False def _create_socket(self) -> None: """Create a socket server to listen for incoming connections from the client """ class ServerProtocol(asyncio.Protocol): def __init__(self, parent) -> None: super().__init__() self._parent = parent def connection_made(self, transport): peername = transport.get_extra_info('peername') self.transport = transport def data_received(self, data): asyncio.run_coroutine_threadsafe(self._parent._exec_code_async(data.decode(), self.transport), _get_event_loop()) async def server_task(): try: self._server = await _get_event_loop().create_server(protocol_factory=lambda: ServerProtocol(self), host=self._socket_ip, port=self._socket_port, family=socket.AF_INET, reuse_port=None if sys.platform == 'win32' else True) except Exception as e: self._server = None self._socket_last_error = str(e) carb.log_error(str(e)) return await self._server.start_serving() task = _get_event_loop().create_task(server_task()) async def _exec_code_async(self, statement: str, transport: asyncio.Transport) -> None: """Execute the statement in the Omniverse scope and send the result to the client :param statement: statement to execute :type statement: str :param transport: transport to send the result to the client :type transport: asyncio.Transport :return: reply dictionary as expected by the client :rtype: dict """ _stdout = StringIO() try: with contextlib.redirect_stdout(_stdout): should_exec_code = True # try 'eval' first try: code = compile(statement, "<string>", "eval", flags= _get_compiler_flags(), dont_inherit=True) except SyntaxError: pass else: result = eval(code, self._globals, self._locals) should_exec_code = False # if 'eval' fails, try 'exec' if should_exec_code: code = compile(statement, "<string>", "exec", flags= _get_compiler_flags(), dont_inherit=True) result = eval(code, self._globals, self._locals) # await the result if it is a coroutine if _has_coroutine_flag(code): result = await result except Exception as e: # clean traceback _traceback = traceback.format_exc() _i = _traceback.find('\n File "<string>"') if _i != -1: _traceback = _traceback[_i + 20:] _traceback = _traceback.replace(", in <module>\n", "\n") # build reply dictionary reply = {"status": "error", "traceback": [_traceback], "ename": str(type(e).__name__), "evalue": str(e)} else: reply = {"status": "ok"} # add output to reply dictionary for printing reply["output"] = _stdout.getvalue() if reply["output"].endswith('\n'): reply["output"] = reply["output"][:-1] # send the reply to the client reply = json.dumps(reply) transport.write(reply.encode()) # close the connection transport.close()
Toni-SM/semu.misc.vscode/exts/semu.misc.vscode/config/extension.toml
[core] reloadable = true order = 0 [package] version = "0.0.3-beta" category = "Utility" feature = false app = false title = "Embedded VS Code" description = "VS Code version of Omniverse's script editor" authors = ["Toni-SM"] repository = "https://github.com/Toni-SM/semu.misc.vscode" keywords = ["vscode", "code", "editor"] changelog = "docs/CHANGELOG.md" readme = "docs/README.md" preview_image = "data/preview.png" icon = "data/icon.png" [package.target] config = ["release"] platform = ["linux-*", "windows-*"] python = ["*"] [dependencies] "omni.kit.test" = {} "omni.kit.uiapp" = {} "omni.kit.notification_manager" = {} [[python.module]] name = "semu.misc.vscode" [settings] exts."semu.misc.vscode".socket_ip = "0.0.0.0" exts."semu.misc.vscode".socket_port = 8226 exts."semu.misc.vscode".carb_logging = true exts."semu.misc.vscode".kill_processes_with_port_in_use = true
Toni-SM/semu.misc.vscode/exts/semu.misc.vscode/docs/CHANGELOG.md
# Changelog The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [0.0.3-beta] - 2022-09-03 ### Added - Add `kill_processes_with_port_in_use` to extension settings ### Fixed - Fix port in use when starting up and shutting down ## [0.0.2-beta] - 2022-08-19 ### Added - Send carb logging Python calls to the VS Code extension ## [0.0.1-beta] - 2022-08-15 ### Added - Initial release
Toni-SM/semu.misc.vscode/exts/semu.misc.vscode/docs/README.md
# semu.misc.vscode This extension can be described as the VS Code version of Omniverse's script editor. It allows to execute python code, embedded in the current NVIDIA Omniverse application scope, from the VS Code editor and display the results in that editor Visit https://github.com/Toni-SM/semu.misc.vscode to read more about its use
Toni-SM/semu.misc.vscode/PACKAGE-LICENSES/dependencies/ptpython-LICENSE.txt
Copyright (c) 2015, Jonathan Slenders All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the {organization} nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/package.json
{ "name": "embedded-vscode-for-nvidia-omniverse", "displayName": "Embedded VS Code for NVIDIA Omniverse", "description": "Run python code embedded in the current NVIDIA Omniverse application scope, exploit code snippets, and access NVIDIA Omniverse resources and documentation without leaving the editor", "version": "0.2.0", "publisher": "Toni-SM", "repository": "https://github.com/Toni-SM/semu.misc.vscode", "icon": "images/icon.png", "keywords": [ "embedded", "nvidia", "omniverse", "kit", "script", "editor", "snippet", "resources" ], "engines": { "vscode": "^1.65.0" }, "categories": [ "Other" ], "activationEvents": [ "onStartupFinished", "onCommand:embedded-vscode-for-nvidia-omniverse.run", "onCommand:embedded-vscode-for-nvidia-omniverse.runRemotely", "onCommand:embedded-vscode-for-nvidia-omniverse.runSelectedText", "onCommand:embedded-vscode-for-nvidia-omniverse.runSelectedTextRemotely", "onCommand:embedded-vscode-for-nvidia-omniverse.insertSnippet", "onCommand:embedded-vscode-for-nvidia-omniverse.openResource" ], "main": "./out/extension.js", "contributes": { "commands": [ { "command": "embedded-vscode-for-nvidia-omniverse.run", "title": "Run", "category": "Embedded VS Code for NVIDIA Omniverse", "description": "Run python code embedded in the NVIDIA Omniverse application scope (running locally)" }, { "command": "embedded-vscode-for-nvidia-omniverse.runRemotely", "title": "Run Remotely", "category": "Embedded VS Code for NVIDIA Omniverse", "description": "Run python code embedded in the NVIDIA Omniverse application scope (running remotely)" }, { "command": "embedded-vscode-for-nvidia-omniverse.runSelectedText", "title": "Run Selected Text", "category": "Embedded VS Code for NVIDIA Omniverse", "description": "Run python code embedded in the NVIDIA Omniverse application scope (running locally) from the selected text" }, { "command": "embedded-vscode-for-nvidia-omniverse.runSelectedTextRemotely", "title": "Run Selected Text Remotely", "category": "Embedded VS Code for NVIDIA Omniverse", "description": "Run python code embedded in the NVIDIA Omniverse application scope (running remotely) from the selected text" }, { "command": "embedded-vscode-for-nvidia-omniverse.insertSnippet", "title": "Insert snippet", "category": "Embedded VS Code for NVIDIA Omniverse" }, { "command": "embedded-vscode-for-nvidia-omniverse.openResource", "title": "Open resource internally or externally", "category": "Embedded VS Code for NVIDIA Omniverse" }, { "command": "embedded-vscode-for-nvidia-omniverse.expandAll", "title": "Expand All", "category": "Embedded VS Code for NVIDIA Omniverse", "description": "Expand snippet tree", "icon": "$(expand-all)" }, { "command": "embedded-vscode-for-nvidia-omniverse.snippetLanguagePython", "title": "Python", "category": "Embedded VS Code for NVIDIA Omniverse", "description": "Snippets language (Python)", "icon": "images/view-action-snippets-python.svg" }, { "command": "embedded-vscode-for-nvidia-omniverse.snippetLanguageCpp", "title": "C++", "category": "Embedded VS Code for NVIDIA Omniverse", "description": "Snippets language (C++)", "icon": "images/view-action-snippets-cpp.svg" } ], "configuration": { "title": "Embedded VS Code for NVIDIA Omniverse", "properties": { "remoteSocket.extensionIp": { "type": "string", "format": "ipv4", "default": "127.0.0.1", "description": "IP address where the remote Omniverse application is running" }, "remoteSocket.extensionPort": { "type": "number", "default": 8226, "markdownDescription": "Port used by the *Embedded VS Code for NVIDIA Omniverse* extension in the remote Omniverse application" }, "localSocket.extensionPort": { "type": "number", "default": 8226, "markdownDescription": "Port used by the *Embedded VS Code for NVIDIA Omniverse* extension in the local Omniverse application" }, "output.clearBeforeRun": { "type": "boolean", "default": false, "markdownDescription": "Whether to clear the output before run the code. If unchecked (`false`), the output will be appended to the existing content" }, "output.carbLogging": { "type": "boolean", "default": true, "markdownDescription": "Whether to enable carb logging to be displayed in the *Embedded VS Code for NVIDIA Omniverse (carb logging)* output panel. Changes will take effect after reloading the window" } } }, "viewsContainers": { "activitybar": [ { "id": "embedded-vscode-for-nvidia-omniverse-views", "title": "Embedded VS Code for NVIDIA Omniverse", "icon": "images/view.svg" } ] }, "views": { "embedded-vscode-for-nvidia-omniverse-views": [ { "id": "embedded-vscode-for-nvidia-omniverse-views-commands", "name": "Commands" }, { "id": "embedded-vscode-for-nvidia-omniverse-views-snippets", "name": "Snippets" }, { "id": "embedded-vscode-for-nvidia-omniverse-views-resources", "name": "Resources" } ] }, "menus": { "view/title": [ { "command": "embedded-vscode-for-nvidia-omniverse.snippetLanguagePython", "when": "view =~ /embedded-vscode-for-nvidia-omniverse-views-snippets/ && embedded-vscode-for-nvidia-omniverse-snippet-python == true", "group": "navigation@1" }, { "command": "embedded-vscode-for-nvidia-omniverse.snippetLanguageCpp", "when": "view =~ /embedded-vscode-for-nvidia-omniverse-views-snippets/ && embedded-vscode-for-nvidia-omniverse-snippet-cpp == true", "group": "navigation@1" }, { "command": "embedded-vscode-for-nvidia-omniverse.expandAll", "when": "view =~ /embedded-vscode-for-nvidia-omniverse-views-snippets/", "group": "navigation@2" } ] } }, "scripts": { "vscode:prepublish": "npm run compile", "compile": "tsc -p ./", "watch": "tsc -watch -p ./", "pretest": "npm run compile && npm run lint", "lint": "eslint src --ext ts", "test": "node ./out/test/runTest.js" }, "devDependencies": { "@types/vscode": "^1.65.0", "@types/glob": "^7.2.0", "@types/mocha": "^9.1.1", "@types/node": "16.x", "@typescript-eslint/eslint-plugin": "^5.31.0", "@typescript-eslint/parser": "^5.31.0", "eslint": "^8.20.0", "glob": "^8.0.3", "mocha": "^10.0.0", "typescript": "^4.7.4", "@vscode/test-electron": "^2.1.5" } }
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/package-lock.json
{ "name": "embedded-vscode-for-nvidia-omniverse", "version": "0.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { "@eslint/eslintrc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", "espree": "^9.3.2", "globals": "^13.15.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" } }, "@humanwhocodes/config-array": { "version": "0.10.4", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.4.tgz", "integrity": "sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw==", "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", "minimatch": "^3.0.4" } }, "@humanwhocodes/gitignore-to-minimatch": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz", "integrity": "sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==", "dev": true }, "@humanwhocodes/object-schema": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "requires": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "@nodelib/fs.stat": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true }, "@nodelib/fs.walk": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "requires": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, "@tootallnate/once": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", "dev": true }, "@types/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", "dev": true, "requires": { "@types/minimatch": "*", "@types/node": "*" } }, "@types/json-schema": { "version": "7.0.11", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, "@types/minimatch": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==", "dev": true }, "@types/mocha": { "version": "9.1.1", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", "dev": true }, "@types/node": { "version": "16.11.48", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.48.tgz", "integrity": "sha512-Z9r9UWlNeNkYnxybm+1fc0jxUNjZqRekTAr1pG0qdXe9apT9yCiqk1c4VvKQJsFpnchU4+fLl25MabSLA2wxIw==", "dev": true }, "@types/vscode": { "version": "1.70.0", "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.70.0.tgz", "integrity": "sha512-3/9Fz0F2eBgwciazc94Ien+9u1elnjFg9YAhvAb3qDy/WeFWD9VrOPU7CIytryOVUdbxus8uzL4VZYONA0gDtA==", "dev": true }, "@typescript-eslint/eslint-plugin": { "version": "5.33.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.33.0.tgz", "integrity": "sha512-jHvZNSW2WZ31OPJ3enhLrEKvAZNyAFWZ6rx9tUwaessTc4sx9KmgMNhVcqVAl1ETnT5rU5fpXTLmY9YvC1DCNg==", "dev": true, "requires": { "@typescript-eslint/scope-manager": "5.33.0", "@typescript-eslint/type-utils": "5.33.0", "@typescript-eslint/utils": "5.33.0", "debug": "^4.3.4", "functional-red-black-tree": "^1.0.1", "ignore": "^5.2.0", "regexpp": "^3.2.0", "semver": "^7.3.7", "tsutils": "^3.21.0" } }, "@typescript-eslint/parser": { "version": "5.33.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.33.0.tgz", "integrity": "sha512-cgM5cJrWmrDV2KpvlcSkelTBASAs1mgqq+IUGKJvFxWrapHpaRy5EXPQz9YaKF3nZ8KY18ILTiVpUtbIac86/w==", "dev": true, "requires": { "@typescript-eslint/scope-manager": "5.33.0", "@typescript-eslint/types": "5.33.0", "@typescript-eslint/typescript-estree": "5.33.0", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { "version": "5.33.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.33.0.tgz", "integrity": "sha512-/Jta8yMNpXYpRDl8EwF/M8It2A9sFJTubDo0ATZefGXmOqlaBffEw0ZbkbQ7TNDK6q55NPHFshGBPAZvZkE8Pw==", "dev": true, "requires": { "@typescript-eslint/types": "5.33.0", "@typescript-eslint/visitor-keys": "5.33.0" } }, "@typescript-eslint/type-utils": { "version": "5.33.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.33.0.tgz", "integrity": "sha512-2zB8uEn7hEH2pBeyk3NpzX1p3lF9dKrEbnXq1F7YkpZ6hlyqb2yZujqgRGqXgRBTHWIUG3NGx/WeZk224UKlIA==", "dev": true, "requires": { "@typescript-eslint/utils": "5.33.0", "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { "version": "5.33.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.33.0.tgz", "integrity": "sha512-nIMt96JngB4MYFYXpZ/3ZNU4GWPNdBbcB5w2rDOCpXOVUkhtNlG2mmm8uXhubhidRZdwMaMBap7Uk8SZMU/ppw==", "dev": true }, "@typescript-eslint/typescript-estree": { "version": "5.33.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.33.0.tgz", "integrity": "sha512-tqq3MRLlggkJKJUrzM6wltk8NckKyyorCSGMq4eVkyL5sDYzJJcMgZATqmF8fLdsWrW7OjjIZ1m9v81vKcaqwQ==", "dev": true, "requires": { "@typescript-eslint/types": "5.33.0", "@typescript-eslint/visitor-keys": "5.33.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", "semver": "^7.3.7", "tsutils": "^3.21.0" } }, "@typescript-eslint/utils": { "version": "5.33.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.33.0.tgz", "integrity": "sha512-JxOAnXt9oZjXLIiXb5ZIcZXiwVHCkqZgof0O8KPgz7C7y0HS42gi75PdPlqh1Tf109M0fyUw45Ao6JLo7S5AHw==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", "@typescript-eslint/scope-manager": "5.33.0", "@typescript-eslint/types": "5.33.0", "@typescript-eslint/typescript-estree": "5.33.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" } }, "@typescript-eslint/visitor-keys": { "version": "5.33.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.33.0.tgz", "integrity": "sha512-/XsqCzD4t+Y9p5wd9HZiptuGKBlaZO5showwqODii5C0nZawxWLF+Q6k5wYHBrQv96h6GYKyqqMHCSTqta8Kiw==", "dev": true, "requires": { "@typescript-eslint/types": "5.33.0", "eslint-visitor-keys": "^3.3.0" } }, "@ungap/promise-all-settled": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", "dev": true }, "@vscode/test-electron": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.1.5.tgz", "integrity": "sha512-O/ioqFpV+RvKbRykX2ItYPnbcZ4Hk5V0rY4uhQjQTLhGL9WZUvS7exzuYQCCI+ilSqJpctvxq2llTfGXf9UnnA==", "dev": true, "requires": { "http-proxy-agent": "^4.0.1", "https-proxy-agent": "^5.0.0", "rimraf": "^3.0.2", "unzipper": "^0.10.11" } }, "acorn": { "version": "8.8.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", "dev": true }, "acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true }, "agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "dev": true, "requires": { "debug": "4" } }, "ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true }, "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { "color-convert": "^2.0.1" } }, "anymatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", "dev": true, "requires": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" } }, "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, "array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, "big-integer": { "version": "1.6.51", "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", "dev": true }, "binary": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz", "integrity": "sha512-D4H1y5KYwpJgK8wk1Cue5LLPgmwHKYSChkbspQg5JtVuR5ulGckxfR62H3AE9UDkdMC8yyXlqYihuz3Aqg2XZg==", "dev": true, "requires": { "buffers": "~0.1.1", "chainsaw": "~0.1.0" } }, "binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true }, "bluebird": { "version": "3.4.7", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz", "integrity": "sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA==", "dev": true }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, "requires": { "fill-range": "^7.0.1" } }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, "buffer-indexof-polyfill": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.2.tgz", "integrity": "sha512-I7wzHwA3t1/lwXQh+A5PbNvJxgfo5r3xulgpYDB5zckTu/Z9oUK9biouBKQUjEqzaz3HnAT6TYoovmE+GqSf7A==", "dev": true }, "buffers": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz", "integrity": "sha512-9q/rDEGSb/Qsvv2qvzIzdluL5k7AaJOTrw23z9reQthrbF7is4CtlT0DXyO1oei2DCp4uojjzQ7igaSHp1kAEQ==", "dev": true }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, "camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true }, "chainsaw": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz", "integrity": "sha512-75kWfWt6MEKNC8xYXIdRpDehRYY/tNSgwKaJq+dbbDcxORuVrrQ+SEHoWsniVn9XPYfP4gmdWIeDk/4YNp1rNQ==", "dev": true, "requires": { "traverse": ">=0.3.0 <0.4" } }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, "requires": { "anymatch": "~3.1.2", "braces": "~3.0.2", "fsevents": "~2.3.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" } }, "cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, "requires": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^7.0.0" } }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { "color-name": "~1.1.4" } }, "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, "core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "requires": { "ms": "2.1.2" } }, "decamelize": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true }, "deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, "diff": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true }, "dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, "requires": { "path-type": "^4.0.0" } }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "requires": { "esutils": "^2.0.2" } }, "duplexer2": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", "dev": true, "requires": { "readable-stream": "^2.0.2" } }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", "dev": true }, "escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, "eslint": { "version": "8.22.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.22.0.tgz", "integrity": "sha512-ci4t0sz6vSRKdmkOGmprBo6fmI4PrphDFMy5JEq/fNS0gQkJM3rLmrqcp8ipMcdobH3KtUP40KniAE9W19S4wA==", "dev": true, "requires": { "@eslint/eslintrc": "^1.3.0", "@humanwhocodes/config-array": "^0.10.4", "@humanwhocodes/gitignore-to-minimatch": "^1.0.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", "espree": "^9.3.3", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "functional-red-black-tree": "^1.0.1", "glob-parent": "^6.0.1", "globals": "^13.15.0", "globby": "^11.1.0", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", "regexpp": "^3.2.0", "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, "dependencies": { "eslint-scope": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", "dev": true, "requires": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" } }, "estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true }, "glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "requires": { "is-glob": "^4.0.3" } } } }, "eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "requires": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" } }, "eslint-utils": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, "requires": { "eslint-visitor-keys": "^2.0.0" }, "dependencies": { "eslint-visitor-keys": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true } } }, "eslint-visitor-keys": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", "dev": true }, "espree": { "version": "9.3.3", "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.3.tgz", "integrity": "sha512-ORs1Rt/uQTqUKjDdGCyrtYxbazf5umATSf/K4qxjmZHORR6HJk+2s/2Pqe+Kk49HHINC/xNIrGfgh8sZcll0ng==", "dev": true, "requires": { "acorn": "^8.8.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.3.0" } }, "esquery": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", "dev": true, "requires": { "estraverse": "^5.1.0" }, "dependencies": { "estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true } } }, "esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "requires": { "estraverse": "^5.2.0" }, "dependencies": { "estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true } } }, "estraverse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, "fast-glob": { "version": "3.2.11", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.4" } }, "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, "fastq": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "dev": true, "requires": { "reusify": "^1.0.4" } }, "file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, "requires": { "flat-cache": "^3.0.4" } }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "requires": { "to-regex-range": "^5.0.1" } }, "find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "requires": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, "flat": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true }, "flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, "requires": { "flatted": "^3.1.0", "rimraf": "^3.0.2" } }, "flatted": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.6.tgz", "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", "dev": true }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, "fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, "optional": true }, "fstream": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", "dev": true, "requires": { "graceful-fs": "^4.1.2", "inherits": "~2.0.0", "mkdirp": ">=0.5 0", "rimraf": "2" }, "dependencies": { "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "dev": true, "requires": { "glob": "^7.1.3" } } } }, "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", "dev": true }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, "glob": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^5.0.1", "once": "^1.3.0" }, "dependencies": { "brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "requires": { "balanced-match": "^1.0.0" } }, "minimatch": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", "dev": true, "requires": { "brace-expansion": "^2.0.1" } } } }, "glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "requires": { "is-glob": "^4.0.1" } }, "globals": { "version": "13.17.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", "dev": true, "requires": { "type-fest": "^0.20.2" } }, "globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, "requires": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", "fast-glob": "^3.2.9", "ignore": "^5.2.0", "merge2": "^1.4.1", "slash": "^3.0.0" } }, "graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "dev": true }, "grapheme-splitter": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", "dev": true }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, "http-proxy-agent": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", "dev": true, "requires": { "@tootallnate/once": "1", "agent-base": "6", "debug": "4" } }, "https-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, "requires": { "agent-base": "6", "debug": "4" } }, "ignore": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "dev": true }, "import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, "requires": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" } }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" } }, "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, "requires": { "binary-extensions": "^2.0.0" } }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "requires": { "is-extglob": "^2.1.1" } }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, "is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true }, "is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", "dev": true }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, "js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "requires": { "argparse": "^2.0.1" } }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true }, "levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "requires": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" } }, "listenercount": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/listenercount/-/listenercount-1.0.1.tgz", "integrity": "sha512-3mk/Zag0+IJxeDrxSgaDPy4zZ3w05PRZeJNnlWhzFz5OkX49J4krc+A8X2d2M69vGMBEX0uyl8M+W+8gH+kBqQ==", "dev": true }, "locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "requires": { "p-locate": "^5.0.0" } }, "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, "log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "requires": { "chalk": "^4.1.0", "is-unicode-supported": "^0.1.0" } }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "requires": { "yallist": "^4.0.0" } }, "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true }, "micromatch": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, "requires": { "braces": "^3.0.2", "picomatch": "^2.3.1" } }, "minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "mkdirp": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "dev": true, "requires": { "minimist": "^1.2.6" } }, "mocha": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.0.0.tgz", "integrity": "sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA==", "dev": true, "requires": { "@ungap/promise-all-settled": "1.1.2", "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", "chokidar": "3.5.3", "debug": "4.3.4", "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", "glob": "7.2.0", "he": "1.2.0", "js-yaml": "4.1.0", "log-symbols": "4.1.0", "minimatch": "5.0.1", "ms": "2.1.3", "nanoid": "3.3.3", "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", "workerpool": "6.2.1", "yargs": "16.2.0", "yargs-parser": "20.2.4", "yargs-unparser": "2.0.0" }, "dependencies": { "glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, "dependencies": { "minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "requires": { "brace-expansion": "^1.1.7" } } } }, "minimatch": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", "dev": true, "requires": { "brace-expansion": "^2.0.1" }, "dependencies": { "brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "requires": { "balanced-match": "^1.0.0" } } } }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "requires": { "has-flag": "^4.0.0" } } } }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, "nanoid": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", "dev": true }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "requires": { "wrappy": "1" } }, "optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "dev": true, "requires": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", "word-wrap": "^1.2.3" } }, "p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "requires": { "yocto-queue": "^0.1.0" } }, "p-locate": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "requires": { "p-limit": "^3.0.2" } }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, "requires": { "callsites": "^3.0.0" } }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true }, "path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, "path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true }, "picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, "requires": { "safe-buffer": "^5.1.0" } }, "readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", "isarray": "~1.0.0", "process-nextick-args": "~2.0.0", "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" } }, "readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "requires": { "picomatch": "^2.2.1" } }, "regexpp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true }, "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, "reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "requires": { "glob": "^7.1.3" }, "dependencies": { "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } } } }, "run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "dev": true, "requires": { "queue-microtask": "^1.2.2" } }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "requires": { "lru-cache": "^6.0.0" } }, "serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, "requires": { "randombytes": "^2.1.0" } }, "setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", "dev": true }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "requires": { "shebang-regex": "^3.0.0" } }, "shebang-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { "safe-buffer": "~5.1.0" } }, "strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { "ansi-regex": "^5.0.1" } }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { "has-flag": "^4.0.0" } }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "requires": { "is-number": "^7.0.0" } }, "traverse": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz", "integrity": "sha512-iawgk0hLP3SxGKDfnDJf8wTz4p2qImnyihM5Hh/sGvQ3K37dPi/w8sRhdNIxYA1TwFwc5mDhIJq+O0RsvXBKdQ==", "dev": true }, "tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, "tsutils": { "version": "3.21.0", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "dev": true, "requires": { "tslib": "^1.8.1" } }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "requires": { "prelude-ls": "^1.2.1" } }, "type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true }, "typescript": { "version": "4.7.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", "dev": true }, "unzipper": { "version": "0.10.11", "resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.10.11.tgz", "integrity": "sha512-+BrAq2oFqWod5IESRjL3S8baohbevGcVA+teAIOYWM3pDVdseogqbzhhvvmiyQrUNKFUnDMtELW3X8ykbyDCJw==", "dev": true, "requires": { "big-integer": "^1.6.17", "binary": "~0.3.0", "bluebird": "~3.4.1", "buffer-indexof-polyfill": "~1.0.0", "duplexer2": "~0.1.4", "fstream": "^1.0.12", "graceful-fs": "^4.2.2", "listenercount": "~1.0.1", "readable-stream": "~2.3.6", "setimmediate": "~1.0.4" } }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, "requires": { "punycode": "^2.1.0" } }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, "v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", "dev": true }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { "isexe": "^2.0.0" } }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, "workerpool": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", "dev": true }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "requires": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, "y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true }, "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, "yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "requires": { "cliui": "^7.0.2", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.0", "y18n": "^5.0.5", "yargs-parser": "^20.2.2" } }, "yargs-parser": { "version": "20.2.4", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", "dev": true }, "yargs-unparser": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, "requires": { "camelcase": "^6.0.0", "decamelize": "^4.0.0", "flat": "^5.0.2", "is-plain-obj": "^2.1.0" } }, "yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true } } }
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/CHANGELOG.md
# Change Log All notable changes to the "embedded-vscode-for-nvidia-omniverse" extension will be documented in this file. Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. ## [0.1.0] - Add Omniverse view container for commands, snippets and resources ## [0.0.3] - Fix duplicated carb log display due to local/remote socket issue ## [0.0.2] - Send carb logging Python calls to the VS Code extension ## [0.0.1] - Initial release
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/vsc-extension-quickstart.md
# Welcome to your VS Code Extension ## What's in the folder * This folder contains all of the files necessary for your extension. * `package.json` - this is the manifest file in which you declare your extension and command. * The sample plugin registers a command and defines its title and command name. With this information VS Code can show the command in the command palette. It doesn’t yet need to load the plugin. * `src/extension.ts` - this is the main file where you will provide the implementation of your command. * The file exports one function, `activate`, which is called the very first time your extension is activated (in this case by executing the command). Inside the `activate` function we call `registerCommand`. * We pass the function containing the implementation of the command as the second parameter to `registerCommand`. ## Get up and running straight away * Press `F5` to open a new window with your extension loaded. * Run your command from the command palette by pressing (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and typing `Hello World`. * Set breakpoints in your code inside `src/extension.ts` to debug your extension. * Find output from your extension in the debug console. ## Make changes * You can relaunch the extension from the debug toolbar after changing code in `src/extension.ts`. * You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. ## Explore the API * You can open the full set of our API when you open the file `node_modules/@types/vscode/index.d.ts`. ## Run tests * Open the debug viewlet (`Ctrl+Shift+D` or `Cmd+Shift+D` on Mac) and from the launch configuration dropdown pick `Extension Tests`. * Press `F5` to run the tests in a new window with your extension loaded. * See the output of the test result in the debug console. * Make changes to `src/test/suite/extension.test.ts` or create new test files inside the `test/suite` folder. * The provided test runner will only consider files matching the name pattern `**.test.ts`. * You can create folders inside the `test` folder to structure your tests any way you want. ## Go further * [Follow UX guidelines](https://code.visualstudio.com/api/ux-guidelines/overview) to create extensions that seamlessly integrate with VS Code's native interface and patterns. * Reduce the extension size and improve the startup time by [bundling your extension](https://code.visualstudio.com/api/working-with-extensions/bundling-extension). * [Publish your extension](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) on the VS Code extension marketplace. * Automate builds by setting up [Continuous Integration](https://code.visualstudio.com/api/working-with-extensions/continuous-integration).
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/README.md
# Embedded VS Code for NVIDIA Omniverse This extension is the pair of the [*Embedded VS Code for NVIDIA Omniverse*](https://github.com/Toni-SM/semu.misc.vscode) extension for NVIDIA Omniverse applications that can be described as the [VS Code](https://code.visualstudio.com/) version of Omniverse's [Script Editor](https://docs.omniverse.nvidia.com/prod_extensions/prod_extensions/ext_script-editor.html). It allows to execute python code, embedded in a local/remote NVIDIA Omniverse application scope, from the VS Code editor and display the results in the OUTPUT panel (under *Embedded VS Code for NVIDIA Omniverse*) of the VS Code editor. <br> ![preview](https://raw.githubusercontent.com/Toni-SM/semu.misc.vscode/main/exts/semu.misc.vscode/data/preview.png) ## Overview <br> ![preview1](https://raw.githubusercontent.com/Toni-SM/semu.misc.vscode/main/exts/semu.misc.vscode/data/vscode_ext1.png) ## VS Code interface <br> ![preview2](https://raw.githubusercontent.com/Toni-SM/semu.misc.vscode/main/exts/semu.misc.vscode/data/vscode_ext2.png) ## Main commands ### Local execution * **Embedded VS Code for NVIDIA Omniverse: Run** - Execute the python code from the active editor in the local configured NVIDIA Omniverse application and display the results in the OUTPUT panel * **Embedded VS Code for NVIDIA Omniverse: Run Selected Text** - Execute the selected text in the active editor in the local configured NVIDIA Omniverse application and display the results in the OUTPUT panel ### Remote execution * **Embedded VS Code for NVIDIA Omniverse: Run Remotely** - Execute the python code from the active editor in the remote configured NVIDIA Omniverse application and display the results in the OUTPUT panel * **Embedded VS Code for NVIDIA Omniverse: Run Selected Text Remotely** - Execute the selected text in the active editor in the remote configured NVIDIA Omniverse application and display the results in the OUTPUT panel ## Extension Settings This extension contributes the following settings: * `remoteSocket.extensionIp`: IP address where the remote Omniverse application is running (default: `"127.0.0.1"`) * `remoteSocket.extensionPort`: Port used by the *Embedded VS Code for NVIDIA Omniverse* extension in the remote Omniverse application (default: `8226`) * `localSocket.extensionPort`: Port used by the *Embedded VS Code for NVIDIA Omniverse* extension in the local Omniverse application (default: `8226`) * `output.clearBeforeRun`: Whether to clear the output before run the code. If unchecked (default value), the output will be appended to the existing content (default: `false`) * `output.carbLogging`: Whether to enable carb logging to be displayed in the *Embedded VS Code for NVIDIA Omniverse (carb logging)* output panel. Changes will take effect after reloading the window (default: `true`) ## Limitations - Print output will only be available in the VS Code OUTPUT panel after complete execution of the entire or selected code. Very large prints may not be displayed in the output panel - Print output, inside callbacks (such as events), is not displayed in the VS Code OUTPUT panel but in the Omniverse application terminal. For that propose, use the following carb logging functions: `carb.log_info`, `carb.log_warn` or `carb.log_error`. If the carb logging is enabled, the output will be displayed in the *Embedded VS Code for NVIDIA Omniverse (carb logging)* output panel - Carb log displaying is only available from Python calls. Logs generated by NVIDIA Omniverse applications/extensions implemented with another programming language (e.g. C/C++) are not displayed in the output panel - The kit commands snippets (with their parameters, default values and annotations) are automatically generated from the list of commands available from Create, Code and Isaac Sim on Linux. Some commands may not be available in some Omniverse applications - The expand-all button in the Snippets view container only reveal 3 levels (limited by VS Code) ## Release Notes ### 0.2.0 - Update snippets - Update resource links - Add expand-all button in the Snippets view container - Add Isaac Sim snippets and resource links ### 0.1.0 - Add Omniverse view container for commands, snippets and resources ### 0.0.3 - Fix duplicated carb log display due to local/remote socket issue ### 0.0.2 - Send carb logging Python calls to the VS Code extension ### 0.0.1 - Initial release ## Contributing The source code for both the NVIDIA Omniverse application and VS Code editor extensions are located in the same repository (https://github.com/Toni-SM/semu.misc.vscode): - NVIDIA Omniverse extension: `exts/semu.misc.vscode` - VS Code extension: `exts-vscode/embedded-vscode-for-nvidia-omniverse`
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/tsconfig.json
{ "compilerOptions": { "module": "commonjs", "target": "ES2020", "outDir": "out", "lib": [ "ES2020" ], "sourceMap": true, "rootDir": "src", "strict": true /* enable all strict type-checking options */ /* Additional Checks */ // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ // "noUnusedParameters": true, /* Report errors on unused parameters. */ } }
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/src/extensionViews.ts
import * as vscode from 'vscode'; import {readFileSync} from 'fs' import * as path from 'path' export class CommandTreeView { private readonly commandTreeViewProvider: CommandTreeViewProvider constructor() { this.commandTreeViewProvider = new CommandTreeViewProvider() vscode.window.createTreeView('embedded-vscode-for-nvidia-omniverse-views-commands', {treeDataProvider: this.commandTreeViewProvider, showCollapseAll: true}); } } export class SnippetTreeView { private snippetTreeViewProvider: SnippetTreeViewProvider; private treeView: vscode.TreeView<Snippet>; constructor(snippetLanguage: string) { this.snippetTreeViewProvider = new SnippetTreeViewProvider(snippetLanguage, true) this.treeView = vscode.window.createTreeView('embedded-vscode-for-nvidia-omniverse-views-snippets', {treeDataProvider: this.snippetTreeViewProvider, showCollapseAll: true}); } public expandAll(): void { this.snippetTreeViewProvider.expandAll(this.treeView); } } export class ResourceTreeView { private readonly resourceTreeViewProvider: ResourceTreeViewProvider constructor() { this.resourceTreeViewProvider = new ResourceTreeViewProvider() vscode.window.createTreeView('embedded-vscode-for-nvidia-omniverse-views-resources', {treeDataProvider: this.resourceTreeViewProvider, showCollapseAll: true}); } } class CommandTreeViewProvider implements vscode.TreeDataProvider<Command> { private commands: Command[] = [] constructor() { // codicon: https://microsoft.github.io/vscode-codicons/dist/codicon.html // let icon1, icon2, icon3, icon4: vscode.Uri | undefined; // const currentExtension = vscode.extensions.getExtension("Toni-SM.embedded-vscode-for-nvidia-omniverse"); // if (currentExtension){ // icon1 = vscode.Uri.file(path.join(currentExtension.extensionPath, 'images', "command-run.svg")); // icon2 = vscode.Uri.file(path.join(currentExtension.extensionPath, 'images', "command-run-selected.svg")); // icon3 = vscode.Uri.file(path.join(currentExtension.extensionPath, 'images', "command-run-remote.svg")); // icon4 = vscode.Uri.file(path.join(currentExtension.extensionPath, 'images', "command-run-remote-selected.svg")); // } this.commands.push(new Command("Run", {command: "embedded-vscode-for-nvidia-omniverse.run"}, new vscode.ThemeIcon("play"))); this.commands.push(new Command("Run selected text", {command: "embedded-vscode-for-nvidia-omniverse.runSelectedText"}, new vscode.ThemeIcon("play"))); this.commands.push(new Command("---", {command: ""})); this.commands.push(new Command("Run remotely", {command: "embedded-vscode-for-nvidia-omniverse.runRemotely"}, new vscode.ThemeIcon("run-all"))); this.commands.push(new Command("Run selected text remotely", {command: "embedded-vscode-for-nvidia-omniverse.runSelectedTextRemotely"}, new vscode.ThemeIcon("run-all"))); this.commands.push(new Command("---", {command: ""})); this.commands.push(new Command("Clear output", {command: "workbench.output.action.clearOutput"}, new vscode.ThemeIcon("clear-all"))); } getTreeItem(element: Command): vscode.TreeItem { return element; } getChildren(element?: Command): Command[] { return this.commands; } } class SnippetTreeViewProvider implements vscode.TreeDataProvider<Snippet> { private snippets: Snippet[] = [] constructor(snippetLanguage: string, collapsed: boolean) { if(snippetLanguage == "python") { this.snippets.push(this.buildSubtree("Kit", this.parseJSON("python-kit.json"), collapsed)); this.snippets.push(this.buildSubtree("Kit commands", this.parseJSON("python-kit-commands.json"), collapsed)); this.snippets.push(this.buildSubtree("USD", this.parseJSON("python-usd.json"), collapsed)); this.snippets.push(this.buildSubtree("Isaac Sim", this.parseJSON("python-isaac-sim.json"), collapsed)); } else if(snippetLanguage == "cpp") { this.snippets.push(this.buildSubtree("Kit", this.parseJSON("cpp-usd.json"), collapsed)); } } getTreeItem(element: Snippet): vscode.TreeItem { return element; } getChildren(element?: Snippet): Snippet[] { if (!element) return this.snippets return element.children } getParent(element: Snippet) { return element.parent } private buildSubtree(treeName: string, snippets: {title: string, snippets: [], url: string, snippet: string, description: string}[], collapsed: boolean): Snippet { let children: Snippet[] = []; for (var val of snippets) { if(val.hasOwnProperty("snippets")) children.push(this.buildSubtree(val.title, val.snippets, collapsed)); else children.push(new Snippet(val.title, {command: 'embedded-vscode-for-nvidia-omniverse.insertSnippet', arguments: [val.snippet]}, val.description)); } const parent = new Snippet(treeName, {command: ''}); if (children.length > 0) { if (collapsed) parent.collapsibleState = vscode.TreeItemCollapsibleState.Collapsed else parent.collapsibleState = vscode.TreeItemCollapsibleState.Expanded parent.children = children children.forEach((c) => c.parent = parent) } return parent } private parseJSON(jsonFile: string): [] { const currentExtension = vscode.extensions.getExtension("Toni-SM.embedded-vscode-for-nvidia-omniverse"); if (currentExtension){ const rawSnippets = JSON.parse(readFileSync(path.join(currentExtension.extensionPath, 'snippets', jsonFile), { encoding: 'utf8' })); return rawSnippets.snippets; } return []; } private expandSnippet(treeView: vscode.TreeView<Snippet>, snippet: Snippet): void { if (snippet.children.length > 0) { treeView.reveal(snippet, {select: false, focus: false, expand: 3}); for (var child of snippet.children) this.expandSnippet(treeView, child); } } public expandAll(treeView: vscode.TreeView<Snippet>): void { for (var snippet of this.snippets) treeView.reveal(snippet, {select: false, focus: false, expand: 3}); // this.expandSnippet(treeView, snippet); } } class ResourceTreeViewProvider implements vscode.TreeDataProvider<Resource> { private resources: Resource[] = [] constructor() { this.resources.push(this.buildSubtree("Developer", this.parseJSON("developer.json"))); this.resources.push(this.buildSubtree("Documentation", this.parseJSON("documentation.json"))); this.resources.push(this.buildSubtree("Forum (external)", this.parseJSON("forums.json"))); this.resources.push(this.buildSubtree("Isaac Sim: Extensions API", this.parseJSON("isaac-sim_extensions.json"))); } getTreeItem(element: Resource): vscode.TreeItem { return element; } getChildren(element?: Resource): Resource[] { if (!element) return this.resources return element.children } getParent(element: Resource) { return element.parent } private buildSubtree(treeName: string, resources: {title: string, resources: [], url: string, internal: string, description: string}[]): Resource { let children: Resource[] = []; for (var val of resources) { if( val.hasOwnProperty("resources")) children.push(this.buildSubtree(val.title, val.resources)); else children.push(new Resource(val.title, {command: 'embedded-vscode-for-nvidia-omniverse.openResource', arguments: [val.title, val.url, val.internal]}, val.description)); } const parent = new Resource(treeName, {command: ''}); if (children.length > 0) { parent.collapsibleState = vscode.TreeItemCollapsibleState.Collapsed parent.children = children children.forEach((c) => c.parent = parent) } return parent } private parseJSON(jsonFile: string): [] { const currentExtension = vscode.extensions.getExtension("Toni-SM.embedded-vscode-for-nvidia-omniverse"); if (currentExtension){ const rawResources = JSON.parse(readFileSync(path.join(currentExtension.extensionPath, 'resources', jsonFile), { encoding: 'utf8' })); return rawResources.resources; } return []; } } class Command extends vscode.TreeItem { public readonly command: vscode.Command | undefined constructor(public readonly label: string, command: {command: string, arguments?: string[]}, public readonly iconPath?: string | vscode.Uri | vscode.ThemeIcon | undefined) { super(label, vscode.TreeItemCollapsibleState.None); this.command = {...command, title: ''}; if (iconPath) this.iconPath = iconPath; } } class Snippet extends vscode.TreeItem { public children: Snippet[] = [] public parent: Snippet | undefined = undefined public readonly command: vscode.Command | undefined constructor(public label: string, command: {command: string, arguments?: string[], tooltip?: string}, public tooltip?: string | undefined) { super(label, vscode.TreeItemCollapsibleState.None); this.command = {...command, title: ''}; if (tooltip) this.tooltip = tooltip; } } class Resource extends vscode.TreeItem { public children: Resource[] = [] public parent: Resource | undefined = undefined public readonly command: vscode.Command | undefined constructor(public label: string, command: {command: string, arguments?: string[], tooltip?: string}, public tooltip?: string | undefined) { super(label, vscode.TreeItemCollapsibleState.None); this.command = {...command, title: ''}; if (tooltip) this.tooltip = tooltip; } }
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/src/extension.ts
import * as vscode from 'vscode'; import * as net from 'net'; import * as dgram from 'dgram'; import {CommandTreeView, SnippetTreeView, ResourceTreeView} from './extensionViews'; let snippetTreeView: SnippetTreeView; function logCarb(ip: string, port: number, outputChannel: vscode.OutputChannel) { let socket: dgram.Socket = dgram.createSocket('udp4'); socket.on('message', (msg, rinfo) => { outputChannel.appendLine(`${new Date().toLocaleTimeString()} ${msg}`); }).on('error', (err) => { console.error('embedded-vscode-for-nvidia-omniverse: UDP connection error: ' + err.message); }).on('close', () => { console.log('embedded-vscode-for-nvidia-omniverse: UDP connection closed'); }); // Send alive message on specified interval setInterval(() => { socket.send('*', port, ip); }, 5000); } function executeCode(ip: string, port: number, outputChannel: vscode.OutputChannel, selectedText: boolean) { // Get editor const editor = vscode.window.activeTextEditor; if (!editor) { vscode.window.showWarningMessage('No active editor found'); return; } let document = editor.document; // Get the document text let selection = undefined; if (selectedText) { selection = editor.selection; } const documentText = document.getText(selection); if (documentText.length == 0) { vscode.window.showWarningMessage('No text available or selected'); return; } // Get extension configuration const config = vscode.workspace.getConfiguration(); const clearAfterRun = config.get('output', {"clearBeforeRun": true}).clearBeforeRun; // Create TCP socket client let socket: net.Socket = new net.Socket(); // Connect to server, send text, and show output socket.connect(port, ip, () => { // Clear output if needed if (clearAfterRun) { outputChannel.clear(); } // Print info to output const extraInfo = selectedText ? ' selected text' : ''; outputChannel.appendLine(`[${new Date().toLocaleTimeString()}] executing${extraInfo} at ${ip}:${port}...`); // Send text to be executed socket.write(documentText); }).on('data', (data) => { outputChannel.show(); let reply = JSON.parse(data.toString()); // Show successfull execution if (reply.status === 'ok') { if (reply.output.length > 0) { outputChannel.appendLine(`[${new Date().toLocaleTimeString()}] executed with output:`); outputChannel.appendLine(reply.output); } else { outputChannel.appendLine(`[${new Date().toLocaleTimeString()}] executed without output`); } } // Show error during execution else if (reply.status === 'error') { if (reply.output.length > 0) { outputChannel.appendLine(reply.output); } outputChannel.appendLine('--------------------------------------------------'); outputChannel.appendLine('Traceback (most recent call last) ' + reply.traceback); outputChannel.appendLine(''); } socket.destroy(); }) .on('close', () => { }).on('error', (err) => { vscode.window.showErrorMessage('Connection error: ' + err.message); console.error('embedded-vscode-for-nvidia-omniverse: TCP connection error: ' + err.message); socket.destroy(); }).on('timeout', () => { console.log('embedded-vscode-for-nvidia-omniverse: timeout'); }); } function getWebviewContent(resourceUrl: string) { return `<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> html, body { margin: 0; padding: 0; width: 100%; height: 100%; min-height: 100%; } body > iframe { border: 0; } </style> </head> <body> <iframe width="100%" height="100%" frameBorder="0" src="${resourceUrl}"></iframe> </body> </html>`; } // this method is called when your extension is activated // your extension is activated the very first time the command is executed export function activate(context: vscode.ExtensionContext) { vscode.commands.executeCommand("setContext", "embedded-vscode-for-nvidia-omniverse-snippet-python", true); vscode.commands.executeCommand("setContext", "embedded-vscode-for-nvidia-omniverse-snippet-cpp", false); // create TreeDataProvider const commandTreeView = new CommandTreeView(); snippetTreeView = new SnippetTreeView("python"); const resourceTreeView = new ResourceTreeView(); // Get configuration const config = vscode.workspace.getConfiguration(); const localSocketPort = config.get('localSocket', {"extensionPort": 8226}).extensionPort; const remoteSocketIp = config.get('remoteSocket', {"extensionIp": "127.0.0.1"}).extensionIp; const remoteSocketPort = config.get('remoteSocket', {"extensionPort": 8226}).extensionPort; // Get OUTPUT panel let outputChannel = vscode.window.createOutputChannel('Embedded VS Code for NVIDIA Omniverse'); //, 'python'); // carb logging if (config.get('output', {"carbLogging": true}).carbLogging) { let outputChannelCarb = vscode.window.createOutputChannel('Embedded VS Code for NVIDIA Omniverse (carb logging)'); //, 'python'); // UDP clients for carb.log_* logCarb('127.0.0.1', localSocketPort, outputChannelCarb); if (remoteSocketIp != '127.0.0.1' && remoteSocketIp != 'localhost') { logCarb(remoteSocketIp, localSocketPort, outputChannelCarb); } } // Local execution let disposable_local = vscode.commands.registerCommand('embedded-vscode-for-nvidia-omniverse.run', () => { executeCode('127.0.0.1', localSocketPort, outputChannel, false); }); let disposable_local_selected_text = vscode.commands.registerCommand('embedded-vscode-for-nvidia-omniverse.runSelectedText', () => { executeCode('127.0.0.1', localSocketPort, outputChannel, true); }); // Remote execution let disposable_remote = vscode.commands.registerCommand('embedded-vscode-for-nvidia-omniverse.runRemotely', () => { executeCode(remoteSocketIp, remoteSocketPort, outputChannel, false); }); let disposable_remote_selected_text = vscode.commands.registerCommand('embedded-vscode-for-nvidia-omniverse.runSelectedTextRemotely', () => { executeCode(remoteSocketIp, remoteSocketPort, outputChannel, true); }); // Snippets expand-all let disposable_snippet_expand_all = vscode.commands.registerCommand('embedded-vscode-for-nvidia-omniverse.expandAll', () => { snippetTreeView!.expandAll(); }); // Snippets language let disposable_snippet_language_python = vscode.commands.registerCommand('embedded-vscode-for-nvidia-omniverse.snippetLanguagePython', () => { return; vscode.commands.executeCommand("setContext", "embedded-vscode-for-nvidia-omniverse-snippet-python", false); vscode.commands.executeCommand("setContext", "embedded-vscode-for-nvidia-omniverse-snippet-cpp", true); snippetTreeView = new SnippetTreeView("cpp"); }); let disposable_snippet_language_cpp = vscode.commands.registerCommand('embedded-vscode-for-nvidia-omniverse.snippetLanguageCpp', () => { return; vscode.commands.executeCommand("setContext", "embedded-vscode-for-nvidia-omniverse-snippet-python", true); vscode.commands.executeCommand("setContext", "embedded-vscode-for-nvidia-omniverse-snippet-cpp", false); snippetTreeView = new SnippetTreeView("python"); }); // Snippet let disposable_insert_snippet = vscode.commands.registerCommand('embedded-vscode-for-nvidia-omniverse.insertSnippet', (args) => { const editor = vscode.window.activeTextEditor; if (!editor) { vscode.window.showWarningMessage('No active editor found'); return; } editor.insertSnippet(new vscode.SnippetString(args)).then( () => {}, err => { vscode.window.showWarningMessage(`Unable to insert snippet: ${err}`); } ); }); // Open resource let disposable_open_resource = vscode.commands.registerCommand('embedded-vscode-for-nvidia-omniverse.openResource', (title, args, openInternal) => { // internal view if (openInternal) { const panel = vscode.window.createWebviewPanel( 'resource', // type of the webview panel title, // panel title vscode.ViewColumn.Beside, // editor column to show the panel in {enableScripts: true} // Webview options ); panel.webview.html = getWebviewContent(args); } // external view else { vscode.env.openExternal(vscode.Uri.parse(args)); } }); context.subscriptions.push(disposable_local); context.subscriptions.push(disposable_local_selected_text); context.subscriptions.push(disposable_remote); context.subscriptions.push(disposable_remote_selected_text); context.subscriptions.push(disposable_snippet_expand_all); context.subscriptions.push(disposable_snippet_language_python); context.subscriptions.push(disposable_snippet_language_cpp); context.subscriptions.push(disposable_insert_snippet); context.subscriptions.push(disposable_open_resource); } export function deactivate() { }
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/src/test/runTest.ts
import * as path from 'path'; import { runTests } from '@vscode/test-electron'; async function main() { try { // The folder containing the Extension Manifest package.json // Passed to `--extensionDevelopmentPath` const extensionDevelopmentPath = path.resolve(__dirname, '../../'); // The path to test runner // Passed to --extensionTestsPath const extensionTestsPath = path.resolve(__dirname, './suite/index'); // Download VS Code, unzip it and run the integration test await runTests({ extensionDevelopmentPath, extensionTestsPath }); } catch (err) { console.error('Failed to run tests'); process.exit(1); } } main();
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/src/test/suite/index.ts
import * as path from 'path'; import * as Mocha from 'mocha'; import * as glob from 'glob'; export function run(): Promise<void> { // Create the mocha test const mocha = new Mocha({ ui: 'tdd', color: true }); const testsRoot = path.resolve(__dirname, '..'); return new Promise((c, e) => { glob('**/**.test.js', { cwd: testsRoot }, (err, files) => { if (err) { return e(err); } // Add files to the test suite files.forEach(f => mocha.addFile(path.resolve(testsRoot, f))); try { // Run the mocha test mocha.run(failures => { if (failures > 0) { e(new Error(`${failures} tests failed.`)); } else { c(); } }); } catch (err) { console.error(err); e(err); } }); }); }
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/src/test/suite/extension.test.ts
import * as assert from 'assert'; // You can import and use all API from the 'vscode' module // as well as import your extension to test it import * as vscode from 'vscode'; // import * as myExtension from '../../extension'; suite('Extension Test Suite', () => { vscode.window.showInformationMessage('Start all tests.'); test('Sample test', () => { assert.strictEqual(-1, [1, 2, 3].indexOf(5)); assert.strictEqual(-1, [1, 2, 3].indexOf(0)); }); });
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/snippets/generate_snippet.py
import json title = "TITLE" description = "DESCRIPTION" # placehorlders syntax: ${1:foo}, ${2:bar}, $0. # placeholder traversal order is ascending by number, starting from one. # zero is an optional special case that always comes last, # and exits snippet mode with the cursor at the specified position snippet = """ CODE """ # generate entry print() print(json.dumps({"title": title, "description": description, "snippet":snippet[1:]}, # remove first line break indent=4)) print()
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/snippets/generate_commands_merge.py
import os import json def merge(snippets, app): for s in app["snippets"]: exists = False for ss in snippets: if s["title"] == ss["title"]: exists = True break # add section if not exists: print(" |-- new: {} ({})".format(s["title"], len(s["snippets"]))) snippets.append(s) # update section else: print(" |-- update: {} ({} <- {})".format(s["title"], len(ss["snippets"]), len(s["snippets"]))) for subs in s["snippets"]: exists = False for subss in ss["snippets"]: if subs["title"] == subss["title"]: exists = True break if not exists: print(" | |-- add:", subs["title"]) ss["snippets"].append(subs) snippets = [] # merge print("CREATE") with open(os.path.join("commands", "kit-commands-create.json")) as f: merge(snippets, json.load(f)) print("CODE") with open(os.path.join("commands", "kit-commands-code.json")) as f: merge(snippets, json.load(f)) print("ISAAC SIM") with open(os.path.join("commands", "kit-commands-isaac-sim.json")) as f: merge(snippets, json.load(f)) # sort snippets snippets = sorted(snippets, key=lambda d: d["title"]) for s in snippets: s["snippets"] = sorted(s["snippets"], key=lambda d: d["title"]) # save snippets with open("kit-commands.json", "w") as f: json.dump({"snippets": snippets}, f, indent=0) print("done")
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/snippets/python-kit-commands.json
{ "snippets": [ { "title": "omni.anim", "snippets": [ { "title": "AddAnimCurves", "description": "[omni.anim.curve.scripts.commands]\n\nAdd an empty curve for the given attribute path(s). Non-exist attribute paths will be skipped\n@param\n paths: is a list of string-typed attribute paths. Each path can be one of three types\n 1. prim path: Add curves for all of its available attributes. e.g. \"/World/Cube\"\n 2. attribute path: Add curves for that specific attribute. Multiple curves will be added for vector-typed attribute e.g. \"/World/Cube.size\", \"/World/Cube.xformOp:translate\": 3. None: Add curves for all currently selected prims\n paths default value is None\n\n@return\n Return True if we successfully add curves for all the paths\n Return False if any curve's addition is skipped due to some error\n@example\n AddAnimCurves(paths=[\"/World/Cube.xformOp:translate|x\", \"/World/Sphere.radius\"])\n AddAnimCurves(paths=[\"/World/Cube.size|x\"]) same as AddAnimCurves(paths=[\"/World/Cube.size\"])\n AddAnimCurves(paths=[\"/World/Cube.xformOp:translate\"])\n AddAnimCurves(paths=[\"/World/Cube\"])\n AddAnimCurves()", "snippet": "omni.kit.commands.execute(\"AddAnimCurves\",\n paths=None) # list\n" }, { "title": "AnimCurveCommandBase", "description": "[omni.anim.curve.scripts.commands]", "snippet": "omni.kit.commands.execute(\"AnimCurveCommandBase\",\n name=\"AnimCurveCommandBase\", # str\n stage=None, # typing.Union[pxr.Usd.Stage, NoneType]\n paths=None, # typing.Union[list, NoneType]\n time=None) # typing.Union[pxr.Usd.TimeCode, NoneType]\n" }, { "title": "AnimGraphUIRefreshPropertyWindowCommand", "description": "[omni.anim.graph.ui.scripts.command]", "snippet": "omni.kit.commands.execute(\"AnimGraphUIRefreshPropertyWindowCommand\")\n" }, { "title": "AnimGraphUIReplaceRelationshipTargetCommand", "description": "[omni.anim.graph.ui.scripts.command]", "snippet": "omni.kit.commands.execute(\"AnimGraphUIReplaceRelationshipTargetCommand\",\n relationship=relationship, # pxr.Usd.Relationship\n old_target=old_target, # pxr.Sdf.Path\n new_target=new_target) # pxr.Sdf.Path\n" }, { "title": "AnimGraphUISetNodePositionCommand", "description": "[omni.anim.graph.ui.scripts.command]", "snippet": "omni.kit.commands.execute(\"AnimGraphUISetNodePositionCommand\",\n prim=prim, # pxr.Usd.Prim\n position_attribute_name=position_attribute_name, # str\n value=value) # typing.Union[typing.Tuple[float, float], NoneType]\n" }, { "title": "AnimGraphUISetRelationshipTargetsCommand", "description": "[omni.anim.graph.ui.scripts.command]", "snippet": "omni.kit.commands.execute(\"AnimGraphUISetRelationshipTargetsCommand\",\n relationship=relationship, # pxr.Usd.Relationship\n targets=targets) # typing.List[pxr.Sdf.Path]\n" }, { "title": "ApplyAnimationGraphAPICommand", "description": "[omni.anim.graph.core.scripts.command]", "snippet": "omni.kit.commands.execute(\"ApplyAnimationGraphAPICommand\",\n layer=None, # pxr.Sdf.Layer\n paths=[], # typing.List[pxr.Sdf.Path]\n animation_graph_path=Sdf.Path.emptyPath) # pxr.Sdf.Path\n" }, { "title": "ApplyAnimationSkelBindingAPICommand", "description": "[omni.anim.retarget.ui.scripts.commands]", "snippet": "omni.kit.commands.execute(\"ApplyAnimationSkelBindingAPICommand\",\n layer=None, # pxr.Sdf.Layer\n paths=[]) # typing.List[pxr.Sdf.Path]\n" }, { "title": "ApplyControlRigAPICommand", "description": "[omni.anim.retarget.ui.scripts.commands]", "snippet": "omni.kit.commands.execute(\"ApplyControlRigAPICommand\",\n layer=None, # pxr.Sdf.Layer\n paths=[]) # typing.List[pxr.Sdf.Path]\n" }, { "title": "AssignAnimation", "description": "[omni.anim.shared.scripts.assignAnim]", "snippet": "omni.kit.commands.execute(\"AssignAnimation\",\n skeleton_path=skeleton_path,\n animprim_path=animprim_path)\n" }, { "title": "ClearRetargetTagsCommand", "description": "[omni.anim.retarget.core.scripts.commands]", "snippet": "omni.kit.commands.execute(\"ClearRetargetTagsCommand\",\n skel_paths=skel_paths) # list\n" }, { "title": "CreateAnimationGraphCommand", "description": "[omni.anim.graph.core.scripts.command]", "snippet": "omni.kit.commands.execute(\"CreateAnimationGraphCommand\",\n layer=None, # pxr.Sdf.Layer\n path=Sdf.Path.emptyPath, # pxr.Sdf.Path\n skeleton_path=Sdf.Path.emptyPath) # pxr.Sdf.Path\n" }, { "title": "CreateBehaviorScriptCommand", "description": "[omni.anim.graph.core.scripts.command]", "snippet": "omni.kit.commands.execute(\"CreateBehaviorScriptCommand\",\n layer=None, # pxr.Sdf.Layer\n path=Sdf.Path.emptyPath, # pxr.Sdf.Path\n script_path=@@, # pxr.Sdf.AssetPath\n character_path=Sdf.Path.emptyPath) # pxr.Sdf.Path\n" }, { "title": "CreateRetargetAnimationsCommand", "description": "[omni.anim.retarget.core.scripts.commands]", "snippet": "omni.kit.commands.execute(\"CreateRetargetAnimationsCommand\",\n source_skeleton_path=source_skeleton_path, # str\n target_skeleton_path=target_skeleton_path, # str\n source_animation_paths=source_animation_paths, # typing.List[str]\n target_animation_parent_path=target_animation_parent_path, # str\n set_root_identity=set_root_identity) # bool\n" }, { "title": "EditAnimCurveKeys", "description": "[omni.anim.curve.scripts.commands]\n\n Edit selected keyframes/tangents.\n\n @param\n selection_state: A KeySelectionState typed user defined buffer to hold the selection state.\n if None, which is the default, the selection state goes to a system global selection clipboard\n time: 1. A float value: only keys/tangents at this time will be considered.\n 2. None. Keeps time of keys/tangents not touched.\n 3. The default is None\n value: A float value of keys/tangents that you want to set to keys. Default is None, which means values are not touched.\n additive : A boolean flag to toggle whether to override times/values of the considered keys/tangents or\n add to them the specified ones by arguments time and value.\n The default value is False\n tangent_broken: A boolean flag which is the value of the tangent broken component of the keyframe\n The default is None, which means to keep the component untouched\n tangent_type: A string to set the tangent type component, possible values are\n \"auto\", \"smooth\", \"linear\", \"step\", \"fixed\".\n The default is None, which means to keep the component untouched\n tangent_weighted: A boolean flag which is the value of the weighted tangent component of the keyframe\n The default is None, which means to keep the component untouched\n", "snippet": "omni.kit.commands.execute(\"EditAnimCurveKeys\",\n selection_state=None, # omni.anim.curve.scripts.keySelection.KeySelectionState\n time=None,\n value=None,\n additive=False,\n tangent_broken=None, # bool\n tangent_type=None, # str\n tangent_weighted=None) # bool\n" }, { "title": "ExtractAnimCurves", "description": "[omni.anim.curve.scripts.commands]\n\n Converts dense key data to curve data\n @param\n paths: 1. attributes' path, e.g. /World/Cube.xformOp:translate\n 2. prims' path, e.g. /World/Cube\n\n clear_dense_data:\n True: clear existing dense data, only curve data is kept\n False: keep dense data and create curve data\n\n recursive:\n If True, for prim every prim path in paths extract all curves recursively for children\n\n attribute_mask: Only attributes that contain this sting are processed\n\n source_frame_rate:\n Source frame rate (time samples per seconds), or zero to use the current frame rate\n\n start_time:\n Start time of the output curve (in seconds)\n\n sparse:\n Apply curve simplification to reduce the number of keys\n\n max_error_percent:\n Maximum allowed error for each removed key, as percentage of curve value range (approximate)\n\n compute_tangents:\n When 'sparse' is set, compute the tangents of the sparse curve from the dense samples\n\n @example\n ExtractAnimCurves(paths=[\"/World/Cube.xformOp:translate\", \"/World/Sphere.visibility\"]) # Extracts two attributes\n ExtractAnimCurves(paths=[\"/World\"], recursive=True) # Extracts all attributes on all prims under /World\n ExtractAnimCurves(paths=[\"/World/Cube.xformOp:translate|x\"]) # Error: components are not supported\n ExtractAnimCurves() # Extracts all curves of the selected prim", "snippet": "omni.kit.commands.execute(\"ExtractAnimCurves\",\n stage=None, # pxr.Usd.Stage\n paths=None, # list\n clear_dense_data=True, # bool\n recursive=False, # bool\n attribute_mask=None,\n source_frame_rate=0.0, # float\n start_time=0.0, # float\n sparse=False, # bool\n max_error_percent=0.1,\n compute_tangents=False)\n" }, { "title": "LoadRetargetPoseCommand", "description": "[omni.anim.retarget.core.scripts.commands]", "snippet": "omni.kit.commands.execute(\"LoadRetargetPoseCommand\",\n skel_paths=skel_paths) # list\n" }, { "title": "NewAttributeCurveCommand", "description": "[omni.anim.curve_editor.commands]", "snippet": "omni.kit.commands.execute(\"NewAttributeCurveCommand\",\n prim_path=prim_path, # str\n attr_name=attr_name, # str\n components_quantity=components_quantity) # int\n" }, { "title": "NewTimelineNodeAttributeCurveCommand", "description": "[omni.anim.curve_editor.commands]", "snippet": "omni.kit.commands.execute(\"NewTimelineNodeAttributeCurveCommand\",\n prim_path=prim_path, # str\n attr_name=attr_name, # str\n components_quantity=components_quantity) # int\n" }, { "title": "PasteAnimCurveKeys", "description": "[omni.anim.curve.scripts.commands]\n\n Paste the curvekey data in global clipboard to target paths\n @param\n paths: 1. curves' path, only Paste keys in these curves e.g. /World/Cube.xformOp:translate|x\n 2. prims' path, Paste keys in all curves of this prim e.g. /World/Cube\n 3. None, move keys in all curves of all the SELECTED prims\n The default value is None\n Don't allow prim path and curves path both exist in target list\n time: time code for the earliest key to start pasting.\n The default value is None which means the current system time\n\n @return\n Return True if we successfully Paste the curve without any errors\n Return False if no curve is Paste or there are errors generated\n\n @description\n The Paste command will paste key set from the global clipboard to the target paths.\n Depending on the clipboard content, the paste can have different behavior.\n The special case is when the clipboard has only one curve's key copied. It will be broadcast\n copy to all target paths' curves if they are curve paths. If the target paths are prim typed,\n we will paste the curve to every prim with the same curve name, if applicable. This is useful\n for the copy & paste key from the property window.\n If the clipboard contains multiple curves, but all from a single prim, we can have a prim level's\n broadcast if the target paths are all prim typed. We will paste curves from the clipboard's single prim\n to all target paths. This is useful for animation timeline's copy and paste keys to multiple selected prims.\n In a more general case, where the clipboard contains multiple curves and the target paths contains\n multiple curve pths, we iterate through both of them and paste the curves/keys sequentially.\n @example\n PasteAnimCurveKeys(paths=[\"/World/Cube.xformOp:translate|x\", \"/World/Sphere.radius\"]) #Paste two curves\n PasteAnimCurveKeys(paths=[\"/World/Cube.size|x\"]) #Paste the specified curve\n PasteAnimCurveKeys(paths=[\"/World/Cube.xformOp:translate\"]) #Paste three curves\n PasteAnimCurveKeys(paths=[\"/World/Cube\"]) #Paste all of its curves in this prim\n PasteAnimCurveKeys() #Paste all curves of the selected prim\n PassteAnimCurveKeys(paths=[\"/World/Cube.size|x], time=Usd.TimeCode(15)) #Paste the key starting from frame 15", "snippet": "omni.kit.commands.execute(\"PasteAnimCurveKeys\",\n stage=None, # pxr.Usd.Stage\n paths=None, # list\n time=None) # pxr.Usd.TimeCode\n" }, { "title": "PasteAnimCurves", "description": "[omni.anim.curve.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PasteAnimCurves\",\n listSchemaKeys=listSchemaKeys, # list\n dstCurvePath=dstCurvePath)\n" }, { "title": "RemoveAnimCurveKeys", "description": "[omni.anim.curve.scripts.commands]\n\n Remove a list of keys from specificed curves(names)\n @param\n paths: is a list of string-typed USD paths. Each path can be one of three types\n 1) curves names path, only remove keys in these curves e.g. /World/Cube.xformOp:translate|x\n 2) prims' path, remove keys from all animation curves of this prim e.g. /World/Cube\n 3) None, remove keys from all curves of all the SELECTED prims\n The default value is None\n stage: the USD stage of those USD paths resides in\n time: UsdTimeCode, usually equal to the frame number as the index of the key. None to use the current time\n @return\n Return True if we successfully remove any keys and there is no errors\n Return False if no keys is removed or there are errors generated\n @example\n RemoveAnimCurveKeys(stage=stage, paths=[\"/World/Cube.xformOp:translate|x\", \"/World/Sphere.radius\"], time=Usd.TimeCode(20.0))\n RemoveAnimCurveKeys(stage=stage, paths=[\"/World/Cube.size|x\"], time=Usd.TimeCode(20.0))\n RemoveAnimCurveKeys(stage=stage, paths=[\"/World/Cube.xformOp:translate\"], time=Usd.TimeCode(20.0))\n RemoveAnimCurveKeys(stage=stage, paths=[\"/World/Cube\"])\n RemoveAnimCurveKeys(stage=stage, time=Usd.TimeCode(20.0))\n RemoveAnimCurveKeys(stage=stage)", "snippet": "omni.kit.commands.execute(\"RemoveAnimCurveKeys\",\n stage=None, # pxr.Usd.Stage\n paths=None, # list\n time=None) # pxr.Usd.TimeCode\n" }, { "title": "RemoveAnimCurves", "description": "[omni.anim.curve.scripts.commands]\n\n Remove a list of curves specified by the paths\n @param\n paths: 1. curves' path, only move keys in these curves e.g. /World/Cube.xformOp:translate|x\n 2. prims' path, move keys in all curves of this prim e.g. /World/Cube\n 3. None, move keys in all curves of all the SELECTED prims\n The default value is None\n @return\n Return True if we successfully remove the curve without any errors\n Return False if no curve is removed or there are errors generated\n @example\n RemoveAnimCurves(paths=[\"/World/Cube.xformOp:translate|x\", \"/World/Sphere.radius\"]) #Remove two curves\n RemoveAnimCurves(paths=[\"/World/Cube.size|x\"]) #Remove the specified curve\n RemoveAnimCurves(paths=[\"/World/Cube.xformOp:translate\"]) #Remove three curves\n RemoveAnimCurves(paths=[\"/World/Cube\"]) #Remove all of its curves in this prim\n RemoveAnimCurves() #Remove all curves of the selected prim", "snippet": "omni.kit.commands.execute(\"RemoveAnimCurves\",\n paths=None) # list\n" }, { "title": "RemoveAnimationGraphAPICommand", "description": "[omni.anim.graph.core.scripts.command]", "snippet": "omni.kit.commands.execute(\"RemoveAnimationGraphAPICommand\",\n layer=None, # pxr.Sdf.Layer\n paths=[]) # typing.List[pxr.Sdf.Path]\n" }, { "title": "RemoveRetargetPoseCommand", "description": "[omni.anim.retarget.core.scripts.commands]", "snippet": "omni.kit.commands.execute(\"RemoveRetargetPoseCommand\",\n skel_paths=skel_paths) # list\n" }, { "title": "RenameAnimationGraphVariableAttributeCommand", "description": "[omni.anim.graph.core.scripts.command]", "snippet": "omni.kit.commands.execute(\"RenameAnimationGraphVariableAttributeCommand\",\n prim=prim, # pxr.Usd.Prim\n old_attr_name=old_attr_name, # str\n new_attr_name=new_attr_name) # str\n" }, { "title": "RetargetOpenWindowCommand", "description": "[omni.anim.retarget.ui.scripts.commands]", "snippet": "omni.kit.commands.execute(\"RetargetOpenWindowCommand\",\n skel_path=skel_path) # str\n" }, { "title": "RetargetSelectSkeletonCommand", "description": "[omni.anim.retarget.ui.scripts.commands]", "snippet": "omni.kit.commands.execute(\"RetargetSelectSkeletonCommand\",\n skel_path=skel_path) # str\n" }, { "title": "SaveRetargetPoseCommand", "description": "[omni.anim.retarget.core.scripts.commands]", "snippet": "omni.kit.commands.execute(\"SaveRetargetPoseCommand\",\n skel_paths=skel_paths) # list\n" }, { "title": "SaveRetargetPoseTransformCommand", "description": "[omni.anim.retarget.core.scripts.commands]", "snippet": "omni.kit.commands.execute(\"SaveRetargetPoseTransformCommand\",\n skel_paths=skel_paths, # list\n transforms=transforms) # list\n" }, { "title": "SaveSkelPoseCommand", "description": "[omni.anim.skelJoint.savePose]", "snippet": "omni.kit.commands.execute(\"SaveSkelPoseCommand\",\n save_target=save_target)\n" }, { "title": "SelectAnimCurveKeys", "description": "[omni.anim.curve.scripts.commands]\n\n Similar to how we work with the selection list for prims in Kit, we need similar capability in the context\n of animation keyframes. Keyframe (and their tangents) selection is application wide and all commands are\n aware of it. For example, users can select keys programmablely and then use the EditAnimCurveKey command\n to edit the selected keysframe(and their tangents). The selection can go to a global selection clipboard,\n or a user supplied buffer.\n\n @param\n paths: A list of path strings to specify the curves\n 1. Attribute Paths, only the keys/tangents from their animation curves will be selected.\n If the attributes is a vector, the paths element could be a channel-typed path,\n e.g. xformOp:translate|x,\n or a vector-typed path,\n e.g. xformOp:translate,\n which includes all three curves.\n 2. Prim path, keys/tangents from all animation curves associated with all attributes\n from these prims will be considered\n 3. None, All keys/tangents from all animation curves from selected prims in the stage will be considered\n 4. The default value is None\n operation: 1. \"replace\": replace the previous selection\n 2. \"add\": incremental selection\n 3. \u201cremove\u201d: remove the selection from the original list\n 4. \"clear\": clear all the selections from the clipboard or the user buffer\n The default value is \"replace\"\n indices: Can be an integer or list of integers identifying key indices in the considered\n animation curves (see argument path). The default is None.\n times: 1. A float value: only keys/tangents at this time will be considered.\n 2. A tuple2 of float: for example (10, 20)) - only keys/tangents within that range, including, will be considered.\n 3. Can be set to a list of tuple2 for multiple ranges.\n 4. None. the current animation time will be used\n 5. The default is None\n key: A boolean flag, select the key or not. The default is True\n in_tangent: A boolean flag, select the incoming tangent or not. The default is True\n out_tangent: A boolean flag, select the out going tangent or not. The default is True\n selection_state: A KeySelectionState typed user defined buffer to hold the selection state.\n if None, which is the default, the selection state goes to a system global selection clipboard", "snippet": "omni.kit.commands.execute(\"SelectAnimCurveKeys\",\n paths=None, # typing.Union[str, typing.List[str]]\n operation=\"replace\",\n indices=None, # typing.Union[int, typing.List[int]]\n times=None, # typing.Union[float, typing.Tuple[float, float], typing.List[typing.Union[float, typing.Tuple[float, float]]]]\n key=True, # bool\n in_tangent=True, # bool\n out_tangent=True, # bool\n selection_state=None) # omni.anim.curve.scripts.keySelection.KeySelectionState\n" }, { "title": "SetAnimCurveInfinityType", "description": "[omni.anim.curve.scripts.commands]\n\n Set the Infinity loop type for the specified curves\n @param\n paths: 1. curves' path, only Paste keys in these curves e.g. /World/Cube.xformOp:translate|x\n 2. prims' path, Paste keys in all curves of this prim e.g. /World/Cube\n 3. None, move keys in all curves of all the SELECTED prims\n The default value is None\n is_post_infinity: 1. True: set the post infinity type, i.e. how a curve loops after the last key\n 2. False: set the pre infinity type, i.e. how a curve loops before the first key\n The default value is True\n infinity_type: \"constant\", \"cycle\", \"cycleRelative\", \"linear\", \"oscillate\"\n\n @return\n Return True if we successfully Paste the curve without any errors\n Return False if no curve is Paste or there are errors generated\n @example\n SetAnimCurveInfinityType(paths=[\"/World/Cube.xformOp:translate|x\", \"/World/Sphere.radius\"]) # Set post-inifnity for two curves to \"constant\"\n SetAnimCurveInfinityType(paths=[\"/World/Cube.size|x\"]) #Set post-infinity for the attribute size's animation curve as \"constant\"\n SetAnimCurveInfinityType(paths=[\"/World/Cube.xformOp:translate\"]) #Set three curves's post-inifity type for a vector set them as \"constant\"\n SetAnimCurveInfinityType(paths=[\"/World/Cube\"]) #Set all curves' post-infinity type for the Cube prim as \"constant\"\n SetAnimCurveInfinityType() #Set all curves' post-infinity type for the selected prim as \"constant\"\n SetAnimCurveInfinityType(paths=[\"/World/Sphere.visibility\"], is_post_infinity=False) # Set the pre-infinity type for the visibility attribute's curve as \"constant\"\n SetAnimCurveInfinityType(paths=[\"/World/Sphere.visibility\"], is_post_infinity=False, infinity_type=\"cycle\") # Set the pre-infinity type for the visibility attribute's curve as \"cylce\"\n", "snippet": "omni.kit.commands.execute(\"SetAnimCurveInfinityType\",\n paths=None, # list\n is_post_infinity=True, # bool\n infinity_type=\"constant\") # str\n" }, { "title": "SetAnimCurveKeys", "description": "[omni.anim.curve.scripts.commands]\n\n Set keys to the given paths at the given time, with the given value.\n @param\n paths:\n A list of string-typed USD paths. Each path can be one of the three types:\n 1. Prims' path, set xformable attribute keys to the prims.\n 2. Curves' path, set keys to the curve(s)\n 3. None, set keys to the SELECTED prim(s).\n The default value is None.\n We allow a mixture of prims' paths and curves' paths.\n time:\n The time code to set keys at. Can be one of the three types:\n 1. A single element of type float, int, or Usd.TimeCode, specifing the time to set keys at.\n 2. A list of float, int, or Usd.TimeCode. See description for details.\n 3. None, will use the current time.\n The default value is None.\n value:\n The value to set keys with. Can be one of the three types:\n 1. A single scalar or vector.\n 2. A list of scalars or vectors. See description for details.\n 3. None, will use the default value read from USD.\n The default value is None. Must be None if prims' paths are provided.\n preserveCurveShape:\n Preserve the shape of the curve when add a new key between two exsiting keys, if possible. The default value is True.\n If True, `time` and `value` must be None or of length 1.\n If False, the tangent type of the new key will be Auto by default.\n Note that in order to keep the shape, the tangent and the weighted attribute of the two neighbouring keys may be changed.\n This parameter will be ignored silently, when:\n 1. it's impossible to preserve the shape. For example, the user specifies some time and value that don't stay on the curve.\n 2. either `inTangentType` or `outTangentType` is not None.\n inTangentType:\n A string to set the in tangent type of the key. Possible values are None, \"auto\", \"smooth\", \"linear\", \"step\", and \"fixed\".\n The default value is None. If not None, this command will override the tangent types of the target keys. `preserveCurveShape` will be ignored.\n outTangentType:\n A string to set the out tangent type of the key. Possible values are None, \"auto\", \"smooth\", \"linear\", \"step\", and \"fixed\".\n The default value is None. If not None, this command will override the tangent types of the target keys. `preserveCurveShape` will be ignored.\n tangentBreakDown:\n A bool value to indicate if the tangent of the key is broken. True for broken and False for unbroken.\n The default value is False.\n\n @return\n Return True if we successfully set the keys and there are no errors.\n Return False if no keys are added or there are errors.\n\n @description\n 1. If `time` is None or single-element, `value` must be None or single-element also. Vice versa.\n 2. If `time` is a list of elements, `value` must be a list of elements also. Vice versa.\n In addition, the lengths of `time` and `value` must be the same.\n The type of `value`s in the list must be the same.\n\n @example\n 1. SetAnimCurveKeys() # Set keys to the selected prim(s), at the current time, with the default value\n 2. SetAnimCurveKeys(paths=[\"/World/Cube\"]) # Set xformable attribute keys (current time, default value) to /World/Cube\n 3. SetAnimCurveKeys(paths=[\"/World/Cube.xformOp:scale|x\"])\n # Set a key (current time, default value) to the attribute /World/Cube.xformOp:scale|x\n 4. SetAnimCurveKeys(paths=[\"/World/Cube\", \"/World/Cube.xformOp:scale|x\"])\n # The same as executing both 2. and 3.\n 5. SetAnimCurveKeys(paths=[\"/World/Cube.xformOp:scale|x\"], value=2.0, time=Usd.TimeCode(50))\n # Set a key (50, 2.0) to the attribute /World/Cube.xformOp:scale|x\n 6. SetAnimCurveKeys(paths=[\"/World/Cube.xformOp:scale|x\", \"/World/Cube.xformOp:translate|x\"], value=[0.0, 3.14, 2.0], time=[0, 30, 60], preserveCurveShape=False)\n # Set keys (0, 0.0), (30, 3.14), and (60, 2.0) to the two given curves. preserveCurveShape must be set to `False`\n ", "snippet": "omni.kit.commands.execute(\"SetAnimCurveKeys\",\n paths=None, # list\n time=None, # typing.Union[float, int, pxr.Usd.TimeCode, list]\n value=None, # typing.Any\n preserveCurveShape=True, # bool\n inTangentType=None, # typing.Union[str, NoneType]\n outTangentType=None, # typing.Union[str, NoneType]\n tangentBreakDown=False) # bool\n" }, { "title": "SetAnimationGraphVariableAttributeTypeCommand", "description": "[omni.anim.graph.core.scripts.command]", "snippet": "omni.kit.commands.execute(\"SetAnimationGraphVariableAttributeTypeCommand\",\n prim=prim, # pxr.Usd.Prim\n attr_name=attr_name, # str\n new_type=new_type, # pxr.Sdf.ValueTypeName\n new_value=None)\n" }, { "title": "SetAnimationGraphVariableDescriptionCommand", "description": "[omni.anim.graph.core.scripts.command]", "snippet": "omni.kit.commands.execute(\"SetAnimationGraphVariableDescriptionCommand\",\n prim=prim, # pxr.Usd.Prim\n attr_name=attr_name, # str\n description=description) # str\n" }, { "title": "SetKeyframeSliderCommand", "description": "[omni.anim.window.timeline.scripts.keyframe_slider]", "snippet": "omni.kit.commands.execute(\"SetKeyframeSliderCommand\",\n slider=slider, # omni.anim.window.timeline.scripts.keyframe_slider.KeyframeSlider\n start=start, # int\n end=end) # int\n" }, { "title": "SetSkeletonJointTagPairCommand", "description": "[omni.anim.retarget.core.scripts.commands]", "snippet": "omni.kit.commands.execute(\"SetSkeletonJointTagPairCommand\",\n skel_paths=skel_paths, # list\n tag_joint_dict=tag_joint_dict) # typing.Dict[str, str]\n" }, { "title": "SetSkeletonTagsCommand", "description": "[omni.anim.retarget.core.scripts.commands]", "snippet": "omni.kit.commands.execute(\"SetSkeletonTagsCommand\",\n skel_paths=skel_paths, # list\n tags=tags) # pxr.Vt.TokenArray\n" }, { "title": "SetSkeletonUpForwardAxis", "description": "[omni.anim.retarget.core.scripts.commands]", "snippet": "omni.kit.commands.execute(\"SetSkeletonUpForwardAxis\",\n skel_paths=skel_paths, # list\n is_up_axis=is_up_axis, # bool\n axis=axis) # str\n" }, { "title": "ShowKeyframeSliderCommand", "description": "[omni.anim.window.timeline.scripts.keyframe_slider]", "snippet": "omni.kit.commands.execute(\"ShowKeyframeSliderCommand\",\n slider=slider, # omni.anim.window.timeline.scripts.keyframe_slider.KeyframeSlider\n visible=visible) # bool\n" }, { "title": "SimplifyAnimCurves", "description": "[omni.anim.curve.scripts.commands]\n\n Simplifies a curve by removing keys\n @param\n paths: 1. components' path, e.g. /World/Cube.xformOp:rotateXYZ|x\n 2. attributes' path, e.g. /World/Cube.xformOp:translate\n 3. prims' path, e.g. /World/Cube\n\n attribute_mask:\n Only attributes that contain this sting are processed\n\n max_error_percent:\n Maximum allowed error for each removed key, as percentage of curve value range (approximate)\n\n continuous_algorithm:\n Algorithm for to simplify curves with continuous data\n\n compute_tangents:\n True to compute tangents of the sparse curve from the input keys\n\n @example\n SimplifyAnimCurves(paths=[\"/World/Cube.xformOp:translate|x\", \"/World/Sphere.rotateXYZ|z\"]) # Simplifies two components\n SimplifyAnimCurves(paths=[\"/World/Cube.xformOp:translate\") # Simplifies all components\n SimplifyAnimCurves(paths=[\"/World/Cube\") # Simplifies all curves of a prim\n SimplifyAnimCurves() # Simplifies all curves of the selected prim\n SimplifyAnimCurves(max_error_percent=10) # Simplifies curves with approx. 10% allowed error", "snippet": "omni.kit.commands.execute(\"SimplifyAnimCurves\",\n stage=None, # pxr.Usd.Stage\n paths=None, # list\n max_error_percent=1, # float\n attribute_mask=None, # str\n continuous_algorithm=None, # omni.anim.curve.scripts.simplication_utils.SimplificationAlgorithm\n compute_tangents=True)\n" } ] }, { "title": "omni.command", "snippets": [ { "title": "ParentPrimsCommand", "description": "[omni.command.usd.commands.parenting_commands]", "snippet": "omni.kit.commands.execute(\"ParentPrimsCommand\",\n parent_path=parent_path, # str\n child_paths=child_paths, # typing.List[str]\n on_move_fn=None, # callable\n keep_world_transform=True) # bool\n" }, { "title": "SetPayLoadLoadSelectedPrimsCommand", "description": "[omni.command.usd.commands.usd_commands]", "snippet": "omni.kit.commands.execute(\"SetPayLoadLoadSelectedPrimsCommand\",\n selected_paths=selected_paths, # typing.List[str]\n value=value) # bool\n" }, { "title": "TogglePayLoadLoadSelectedPrimsCommand", "description": "[omni.command.usd.commands.usd_commands]", "snippet": "omni.kit.commands.execute(\"TogglePayLoadLoadSelectedPrimsCommand\",\n selected_paths=selected_paths) # typing.List[str]\n" }, { "title": "UnparentPrimsCommand", "description": "[omni.command.usd.commands.parenting_commands]", "snippet": "omni.kit.commands.execute(\"UnparentPrimsCommand\",\n paths=paths, # typing.List[str]\n on_move_fn=None, # callable\n keep_world_transform=True) # bool\n" } ] }, { "title": "omni.curve", "snippets": [ { "title": "AddCvSelection", "description": "[omni.curve.manipulator.scripts.commands]", "snippet": "omni.kit.commands.execute(\"AddCvSelection\",\n selection=selection, # ProxyType[CvSelection]\n basis_curves=basis_curves, # UsdGeom.BasisCurves\n id=id, # int\n clear_previous=clear_previous) # bool\n" }, { "title": "ClearCvSelection", "description": "[omni.curve.manipulator.scripts.commands]", "snippet": "omni.kit.commands.execute(\"ClearCvSelection\",\n selection=selection, # ProxyType[CvSelection]\n basis_curves=None) # UsdGeom.BasisCurves\n" }, { "title": "CreateCurveNodesEntityCommand", "description": "[omni.curve.nodes.scripts.commands]", "snippet": "omni.kit.commands.execute(\"CreateCurveNodesEntityCommand\",\n callback=callback) # typing.Callable[[], typing.List[str]]\n" }, { "title": "CvSelectionBase", "description": "[omni.curve.manipulator.scripts.commands]", "snippet": "omni.kit.commands.execute(\"CvSelectionBase\",\n selection=selection, # ProxyType[CvSelection]\n basis_curves=basis_curves, # UsdGeom.BasisCurves\n id=id) # int\n" }, { "title": "DisableCurveEditing", "description": "[omni.curve.manipulator.scripts.commands]", "snippet": "omni.kit.commands.execute(\"DisableCurveEditing\",\n curve_context=curve_context, # CurveManipulatorContext\n usd_context_name=\"\") # str\n" }, { "title": "EnableCurveEditing", "description": "[omni.curve.manipulator.scripts.commands]", "snippet": "omni.kit.commands.execute(\"EnableCurveEditing\",\n paths=paths, # List[str]\n mode=mode, # CurveEditingModeType\n curve_context=curve_context, # CurveManipulatorContext\n usd_context_name=\"\") # str\n" }, { "title": "RemoveCvSelection", "description": "[omni.curve.manipulator.scripts.commands]", "snippet": "omni.kit.commands.execute(\"RemoveCvSelection\",\n selection=selection, # ProxyType[CvSelection]\n basis_curves=basis_curves, # UsdGeom.BasisCurves\n id=id) # int\n" }, { "title": "SetCvSelection", "description": "[omni.curve.manipulator.scripts.commands]", "snippet": "omni.kit.commands.execute(\"SetCvSelection\",\n selection=selection, # CvSelection\n selected_cvs=selected_cvs) # Set[Tuple[UsdGeom.BasisCurves, int]]\n" } ] }, { "title": "omni.example", "snippets": [ { "title": "SetDisplayColorCommand", "description": "[omni.example.ui.scripts.colorwidget_doc]\n\nChange prim display color undoable. Unlike ChangePropertyCommand, it can undo property creation.\n\nArgs:\n gprim (Gprim): Prim to change display color on.\n value: Value to change to.\n value: Value to undo to.", "snippet": "omni.kit.commands.execute(\"SetDisplayColorCommand\",\n gprim=gprim, # pxr.UsdGeom.Gprim\n color=color, # typing.Any\n prev=prev) # typing.Any\n" } ] }, { "title": "omni.flowusd", "snippets": [ { "title": "FlowCreatePointCloudPresetCommand", "description": "[omni.flowusd.scripts.commands]", "snippet": "omni.kit.commands.execute(\"FlowCreatePointCloudPresetCommand\",\n paths=paths) # str\n" }, { "title": "FlowCreatePresetsCommand", "description": "[omni.flowusd.scripts.commands]", "snippet": "omni.kit.commands.execute(\"FlowCreatePresetsCommand\",\n preset_name=preset_name, # str\n paths=paths, # str\n create_copy=False,\n layer=0)\n" }, { "title": "FlowCreatePrimCommand", "description": "[omni.flowusd.scripts.commands]", "snippet": "omni.kit.commands.execute(\"FlowCreatePrimCommand\",\n prim_path=prim_path, # str\n type_name=type_name, # str\n stage=None) # typing.Union[pxr.Usd.Stage, NoneType]\n" }, { "title": "FlowCreateUsdPresetCommand", "description": "[omni.flowusd.scripts.commands]", "snippet": "omni.kit.commands.execute(\"FlowCreateUsdPresetCommand\",\n path=path, # str\n layer=layer, # int\n preset_name=preset_name, # str\n url=url, # str\n is_copy=is_copy, # bool\n create_ref=create_ref, # bool\n emitter_only=emitter_only) # bool\n" }, { "title": "FlowCreateUsdPresetMultipleCommand", "description": "[omni.flowusd.scripts.commands]", "snippet": "omni.kit.commands.execute(\"FlowCreateUsdPresetMultipleCommand\",\n paths=paths, # list\n preset_name=preset_name, # str\n url=url, # str\n is_copy=is_copy, # bool\n create_ref=create_ref, # bool\n layer=0,\n emitter_only=False,\n is_global=False)\n" }, { "title": "FlowSetRampValuesCommand", "description": "[omni.flowusd.scripts.ramp]", "snippet": "omni.kit.commands.execute(\"FlowSetRampValuesCommand\",\n ramps=ramps)\n" } ] }, { "title": "omni.genproc", "snippets": [ { "title": "CreateGenProcEntityCommand", "description": "[omni.genproc.ui.scripts.commands]", "snippet": "omni.kit.commands.execute(\"CreateGenProcEntityCommand\",\n callback=callback) # typing.Callable[[], typing.List[str]]\n" } ] }, { "title": "omni.graph", "snippets": [ { "title": "ApplyOmniGraphAPICommand", "description": "[omni.graph.core._impl.instancing_commands]", "snippet": "omni.kit.commands.execute(\"ApplyOmniGraphAPICommand\",\n layer=None, # pxr.Sdf.Layer\n paths=None, # typing.Union[typing.List[pxr.Sdf.Path], NoneType]\n graph_path=Sdf.Path.emptyPath) # pxr.Sdf.Path\n" }, { "title": "ChangePipelineStageCommand", "description": "[omni.graph.core._impl.value_commands]\n\nChange Pipeline Stage. Change the pipeline stage of an existing graph.\n\nArgs:\n graph: The graph whose pipeline stage needs to be changed\n new_pipeline_stage: The new pipeline stage of the graph", "snippet": "omni.kit.commands.execute(\"ChangePipelineStageCommand\",\n graph=graph, # omni.graph.core._omni_graph_core.Graph\n new_pipeline_stage=new_pipeline_stage) # omni.graph.core._omni_graph_core.GraphPipelineStage\n" }, { "title": "ConnectAttrWithSubgraphCommand", "description": "[omni.graph.window.core.graph_commands]\n\nConnect with subgraph attribute, since og doesn't support subgraph attribute yet,\nwe cant use `og.cmds.ConnectAttrs`\n\n### Arguments:\n\n `src_path : Sdf.Path`\n The src path of the connection.\n\n `dest_path : Sdf.Path`\n The dest path of the connection.\n\n `stage : Optional[int]`\n The stage it's necessary to create new connection. If None, it takes\n the stage from the USD Context.", "snippet": "omni.kit.commands.execute(\"ConnectAttrWithSubgraphCommand\",\n src_path=src_path, # pxr.Sdf.Path\n dest_path=dest_path, # pxr.Sdf.Path\n allow_remove=True, # bool\n stage=None)\n" }, { "title": "ConnectAttrsCommand", "description": "[omni.graph.core._impl.topology_commands]\n\nConnect Attrs. Causes two attributes to be connected together in the omnigraph\n\nArgs:\n src_attr: The source (upstream) attribute. This can be specified in the form\n of an attribute from a node, or a string that denotes the path to the attribute\n in USD. If specified as a string path, if the node happens to be a prim and\n the prim doesn't yet have prim node created for it, this command will create\n one automatically.\n dest_attr: The destination (downstream) attribute. This can be specified in the form\n of an attribute from a node, or a string that denotes the path to the attribute\n in USD. If specified as a string path, if the node happens to be a prim and\n the prim doesn't yet have prim node created for it, this command will create\n one automatically.\n modify_usd: Whether to modify the underlying usd stage with this connection\n connection_type: Whether this is regular connection or something ore fancy, like data only\n and execution only connections", "snippet": "omni.kit.commands.execute(\"ConnectAttrsCommand\",\n src_attr=src_attr, # typing.Union[str, omni.graph.core._omni_graph_core.Attribute]\n dest_attr=dest_attr, # typing.Union[str, omni.graph.core._omni_graph_core.Attribute]\n modify_usd=modify_usd, # bool\n connection_type=ConnectionType.CONNECTION_TYPE_REGULAR) # omni.graph.core._omni_graph_core.ConnectionType\n" }, { "title": "ConnectPrimCommand", "description": "[omni.graph.core._impl.topology_commands]\n\nConnect Prim. Connects a bundle attribute to a prim. This can be both for\nbundle purposes or for \"pure relationship\" type connections where we just want a relationship\nthat points to a prim, without the connotations associated with bundles.\n\nArgs:\n attr: The relationship attribute. This can be specified in the form\n of an attribute from a node, or a string that denotes the path to the attribute in USD.\n\n prim_path: The path to the prim that is to be the target of the relationship.\n is_bundle_connection: Whether this connection represents a bundle connection or just a\n regular relationship", "snippet": "omni.kit.commands.execute(\"ConnectPrimCommand\",\n attr=attr, # typing.Union[str, omni.graph.core._omni_graph_core.Attribute]\n prim_path=prim_path, # str\n is_bundle_connection=is_bundle_connection) # bool\n" }, { "title": "CreateAttrCommand", "description": "[omni.graph.core._impl.topology_commands]\n\nCreate Attribute. Adds a new dynamic attribute to a node.\n\nArgs:\n node: Node on which to create the attribute (path or og.Node)\n attr_name: Name of the new attribute, either with or without the port namespace\n attr_type: Type of the new attribute, as an OGN type string or og.Type\n attr_port: Port type of the new attribute, default is og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT\n attr_default: The initial value to set on the attribute, default is None, meaning the type's default is used\n attr_extended_type: The extended type of the attribute, default is\n og.ExtendedAttributeType.EXTENDED_ATTR_TYPE_REGULAR. If the extended type is\n og.ExtendedAttributeType.EXTENDED_ATTR_TYPE_UNION then this parameter will be a\n 2-tuple with the second element being a list or comma-separated string of union types\n\nIf there is any problem with the do/undo of the attribute creation a warning is issued and the command fails.", "snippet": "omni.kit.commands.execute(\"CreateAttrCommand\",\n node=node, # typing.Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed]\n attr_name=attr_name, # str\n attr_type=attr_type, # typing.Union[str, omni.graph.core._omni_graph_core.Type]\n attr_port=AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT, # typing.Union[omni.graph.core._omni_graph_core.AttributePortType, NoneType]\n attr_default=None, # typing.Union[typing.Any, NoneType]\n attr_extended_type=ExtendedAttributeType.EXTENDED_ATTR_TYPE_REGULAR) # typing.Union[omni.graph.core._omni_graph_core.AttributePortType, typing.Tuple[omni.graph.core._omni_graph_core.AttributePortType, typing.Union[str, typing.List[str]]], NoneType]\n" }, { "title": "CreateGraphAsNodeCommand", "description": "[omni.graph.core._impl.topology_commands]\n\nCreate Graph As Node. Creates a new graph wrapped by a node.\n\nArgs:\n graph: The graph in which the new wrapper node should be created\n node_name: The name of the node\n graph_path: The path to the graph\n evaluator_name: The name of the evaluator to use for the graph\n is_global_graph: Whether this is a global graph (global level graphs have their own FC)\n backed_by_usd: Whether the constructs are to be backed by USD\n fc_backing_type: What kind of Flatcache backs this graph\n pipeline_stage: What pipeline stage does this graph occupy: simulation, prerender, or postrender\n evaluation_mode: What evaluation mode to use with this graph: Automatic, Standalone or Instanced", "snippet": "omni.kit.commands.execute(\"CreateGraphAsNodeCommand\",\n graph=graph,\n node_name=node_name,\n graph_path=graph_path,\n evaluator_name=evaluator_name,\n is_global_graph=is_global_graph,\n backed_by_usd=backed_by_usd,\n fc_backing_type=fc_backing_type,\n pipeline_stage=pipeline_stage,\n evaluation_mode=GraphEvaluationMode.GRAPH_EVALUATION_MODE_AUTOMATIC)\n" }, { "title": "CreateNodeCommand", "description": "[omni.graph.core._impl.topology_commands]\n\nCreate Node. Creates a new compute node of a particular node type in OmniGraph\n\nArgs:\n graph: The graph in which the new compute node should be created\n node_path: The location in the USD stage to add the new compute node\n node_type: The name of the type of compute node to create\n create_usd: Whether to also create an USD prim on the stage for this node\n\nRaises:\n og.OmniGraphError if a node already exists at the specified node path", "snippet": "omni.kit.commands.execute(\"CreateNodeCommand\",\n graph=graph, # omni.graph.core._omni_graph_core.Graph\n node_path=node_path, # str\n node_type=node_type, # str\n create_usd=create_usd) # bool\n" }, { "title": "CreatePortCommand", "description": "[omni.graph.window.core.graph_commands]\n\nCreate port on the subgraph prim, since og doesn't support subgraph attribute yet\n\n### Arguments:\n\n `prim_path : Sdf.Path`\n The path of the prim we need to add the new port.\n\n `port_name : str`\n The name of the port. The attribute name will be `outputs:port_name`.\n\n `port_type : Sdf.ValueTypeName`\n The type of the port.\n\n `stage : Optional[int]`\n The stage it's necessary to add the new port. If None, it takes\n the stage from the USD Context.", "snippet": "omni.kit.commands.execute(\"CreatePortCommand\",\n prim_path=prim_path, # pxr.Sdf.Path\n port_name=port_name, # str\n port_type=port_type, # pxr.Sdf.ValueTypeName\n stage=None)\n" }, { "title": "CreateSubgraphCommand", "description": "[omni.graph.core._impl.topology_commands]\n\nCreate Subgraph. Creates a new subgraph node in OmniGraph\n\nArgs:\n graph: The graph in which the new compute node should be created\n subgraph_path: The location in the USD stage to add the new compute node", "snippet": "omni.kit.commands.execute(\"CreateSubgraphCommand\",\n graph=graph,\n subgraph_path=subgraph_path,\n evaluator=None,\n create_usd=True)\n" }, { "title": "CreateVariableCommand", "description": "[omni.graph.core._impl.topology_commands]\n\nCreate Variable. Creates a new variable of a particular type in OmniGraph\n\nArgs:\n graph: The graph in which the new variable should be created\n variable_name: The name of the new variable\n variable_type: The OmniGraph type of the new variable\n graph_context: The OmniGraph context to use when setting the initial variable value\n variable_value: The initial variable value", "snippet": "omni.kit.commands.execute(\"CreateVariableCommand\",\n graph=graph, # omni.graph.core._omni_graph_core.Graph\n variable_name=variable_name, # str\n variable_type=variable_type, # omni.graph.core._omni_graph_core.Type\n graph_context=None, # omni.graph.core._omni_graph_core.GraphContext\n variable_value=None)\n" }, { "title": "DeleteNodeCommand", "description": "[omni.graph.core._impl.topology_commands]\n\nDelete Node. Delete the specified node in the graph\n\nArgs:\n graph: The graph in which the new compute node should be created\n node_path: The location in the USD stage to add the new compute node\n modify_usd: Whether to also delete the USD prim on the stage for this node", "snippet": "omni.kit.commands.execute(\"DeleteNodeCommand\",\n graph=graph, # omni.graph.core._omni_graph_core.Graph\n node_path=node_path, # str\n modify_usd=modify_usd) # bool\n" }, { "title": "DisableGraphCommand", "description": "[omni.graph.core._impl.value_commands]\n\nDisable Graph. Causes a graph to be disabled\n\nArgs:\n graph: The graph to disable", "snippet": "omni.kit.commands.execute(\"DisableGraphCommand\",\n graph=graph)\n" }, { "title": "DisableGraphUSDHandlerCommand", "description": "[omni.graph.core._impl.value_commands]\n\nDisable Graph USD Handler. Causes a graph's USD\nnotice handdler to be disabled.\n\nArgs:\n graph: The graph to disable enotice handling", "snippet": "omni.kit.commands.execute(\"DisableGraphUSDHandlerCommand\",\n graph=graph) # omni.graph.core._omni_graph_core.Graph\n" }, { "title": "DisableNodeCommand", "description": "[omni.graph.core._impl.value_commands]\n\nDisable Node. Causes a node to be disabled in the compute graph\n\nArgs:\n node: The node to disable", "snippet": "omni.kit.commands.execute(\"DisableNodeCommand\",\n node=node) # omni.graph.core._omni_graph_core.Node\n" }, { "title": "DisconnectAllAttrsCommand", "description": "[omni.graph.core._impl.topology_commands]\n\nDisconnect All Attrs. Breaks every connection to and from an OmniGraph attribute\n\nArgs:\n attr: The attribute to be disconnected\n modify_usd: Whether to modify the underlying usd stage with this connection", "snippet": "omni.kit.commands.execute(\"DisconnectAllAttrsCommand\",\n attr=attr, # omni.graph.core._omni_graph_core.Attribute\n modify_usd=modify_usd) # bool\n" }, { "title": "DisconnectAttrWithSubgraphCommand", "description": "[omni.graph.window.core.graph_commands]\n\nDisconnect with subgraph attribute, since og doesn't support subgraph attribute yet,\nwe can't use `og.cmds.DisconnectAttrs`\n\n### Arguments:\n\n `src_path : Sdf.Path`\n The src path of the connection.\n\n `dest_path : Sdf.Path`\n The dest path of the connection.\n\n `stage : Optional[int]`\n The stage it's necessary to create new connection. If None, it takes\n the stage from the USD Context.", "snippet": "omni.kit.commands.execute(\"DisconnectAttrWithSubgraphCommand\",\n src_path=src_path, # pxr.Sdf.Path\n dest_path=dest_path, # pxr.Sdf.Path\n stage=None)\n" }, { "title": "DisconnectAttrsBundleCommand", "description": "[omni.graph.window.particle.system.particle_graph_commands]", "snippet": "omni.kit.commands.execute(\"DisconnectAttrsBundleCommand\",\n src_attr=src_attr,\n dest_attr=dest_attr,\n modify_usd=modify_usd)\n" }, { "title": "DisconnectAttrsCommand", "description": "[omni.graph.core._impl.topology_commands]\n\nDisconnect Attrs. Causes two attrs to be disconnected in OmniGraph\n\nArgs:\n src_attr: The source (upstream) attribute\n dest_attr: The destination (downstream) attribute\n modify_usd: Whether to modify the underlying usd stage with this connection", "snippet": "omni.kit.commands.execute(\"DisconnectAttrsCommand\",\n src_attr=src_attr, # typing.Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Attribute, pxr.Usd.Attribute]\n dest_attr=dest_attr, # typing.Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Attribute, pxr.Usd.Attribute]\n modify_usd=modify_usd) # bool\n" }, { "title": "DisconnectPrimCommand", "description": "[omni.graph.core._impl.topology_commands]\n\nDisconnect Prim. Disconnects a bundle attribute from a prim. This can be both for\nbundle purposes or for \"pure relationship\" type connections where we just want a relationship\nthat points to a prim, without the connotations associated with bundles.\n\nArgs:\n attr: The relationship attribute. This can be specified in the form\n of an attribute from a node, or a string that denotes the path to the attribute in USD.\n\n prim_path: The path to the prim that is to be the target of the relationship.\n is_bundle_connection: Whether this connection represents a bundle connection or just a\n regular relationship", "snippet": "omni.kit.commands.execute(\"DisconnectPrimCommand\",\n attr=attr, # typing.Union[str, omni.graph.core._omni_graph_core.Attribute]\n prim_path=prim_path, # str\n is_bundle_connection=is_bundle_connection) # bool\n" }, { "title": "EnableGraphCommand", "description": "[omni.graph.core._impl.value_commands]\n\nEnable Graph. Causes a graph to be enabled\n\nArgs:\n graph: The graph to enable", "snippet": "omni.kit.commands.execute(\"EnableGraphCommand\",\n graph=graph) # omni.graph.core._omni_graph_core.Graph\n" }, { "title": "EnableGraphUSDHandlerCommand", "description": "[omni.graph.core._impl.value_commands]\n\nEnable Graph USD Handler. Causes a graph's USD\nnotice handdler to be enabled.\n\nArgs:\n graph: The graph to enable notice handling", "snippet": "omni.kit.commands.execute(\"EnableGraphUSDHandlerCommand\",\n graph=graph) # omni.graph.core._omni_graph_core.Graph\n" }, { "title": "EnableNodeCommand", "description": "[omni.graph.core._impl.value_commands]\n\nEnable Node. Causes a node to be enabled in the compute graph\n\nArgs:\n node: The node to enable", "snippet": "omni.kit.commands.execute(\"EnableNodeCommand\",\n node=node) # omni.graph.core._omni_graph_core.Node\n" }, { "title": "OGRemoveUsdUIPositionAttrCommand", "description": "[omni.graph.window.core.graph_commands]", "snippet": "omni.kit.commands.execute(\"OGRemoveUsdUIPositionAttrCommand\",\n attribute=attribute, # str\n prim_path=prim_path, # pxr.Sdf.Path\n value=value,\n prev=prev,\n stage=None) # pxr.Usd.Stage\n" }, { "title": "OGSetUsdUINodeGraphNodeAttrCommand", "description": "[omni.graph.window.core.graph_commands]", "snippet": "omni.kit.commands.execute(\"OGSetUsdUINodeGraphNodeAttrCommand\",\n attribute=attribute, # str\n prim_path=prim_path, # pxr.Sdf.Path\n value=value,\n prev=prev,\n stage=None) # pxr.Usd.Stage\n" }, { "title": "RemoveAttrCommand", "description": "[omni.graph.core._impl.topology_commands]\n\nRemove Attribute. Removes an existing dynamic attribute from a node.\n\nArgs:\n attribute: Name of the attribute to be removed\n\nIf there is any problem with the do/undo of the attribute removal a warning is issue and the command fails", "snippet": "omni.kit.commands.execute(\"RemoveAttrCommand\",\n attribute=attribute) # omni.graph.core._omni_graph_core.Attribute\n" }, { "title": "RemoveOmniGraphAPICommand", "description": "[omni.graph.core._impl.instancing_commands]", "snippet": "omni.kit.commands.execute(\"RemoveOmniGraphAPICommand\",\n layer=None, # pxr.Sdf.Layer\n paths=None) # typing.List[pxr.Sdf.Path]\n" }, { "title": "RemoveVariableCommand", "description": "[omni.graph.core._impl.topology_commands]\n\nRemove Variable. Remove the specified variable in the graph\n\nArgs:\n graph: The graph to remove the variable from\n variable: The OmniGraph IVariable to be removed\n graph_context: The OmniGraph context to use when restoring the variable value on undo", "snippet": "omni.kit.commands.execute(\"RemoveVariableCommand\",\n graph=graph, # omni.graph.core._omni_graph_core.Graph\n variable=variable, # omni.graph.core._omni_graph_core.IVariable\n graph_context=None) # omni.graph.core._omni_graph_core.GraphContext\n" }, { "title": "RenameNodeCommand", "description": "[omni.graph.core._impl.value_commands]\n\nRename Node. Renames an existing node in a compute graph\n\nArgs:\n graph: The graph in which the node is located\n path: The location in the USD stage\n new_path: The new path of the node", "snippet": "omni.kit.commands.execute(\"RenameNodeCommand\",\n graph=graph, # omni.graph.core._omni_graph_core.Graph\n path=path, # str\n new_path=new_path) # str\n" }, { "title": "RenameSubgraphCommand", "description": "[omni.graph.core._impl.value_commands]\n\nRename Subgraph. Renames an existing subgraph in a compute graph\n\nArgs:\n graph: The graph in which the subgraph is located\n path: The location in the USD stage\n new_path: The new path of the subgraph", "snippet": "omni.kit.commands.execute(\"RenameSubgraphCommand\",\n graph=graph, # omni.graph.core._omni_graph_core.Graph\n path=path, # str\n new_path=new_path) # str\n" }, { "title": "RenamedClass.<locals>._RenamedClass", "description": "[omni.graph.tools._impl.deprecate]", "snippet": "omni.kit.commands.execute(\"RenamedClass.<locals>._RenamedClass\",\n variable=variable, # omni.graph.core._omni_graph_core.IVariable\n tooltip=tooltip) # str\n" }, { "title": "SetAttrCommand", "description": "[omni.graph.core._impl.value_commands]\n\nSetAttr. Sets the value of an attribute on a node\n\nArgs:\n attr: The attribute to set\n value: The value to set the attribute to\n set_type: The OGN type name to set the attribute to for extended attributes that require Type resolution.\n You can also embed the type in the value using a TypedValue\n on_gpu: If True then set the value in the GPU memory, otherwise CPU memory\n update_usd: If True then immediately propagate the new value to the USD backing, if it exists", "snippet": "omni.kit.commands.execute(\"SetAttrCommand\",\n attr=attr, # omni.graph.core._omni_graph_core.Attribute\n value=value, # typing.Union[typing.Any, omni.graph.core._impl.utils.TypedValue]\n set_type=None, # str\n on_gpu=False, # bool\n update_usd=True) # bool\n" }, { "title": "SetAttrDataCommand", "description": "[omni.graph.core._impl.value_commands]\n\nSetAttrData. Sets the value of an attribute data\n\nArgs:\n attribute_data: The attribute data to set\n value: The value to be set\n graph: The graph to operate on (deprecated and unnecessary)\n on_gpu: If True then set the value in the GPU memory, otherwise CPU memory", "snippet": "omni.kit.commands.execute(\"SetAttrDataCommand\",\n attribute_data=attribute_data, # omni.graph.core._omni_graph_core.AttributeData\n value=value, # typing.Union[typing.Any, omni.graph.core._impl.utils.TypedValue]\n graph=None, # typing.Union[omni.graph.core._omni_graph_core.Graph, NoneType]\n on_gpu=False) # bool\n" }, { "title": "SetEvaluationModeCommand", "description": "[omni.graph.core._impl.value_commands]\n\nSet Evaluation Mode. Change the evaluation mode of an existing graph.\n\nArgs:\n graph: The graph to change the evaluation mode on\n new_evaluation_mode: The new graph evaluation mode", "snippet": "omni.kit.commands.execute(\"SetEvaluationModeCommand\",\n graph=graph, # omni.graph.core._omni_graph_core.Graph\n new_evaluation_mode=new_evaluation_mode) # omni.graph.core._omni_graph_core.GraphEvaluationMode\n" }, { "title": "SetVariableTooltipCommand", "description": "[omni.graph.core._impl.value_commands]\n\nSet Variable Tooltip. Set the tooltip/description of a variable.\n\nArgs:\n variable: The variable to set the tooltip of\n tooltip: The tooltip text to set", "snippet": "omni.kit.commands.execute(\"SetVariableTooltipCommand\",\n variable=variable, # omni.graph.core._omni_graph_core.IVariable\n tooltip=tooltip) # str\n" }, { "title": "SubdivideConnectionCommand", "description": "[omni.graph.window.core.graph_commands]\n\nExample: graph: A->B->C->D->E->F, if A and F are the actual connection, while B and C are the user disconnect ports\nfrom ui. src_to_actual_src will be [B, A] and dest_to_actual_dest will be [C, D, E, F]. While we try to disconnect A\nand F, we need to create the sub-connections between A and F first. This is followed by a `og.cmds.DisconnectAttrs`\ncommand\n### Arguments:\n\n `src_to_actual_src : List[Sdf.Path]`\n This is a list of Sdf.Path from the ui src port until the connected actual src port\n\n `dest_to_actual_dest : List[Sdf.Path]`\n This is a list of Sdf.Path from the ui dest port until the connected actual dest port\n\n `stage : Optional[int]`\n The stage it's necessary to create new connection. If None, it takes\n the stage from the USD Context.", "snippet": "omni.kit.commands.execute(\"SubdivideConnectionCommand\",\n src_to_actual_src=src_to_actual_src, # typing.List[pxr.Sdf.Path]\n dest_to_actual_dest=dest_to_actual_dest, # typing.List[pxr.Sdf.Path]\n stage=None)\n" }, { "title": "_OGRestoreConnectionsOnUndo", "description": "[omni.graph.core._impl.topology_commands]\n\nRestore connections between OG nodes on undo. (Does nothing on do or redo.)\n\nThis command is for internal use only. It may be changed or removed\nwithout notice.\n\nArgs:\n connections (List[(str, str)])\n The connections to be restored. Each element of the list is a tuple\n containing the path strings for the source and destination attributes.", "snippet": "omni.kit.commands.execute(\"_OGRestoreConnectionsOnUndo\",\n connections=connections) # typing.List[typing.Tuple[str, str]]\n" } ] }, { "title": "omni.isaac", "snippets": [ { "title": "CreateSurfaceGripper", "description": "[omni.isaac.surface_gripper.scripts.commands]\n\nCreates Action graph containing a Surface Gripper node, and all prims to facilitate its creation\n\nTypical usage example:\n\n.. code-block:: python\n\n result, prim = omni.kit.commands.execute(\n \"CreateSurfaceGripper\",\n prim_name=\"SurfaceGripperActionGraph\",\n conveyor_prim=\"/SurfaceGripperRigidBody\"\n )", "snippet": "omni.kit.commands.execute(\"CreateSurfaceGripper\",\n prim_name=\"SurfaceGripperActionGraph\", # str\n surface_gripper_prim=None)\n" }, { "title": "DiffUSD", "description": "[omni.isaac.diff_usd.extension]\n\nThe DiffUSD command compares two selected prims using difflib's unified diff format.", "snippet": "omni.kit.commands.execute(\"DiffUSD\",\n text_diff=False)\n" }, { "title": "IsaacSensorCreateContactSensor", "description": "[omni.isaac.sensor.scripts.commands]", "snippet": "omni.kit.commands.execute(\"IsaacSensorCreateContactSensor\",\n path=\"/Contact_Sensor\", # str\n parent=None, # str\n visualize=False, # bool\n min_threshold=0, # float\n max_threshold=100000, # float\n color=(1, 1, 1, 1), # pxr.Gf.Vec4f\n radius=-1, # float\n sensor_period=-1, # float\n translation=(0, 0, 0)) # pxr.Gf.Vec3d\n" }, { "title": "IsaacSensorCreateImuSensor", "description": "[omni.isaac.sensor.scripts.commands]", "snippet": "omni.kit.commands.execute(\"IsaacSensorCreateImuSensor\",\n path=\"/Imu_Sensor\", # str\n parent=None, # str\n visualize=False, # bool\n sensor_period=-1, # float\n translation=(0, 0, 0), # pxr.Gf.Vec3d\n orientation=(1, 0, 0, 0)) # pxr.Gf.Quatd\n" }, { "title": "IsaacSensorCreatePrim", "description": "[omni.isaac.sensor.scripts.commands]", "snippet": "omni.kit.commands.execute(\"IsaacSensorCreatePrim\",\n path=\"\", # str\n parent=\"\", # str\n visualize=False, # bool\n translation=(0, 0, 0), # pxr.Gf.Vec3d\n orientation=(1, 0, 0, 0), # pxr.Gf.Quatd\n schema_type=omni.isaac.IsaacSensorSchema.IsaacBaseSensor)\n" }, { "title": "IsaacSensorCreateRtxLidar", "description": "[omni.isaac.sensor.scripts.commands]", "snippet": "omni.kit.commands.execute(\"IsaacSensorCreateRtxLidar\",\n path=\"/RtxLidar\", # str\n parent=None, # str\n config=\"Example_Rotary\", # str\n translation=(0, 0, 0), # pxr.Gf.Vec3d\n orientation=(1, 0, 0, 0)) # pxr.Gf.Quatd\n" }, { "title": "IsaacSensorCreateRtxRadar", "description": "[omni.isaac.sensor.scripts.commands]", "snippet": "omni.kit.commands.execute(\"IsaacSensorCreateRtxRadar\",\n path=\"/RtxRadar\", # str\n parent=None, # str\n config=\"Example\", # str\n translation=(0, 0, 0), # pxr.Gf.Vec3d\n orientation=(1, 0, 0, 0)) # pxr.Gf.Quatd\n" }, { "title": "IsaacSimDestroyPrim", "description": "[omni.isaac.utils.scripts.commands]\n\nCommand to set a delete a prim. This variant has less overhead than other commands as it doesn't store an undo operation\n\n Typical usage example:\n\n .. code-block:: python\n\n omni.kit.commands.execute(\n \"IsaacSimDestroyPrim\",\n prim_path=\"/World/Prim,\n )", "snippet": "omni.kit.commands.execute(\"IsaacSimDestroyPrim\",\n prim_path=prim_path) # str\n" }, { "title": "IsaacSimScalePrim", "description": "[omni.isaac.utils.scripts.commands]\n\nCommand to set a scale of a prim\n\n Typical usage example:\n\n .. code-block:: python\n\n omni.kit.commands.execute(\n \"IsaacSimScalePrim\",\n prim_path=\"/World/Prim,\n scale=(1.5, 1.5, 1.5),\n )", "snippet": "omni.kit.commands.execute(\"IsaacSimScalePrim\",\n prim_path=prim_path, # str\n scale=(0, 0, 0)) # carb._carb.Float3\n" }, { "title": "IsaacSimSpawnPrim", "description": "[omni.isaac.utils.scripts.commands]\n\nCommand to spawn a new prim in the stage and set its transform. This uses dynamic_control to properly handle physics objects and articulation\n\n Typical usage example:\n\n .. code-block:: python\n\n omni.kit.commands.execute(\n \"IsaacSimSpawnPrim\",\n usd_path=\"/path/to/file.usd\",\n prim_path=\"/World/Prim,\n translation=(0, 0, 0),\n rotation=(0, 0, 0, 1),\n )", "snippet": "omni.kit.commands.execute(\"IsaacSimSpawnPrim\",\n usd_path=usd_path, # str\n prim_path=prim_path, # str\n translation=(0, 0, 0), # carb._carb.Float3\n rotation=(0, 0, 0, 1)) # carb._carb.Float4\n" }, { "title": "IsaacSimTeleportPrim", "description": "[omni.isaac.utils.scripts.commands]\n\nCommand to set a transform of a prim. This uses dynamic_control to properly handle physics objects and articulation\n\n Typical usage example:\n\n .. code-block:: python\n\n omni.kit.commands.execute(\n \"IsaacSimTeleportPrim\",\n prim_path=\"/World/Prim,\n translation=(0, 0, 0),\n rotation=(0, 0, 0, 1),\n )", "snippet": "omni.kit.commands.execute(\"IsaacSimTeleportPrim\",\n prim_path=prim_path, # str\n translation=(0, 0, 0), # carb._carb.Float3\n rotation=(0, 0, 0, 1)) # carb._carb.Float4\n" }, { "title": "MJCFCreateAsset", "description": "[omni.isaac.mjcf.scripts.commands]\n\nThis command parses and imports a given mjcf file.\n\nArgs:\n arg0 (:obj:`str`): The absolute path the mjcf file\n\n arg1 (:obj:`omni.isaac.mjcf._mjcf.ImportConfig`): Import configuration\n\n arg2 (:obj:`str`): Path to the robot on the USD stage\n\n arg3 (:obj:`str`): destination path for robot usd. Default is \"\" which will load the robot in-memory on the open stage.\n", "snippet": "omni.kit.commands.execute(\"MJCFCreateAsset\",\n mjcf_path=\"\", # str\n import_config=<omni.isaac.mjcf._mjcf.ImportConfig object at 0x7f756551e1b0>,\n prim_path=\"\", # str\n dest_path=\"\") # str\n" }, { "title": "MJCFCreateImportConfig", "description": "[omni.isaac.mjcf.scripts.commands]\n\nReturns an ImportConfig object that can be used while parsing and importing.\nShould be used with the `MJCFCreateAsset` command\n\nReturns:\n :obj:`omni.isaac.mjcf._mjcf.ImportConfig`: Parsed MJCF stored in an internal structure.\n", "snippet": "omni.kit.commands.execute(\"MJCFCreateImportConfig\")\n" }, { "title": "RangeSensorCreateGeneric", "description": "[omni.isaac.range_sensor.scripts.commands]\n\nCommands class to create a generic range sensor.\n\n Typical usage example:\n\n .. code-block:: python\n\n result, prim = omni.kit.commands.execute(\n \"RangeSensorCreateGeneric\",\n path=\"/GenericSensor\",\n parent=None,\n min_range=0.4,\n max_range=100.0,\n draw_points=False,\n draw_lines=False,\n sampling_rate=60,\n )", "snippet": "omni.kit.commands.execute(\"RangeSensorCreateGeneric\",\n path=\"/GenericSensor\", # str\n parent=None,\n min_range=0.4, # float\n max_range=100.0, # float\n draw_points=False, # bool\n draw_lines=False, # bool\n sampling_rate=60) # int\n" }, { "title": "RangeSensorCreateLidar", "description": "[omni.isaac.range_sensor.scripts.commands]\n\nCommands class to create a lidar sensor.\n\n Typical usage example:\n\n .. code-block:: python\n\n result, prim = omni.kit.commands.execute(\n \"RangeSensorCreateLidar\",\n path=\"/Lidar\",\n parent=None,\n min_range=0.4,\n max_range=100.0,\n draw_points=False,\n draw_lines=False,\n horizontal_fov=360.0,\n vertical_fov=30.0,\n horizontal_resolution=0.4,\n vertical_resolution=4.0,\n rotation_rate=20.0,\n high_lod=False,\n yaw_offset=0.0,\n enable_semantics=False,\n )", "snippet": "omni.kit.commands.execute(\"RangeSensorCreateLidar\",\n path=\"/Lidar\", # str\n parent=None,\n min_range=0.4, # float\n max_range=100.0, # float\n draw_points=False, # bool\n draw_lines=False, # bool\n horizontal_fov=360.0, # float\n vertical_fov=30.0, # float\n horizontal_resolution=0.4, # float\n vertical_resolution=4.0, # float\n rotation_rate=20.0, # float\n high_lod=False, # bool\n yaw_offset=0.0, # float\n enable_semantics=False) # bool\n" }, { "title": "RangeSensorCreatePrim", "description": "[omni.isaac.range_sensor.scripts.commands]", "snippet": "omni.kit.commands.execute(\"RangeSensorCreatePrim\",\n path=\"\", # str\n parent=\"\", # str\n scehma_type=omni.isaac.RangeSensorSchema.RangeSensor,\n min_range=0.4, # float\n max_range=100.0, # float\n draw_points=False, # bool\n draw_lines=False) # bool\n" }, { "title": "RangeSensorCreateUltrasonicArray", "description": "[omni.isaac.range_sensor.scripts.commands]\n\nCommands class to create an ultrasonic array.\n\n Typical usage example:\n\n .. code-block:: python\n\n result, prim = omni.kit.commands.execute(\n \"RangeSensorCreateUltrasonicArray\",\n path=\"/UltrasonicArray\",\n parent=None,\n min_range=0.4,\n max_range=3.0,\n draw_points=False,\n draw_lines=False,\n horizontal_fov=15.0,\n vertical_fov=10.0,\n horizontal_resolution=0.5,\n vertical_resolution=0.5,\n num_bins=224,\n use_brdf: bool = False,\n use_uss_materials: bool = False,\n emitter_prims=[],\n firing_group_prims=[],\n )", "snippet": "omni.kit.commands.execute(\"RangeSensorCreateUltrasonicArray\",\n path=\"/UltrasonicArray\", # str\n parent=None,\n min_range=0.4, # float\n max_range=100.0, # float\n draw_points=False, # bool\n draw_lines=False, # bool\n horizontal_fov=360.0, # float\n vertical_fov=30.0, # float\n rotation_rate=20.0, # float\n horizontal_resolution=0.4, # float\n vertical_resolution=4.0, # float\n num_bins=224, # int\n use_brdf=False, # bool\n use_uss_materials=False, # bool\n emitter_prims=[], # []\n firing_group_prims=[]) # []\n" }, { "title": "RangeSensorCreateUltrasonicEmitter", "description": "[omni.isaac.range_sensor.scripts.commands]\n\nCommands class to create an ultrasonic emitter.\n\n Typical usage example:\n\n .. code-block:: python\n\n result, prim = omni.kit.commands.execute(\n \"RangeSensorCreateUltrasonicEmitter\",\n path=\"/UltrasonicEmitter\",\n parent=None,\n per_ray_intensity=1.0,\n yaw_offset=0.0,\n adjacency_list=[],\n )", "snippet": "omni.kit.commands.execute(\"RangeSensorCreateUltrasonicEmitter\",\n path=\"/UltrasonicEmitter\", # str\n parent=None,\n per_ray_intensity=1.0, # float\n yaw_offset=0.0, # float\n adjacency_list=[]) # []\n" }, { "title": "RangeSensorCreateUltrasonicFiringGroup", "description": "[omni.isaac.range_sensor.scripts.commands]\n\nCommands class to create an ultrasonic firing group.\n\n Typical usage example:\n\n .. code-block:: python\n\n result, prim = omni.kit.commands.execute(\n \"RangeSensorCreateUltrasonicFiringGroup\",\n path=\"/UltrasonicFiringGroup\",\n parent=None,\n emitter_modes=[],\n receiver_modes=[],\n )", "snippet": "omni.kit.commands.execute(\"RangeSensorCreateUltrasonicFiringGroup\",\n path=\"/UltrasonicFiringGroup\", # str\n parent=None,\n emitter_modes=[], # []\n receiver_modes=[]) # []\n" }, { "title": "URDFCreateImportConfig", "description": "[omni.isaac.urdf.scripts.commands]\n\nReturns an ImportConfig object that can be used while parsing and importing.\nShould be used with `URDFParseFile` and `URDFParseAndImportFile` commands\n\nReturns:\n :obj:`omni.isaac.urdf._urdf.ImportConfig`: Parsed URDF stored in an internal structure.\n", "snippet": "omni.kit.commands.execute(\"URDFCreateImportConfig\")\n" }, { "title": "URDFParseAndImportFile", "description": "[omni.isaac.urdf.scripts.commands]\n\nThis command parses and imports a given urdf and returns a UrdfRobot object\n\nArgs:\n arg0 (:obj:`str`): The absolute path to where the urdf file is\n\n arg1 (:obj:`omni.isaac.urdf._urdf.ImportConfig`): Import Configuration\n\n arg2 (:obj:`str`): destination path for robot usd. Default is \"\" which will load the robot in-memory on the open stage.\n\nReturns:\n :obj:`str`: Path to the robot on the USD stage.", "snippet": "omni.kit.commands.execute(\"URDFParseAndImportFile\",\n urdf_path=\"\", # str\n import_config=<omni.isaac.urdf._urdf.ImportConfig object at 0x7f7501ece5f0>,\n dest_path=\"\") # str\n" }, { "title": "URDFParseFile", "description": "[omni.isaac.urdf.scripts.commands]\n\nThis command parses a given urdf and returns a UrdfRobot object\n\nArgs:\n arg0 (:obj:`str`): The absolute path to where the urdf file is\n\n arg1 (:obj:`omni.isaac.urdf._urdf.ImportConfig`): Import Configuration\n\nReturns:\n :obj:`omni.isaac.urdf._urdf.UrdfRobot`: Parsed URDF stored in an internal structure.", "snippet": "omni.kit.commands.execute(\"URDFParseFile\",\n urdf_path=\"\", # str\n import_config=<omni.isaac.urdf._urdf.ImportConfig object at 0x7f7501ece5b0>) # omni.isaac.urdf._urdf.ImportConfig\n" } ] }, { "title": "omni.kit", "snippets": [ { "title": "AbstractLayerCommand", "description": "[omni.kit.usd.layers.impl.layer_commands]\n\nAbstract base class for layer commands.\nIt's mainly responsible to create a commmon class\nto recover layer selection in layer window, and\nedit target for USD Stage in undo.", "snippet": "omni.kit.commands.execute(\"AbstractLayerCommand\",\n context_name_or_instance=\"\") # typing.Union[str, omni.usd._usd.UsdContext]\n" }, { "title": "AddItemToCollection", "description": "[omni.kit.core.collection.commands]", "snippet": "omni.kit.commands.execute(\"AddItemToCollection\",\n path_to_add=path_to_add, # str\n collection_path=collection_path, # str\n usd_context_name=\"\") # str\n" }, { "title": "AddSbsarReferenceAndBindCommand", "description": "[omni.kit.property.sbsar.commands]", "snippet": "omni.kit.commands.execute(\"AddSbsarReferenceAndBindCommand\",\n sbsar_path=sbsar_path,\n target_prim_path=\"\",\n usd_context_name=\"\")\n" }, { "title": "AddXformOpCommand", "description": "[omni.kit.property.transform.scripts.transform_commands]\n\nAdd and attritube's corresponding XformOp to xformOpOrder.\n\nArgs:\n op_attr_path (str): path of the xformOp attribute.\nExample: \n We might want to add xformOp:translate to the xformOpOrder token array\n Provided that xformOp:translate attribute exists and xformOp:translate is no in xformOpOrder", "snippet": "omni.kit.commands.execute(\"AddXformOpCommand\",\n payload=payload,\n precision=precision,\n rotation_order=rotation_order,\n add_translate_op=add_translate_op,\n add_rotateXYZ_op=add_rotateXYZ_op,\n add_orient_op=add_orient_op,\n add_scale_op=add_scale_op,\n add_transform_op=add_transform_op,\n add_pivot_op=add_pivot_op)\n" }, { "title": "ApplySbsarOverridesCommand", "description": "[omni.kit.property.sbsar.commands]\n\nApplySbsarOverrides. Applies current `inputs:sbsar:` USD attributes to the corresponding payload arguments\n\nArgs:\n stage: The USD Stage\n prim_paths: List of Material prim paths to process\n reset: When true, values will be reset to their default and applied", "snippet": "omni.kit.commands.execute(\"ApplySbsarOverridesCommand\",\n prim_paths=prim_paths,\n reset=False,\n usd_context_name=\"\")\n" }, { "title": "ApplyScriptingAPICommand", "description": "[omni.kit.scripting.scripts.command]", "snippet": "omni.kit.commands.execute(\"ApplyScriptingAPICommand\",\n layer=None, # pxr.Sdf.Layer\n paths=[]) # typing.List[pxr.Sdf.Path]\n" }, { "title": "ApplySkelBindingAPICommand", "description": "[omni.kit.property.skel.scripts.command]", "snippet": "omni.kit.commands.execute(\"ApplySkelBindingAPICommand\",\n layer=None, # pxr.Sdf.Layer\n paths=[]) # typing.List[pxr.Sdf.Path]\n" }, { "title": "BakeAndReplaceSbsarMaterialCommand", "description": "[omni.kit.property.sbsar.commands]", "snippet": "omni.kit.commands.execute(\"BakeAndReplaceSbsarMaterialCommand\",\n material_prim_path=\"\",\n output_folder=\"\",\n preset=\"__default__\",\n resolution=\"RES_KEEP\",\n usd_context_name=\"\")\n" }, { "title": "BindMaterialExtCommand", "description": "[omni.kit.property.physx.externals]", "snippet": "omni.kit.commands.execute(\"BindMaterialExtCommand\",\n prim_path=prim_path, # typing.Union[str, list]\n material_path=material_path, # str\n strength=None,\n material_purpose=\"\")\n" }, { "title": "BlockCollection", "description": "[omni.kit.core.collection.commands]", "snippet": "omni.kit.commands.execute(\"BlockCollection\",\n collection_path=collection_path, # str\n usd_context_name=\"\") # str\n" }, { "title": "ChangePrimVarCommand", "description": "[omni.kit.browser.material.commands]\n\nChange prim var undoable.\n\nArgs:\n prim_path (str): Prim path.\n primvar_name (str): Name of primvar\n value: Value to change to.\n prev: Value to undo to. Default is None, means to use previous primvar value if exists.\n type_to_create_if_not_exist: If not None AND primvar does not already exist, a new primvar will be created with given type and value.", "snippet": "omni.kit.commands.execute(\"ChangePrimVarCommand\",\n prim_path=prim_path, # str\n primvar_name=primvar_name, # str\n value=value, # typing.Any\n prev=None, # typing.Any\n type_to_create_if_not_exist=None) # pxr.Sdf.ValueTypeNames\n" }, { "title": "ChangeRotationOpCommand", "description": "[omni.kit.property.transform.scripts.transform_commands]\n\nChange the Rotation XformOp.\n\nArgs:\n src_op_attr_path (str): path of the source xformOp attribute.\n dst_op_attr_name (str): path of the destination xformOp attribute\n is_inverse_op (bool): if it is an inverse op, add an !invert! in the xformOpOrder\nExample: \n We may want to change from xformOp:rotateZYX to xformOp:rotateXYZ. It will\n 1) update the xformOpOrder\n 2) delete xformOp:rotateZYX attribute\n 3) create xformOp:rotateXYZ attribute\n 4) copy the xformOp:rotateZYX to xfomOp:rotateXYZ", "snippet": "omni.kit.commands.execute(\"ChangeRotationOpCommand\",\n src_op_attr_path=src_op_attr_path, # str\n op_name=op_name, # str\n dst_op_attr_name=dst_op_attr_name, # str\n is_inverse_op=is_inverse_op) # bool\n" }, { "title": "ChangeSettingCommand", "description": "[omni.kit.commands.builtin.settings_commands]\n\nChange setting.\n\nArgs:\n path: Path to the setting to change.\n value: New value to change to.\n prev: Previous value to for undo operation. If `None` current value would be saved as previous.", "snippet": "omni.kit.commands.execute(\"ChangeSettingCommand\",\n path=path,\n value=value,\n prev=None)\n" }, { "title": "ClearCollection", "description": "[omni.kit.core.collection.commands]", "snippet": "omni.kit.commands.execute(\"ClearCollection\",\n collection_path=collection_path, # str\n usd_context_name=\"\") # str\n" }, { "title": "Command", "description": "[omni.kit.commands.command]\n\nBase class for all **Commands**.", "snippet": "omni.kit.commands.execute(\"Command\")\n" }, { "title": "ConnectUsdShadeToSourceCommand", "description": "[omni.kit.window.material_graph.usdshade_commands]\n\nUndoable UsdShade.Input.ConnectToSource", "snippet": "omni.kit.commands.execute(\"ConnectUsdShadeToSourceCommand\",\n target=target, # pxr.UsdShade.Input\n source=source) # pxr.UsdShade.Output\n" }, { "title": "CreateAbstractPortCommand", "description": "[omni.kit.window.material_graph.usdshade_commands]\n\nBase class for CreateInputPortCommand and for CreateOutputPortCommand\nthat has the shared code for both.", "snippet": "omni.kit.commands.execute(\"CreateAbstractPortCommand\",\n prim_path=prim_path, # pxr.Sdf.Path\n port_name=port_name, # str\n port_type=port_type, # pxr.Sdf.ValueTypeName\n stage=None)\n" }, { "title": "CreateAndBindMdlMaterialFromLibrary", "description": "[omni.kit.material.library.material_library]\n\nCreates material prim from Core MDL Libray, and bind to provided prim list.\n\nArgs:\n mdl_name (str): MDL name from Core MDL Library.\n mtl_name (str): The material name from MDL. It's also the sub-identifier to be used for the shader.\n If `prim_name` param is not specified, it will also be used as the prim_name. If mtl_name is empty,\n it will use file name of `mdl_name` (without extension) by default.\n bind_selected_prims (List[Sdf.Path]): Prims to be bound to the new created material prim.\n select_new_prim: If it's to select the new created material prim.\n prim_name (str): The prim name to be created. It will be created with path \"/$RootPrimName/Looks/$prim_name\".\n If prim_name is not specified, it will use `mtl_name` instead.\n", "snippet": "omni.kit.commands.execute(\"CreateAndBindMdlMaterialFromLibrary\",\n mdl_name=mdl_name, # str\n mtl_name=\"\", # str\n mtl_created_list=None, # list\n bind_selected_prims=False, # list\n select_new_prim=True, # bool\n prim_name=\"\") # str\n" }, { "title": "CreateAndBindPreviewSurfaceFromLibrary", "description": "[omni.kit.material.library.material_library]", "snippet": "omni.kit.commands.execute(\"CreateAndBindPreviewSurfaceFromLibrary\",\n mtl_created_list=None, # list\n bind_selected_prims=False) # list\n" }, { "title": "CreateAndBindPreviewSurfaceTextureFromLibrary", "description": "[omni.kit.material.library.material_library]", "snippet": "omni.kit.commands.execute(\"CreateAndBindPreviewSurfaceTextureFromLibrary\",\n mtl_created_list=None, # list\n bind_selected_prims=False) # list\n" }, { "title": "CreateCapsule", "description": "[omni.kit.quicksearch.commands.quick_commands]", "snippet": "omni.kit.commands.execute(\"CreateCapsule\")\n" }, { "title": "CreateCollection", "description": "[omni.kit.core.collection.commands]", "snippet": "omni.kit.commands.execute(\"CreateCollection\",\n prim_path=prim_path, # str\n collection_name=\"\", # str\n usd_context_name=\"\") # str\n" }, { "title": "CreateCone", "description": "[omni.kit.quicksearch.commands.quick_commands]", "snippet": "omni.kit.commands.execute(\"CreateCone\")\n" }, { "title": "CreateCube", "description": "[omni.kit.quicksearch.commands.quick_commands]", "snippet": "omni.kit.commands.execute(\"CreateCube\")\n" }, { "title": "CreateCylinder", "description": "[omni.kit.quicksearch.commands.quick_commands]", "snippet": "omni.kit.commands.execute(\"CreateCylinder\")\n" }, { "title": "CreateDynamicSkyCommand", "description": "[omni.kit.environment.core.sky.commands]\n\nCreate dynamic sky undoable.\n\nArgs:\n sky_url (str): Url of sky\n sky_path (str): Prim path to create sky", "snippet": "omni.kit.commands.execute(\"CreateDynamicSkyCommand\",\n sky_url=sky_url, # str\n sky_path=sky_path) # str\n" }, { "title": "CreateGroundCommand", "description": "[omni.kit.environment.core.ground.commands]", "snippet": "omni.kit.commands.execute(\"CreateGroundCommand\",\n prim_path=\"/Environment/ground\", # str\n ground_size=100) # float\n" }, { "title": "CreateHdriSkyCommand", "description": "[omni.kit.environment.core.sky.commands]\n\nCreate hdri sky undoable.\n\nArgs:\n sky_url (str): Url of sky\n sky_path (str): Prim path to create sky", "snippet": "omni.kit.commands.execute(\"CreateHdriSkyCommand\",\n sky_url=sky_url, # str\n sky_path=sky_path) # str\n" }, { "title": "CreateInputPortCommand", "description": "[omni.kit.window.material_graph.usdshade_commands]\n\nCreate connectable input on the prim\n\n### Arguments:\n\n `prim_path : Sdf.Path`\n The path of the prim we need to add the new port.\n\n `port_name : str`\n The name of the port. The attribute name will be `inputs:port_name`.\n\n `port_type : Sdf.ValueTypeName`\n The type of the port.\n\n `stage : Optional[int]`\n The stage it's necessary to add the new prim. If None, it takes\n the stage from the USD Context.", "snippet": "omni.kit.commands.execute(\"CreateInputPortCommand\",\n prim_path=prim_path, # pxr.Sdf.Path\n port_name=port_name, # str\n port_type=port_type, # pxr.Sdf.ValueTypeName\n stage=None)\n" }, { "title": "CreateLayerReferenceCommand", "description": "[omni.kit.usd.layers.impl.layer_commands]\n\nCreate reference in specific layer undoable.\n\nIt creates a new prim and adds the asset and path as references in specific layer.\n\nArgs:\n layer_identifier: str: Layer identifier to create prim inside.\n \n path_to (Sdf.Path): Path to create a new prim.\n \n asset_path (str): The asset it's necessary to add to references.\n \n prim_path (Sdf.Path): The prim in asset to reference.\n \n usd_context (Union[str, omni.usd.UsdContext]): Usd context name or instance. It uses default context if it's empty.", "snippet": "omni.kit.commands.execute(\"CreateLayerReferenceCommand\",\n layer_identifier=layer_identifier, # str\n path_to=path_to, # pxr.Sdf.Path\n asset_path=None, # str\n prim_path=None, # pxr.Sdf.Path\n usd_context=\"\") # typing.Union[str, omni.usd._usd.UsdContext]\n" }, { "title": "CreateMeasureToolEntityCommand", "description": "[omni.kit.tool.measure.scripts.common.commands]", "snippet": "omni.kit.commands.execute(\"CreateMeasureToolEntityCommand\",\n callback=callback) # typing.Callable[[], typing.Tuple[typing.List[str], typing.Union[int, NoneType]]]\n" }, { "title": "CreateMeshPrimCommand", "description": "[omni.kit.primitive.mesh.command]", "snippet": "omni.kit.commands.execute(\"CreateMeshPrimCommand\",\n prim_type=prim_type) # str\n" }, { "title": "CreateMeshPrimWithDefaultXformCommand", "description": "[omni.kit.primitive.mesh.command]", "snippet": "omni.kit.commands.execute(\"CreateMeshPrimWithDefaultXformCommand\",\n prim_type=prim_type) # str\n" }, { "title": "CreateOutputPortCommand", "description": "[omni.kit.window.material_graph.usdshade_commands]\n\nCreate connectable output on the prim\n\n### Arguments:\n\n `prim_path : Sdf.Path`\n The path of the prim we need to add the new port.\n\n `port_name : str`\n The name of the port. The attribute name will be `outputs:port_name`.\n\n `port_type : Sdf.ValueTypeName`\n The type of the port.\n\n `stage : Optional[int]`\n The stage it's necessary to add the new prim. If None, it takes\n the stage from the USD Context.", "snippet": "omni.kit.commands.execute(\"CreateOutputPortCommand\",\n prim_path=prim_path, # pxr.Sdf.Path\n port_name=port_name, # str\n port_type=port_type, # pxr.Sdf.ValueTypeName\n stage=None)\n" }, { "title": "CreateSphere", "description": "[omni.kit.quicksearch.commands.quick_commands]", "snippet": "omni.kit.commands.execute(\"CreateSphere\")\n" }, { "title": "CreateSublayerCommand", "description": "[omni.kit.usd.layers.impl.layer_commands]\n\nCreate Sublayer undoable.", "snippet": "omni.kit.commands.execute(\"CreateSublayerCommand\",\n layer_identifier=layer_identifier, # str\n sublayer_position=sublayer_position, # int\n new_layer_path=new_layer_path, # str\n transfer_root_content=transfer_root_content, # bool\n create_or_insert=create_or_insert, # bool\n layer_name=\"\", # str\n usd_context=\"\") # typing.Union[str, omni.usd._usd.UsdContext]\n" }, { "title": "CreateUsdUIBackdropCommand", "description": "[omni.kit.graph.usd.commands.commands]", "snippet": "omni.kit.commands.execute(\"CreateUsdUIBackdropCommand\",\n parent_path=parent_path, # pxr.Sdf.Path\n identifier=identifier, # str\n position=None, # typing.Union[typing.Tuple[float], NoneType]\n size=None, # typing.Union[typing.Tuple[float], NoneType]\n display_color=None, # typing.Union[typing.Tuple[float], NoneType]\n stage=None) # typing.Union[pxr.Usd.Stage, NoneType]\n" }, { "title": "DebugBreak", "description": "[omni.kit.debug.vscode_debugger]", "snippet": "omni.kit.commands.execute(\"DebugBreak\")\n" }, { "title": "DeleteCollection", "description": "[omni.kit.core.collection.commands]", "snippet": "omni.kit.commands.execute(\"DeleteCollection\",\n collection_path=collection_path, # str\n usd_context_name=\"\") # str\n" }, { "title": "DuplicateCameraCommand", "description": "[omni.kit.viewport.menubar.camera.commands]\n\nDuplicates a camera at a specific time\n\nArgs:\n camera_path (str): name of the camera to duplicate.\n time (float): Time at which to duplicate, or None to use active time\n usd_context_name (str): The name of a valid omni.UsdContext to target\n new_camera_path (str): Path to create the new camera at (None for automatic path)", "snippet": "omni.kit.commands.execute(\"DuplicateCameraCommand\",\n camera_path=\"\", # str\n time=None, # float\n usd_context_name=\"\", # str\n new_camera_path=None) # str\n" }, { "title": "DuplicateCollection", "description": "[omni.kit.core.collection.commands]\n\nDuplicate a collection under the same prim path\nwe just want to use the same logic as prim duplicate and add a numeric counter to the end", "snippet": "omni.kit.commands.execute(\"DuplicateCollection\",\n collection_path=collection_path, # str\n new_collection_name=\"\", # str\n usd_context_name=\"\") # str\n" }, { "title": "DuplicateFromActiveViewportCameraCommand", "description": "[omni.kit.viewport_legacy.scripts.commands]\n\nDuplicates Viewport's actively bound camera and bind active camera to the duplicated one.\n\nArgs:\n viewport_name (str): name of the viewport to set active camera (for multi-viewport).", "snippet": "omni.kit.commands.execute(\"DuplicateFromActiveViewportCameraCommand\",\n viewport_name=\"\") # str\n" }, { "title": "DuplicateViewportCameraCommand", "description": "[omni.kit.viewport.menubar.camera.commands]\n\nDuplicates a Viewport's actively bound camera and bind active camera to the duplicated one.\n\nArgs:\n viewport_api: The viewport to target", "snippet": "omni.kit.commands.execute(\"DuplicateViewportCameraCommand\",\n viewport_api=viewport_api)\n" }, { "title": "EnableXformOpCommand", "description": "[omni.kit.property.transform.scripts.transform_commands]\n\nAdd and attritube's corresponding XformOp to xformOpOrder.\n\nArgs:\n op_attr_path (str): path of the xformOp attribute.\nExample: \n We might want to add xformOp:translate to the xformOpOrder token array\n Provided that xformOp:translate attribute exists and xformOp:translate is no in xformOpOrder", "snippet": "omni.kit.commands.execute(\"EnableXformOpCommand\",\n op_attr_path=op_attr_path) # str\n" }, { "title": "ExcludeItemFromCollection", "description": "[omni.kit.core.collection.commands]\n\nAdd the item to the exclude list", "snippet": "omni.kit.commands.execute(\"ExcludeItemFromCollection\",\n prim_or_prop_path=prim_or_prop_path, # str\n collection_path=collection_path, # str\n usd_context_name=\"\") # str\n" }, { "title": "FlattenLayersCommand", "description": "[omni.kit.usd.layers.impl.layer_commands]\n\nFlatten Layers undoable.", "snippet": "omni.kit.commands.execute(\"FlattenLayersCommand\",\n usd_context=\"\") # typing.Union[str, omni.usd._usd.UsdContext]\n" }, { "title": "HideUnselectedCommand", "description": "[omni.kit.selection.selection]", "snippet": "omni.kit.commands.execute(\"HideUnselectedCommand\")\n" }, { "title": "ImportCompoundCommand", "description": "[omni.kit.window.material_graph.usdshade_commands]\n\nImport compound shader from external USD file.\n\n### Arguments:\n\n `parent_path : Sdf.Path`\n The path of the prim we need to add the new compound to.\n\n `source_asset : str`\n The path of the external usd file. It's important the default\n prim in this layer is the NodeGraph prim.\n\n `identifier : str`\n The name of the new prim.\n\n `position : Optional[List[int]]`\n The position of the new node in the canvas.\n\n `stage : Optional[int]`\n The stage it's necessary to add the new prim. If None, it takes\n the stage from the USD Context.\n\n `attributes_to_set: Optional[Dict[Sdf.Path, Any]]`\n Dict that has the list of attributes and values to set after the\n prim is imported.", "snippet": "omni.kit.commands.execute(\"ImportCompoundCommand\",\n parent_path=parent_path, # pxr.Sdf.Path\n source_asset=source_asset, # str\n identifier=identifier, # str\n position=None, # typing.Union[typing.List[int], NoneType]\n stage=None,\n path=None,\n attributes_to_set=None) # typing.Union[typing.Dict[pxr.Sdf.Path, typing.Any], NoneType]\n" }, { "title": "ImportLayerCommand", "description": "[omni.kit.stage.copypaste.stage_copypaste_commands]\n\nImport given layer to the given stage under the specific root.\n\n### Arguments:\n\n `layer : Sdf.Layer`\n All the prims from this layer will be imported to the stage.\n\n `root : Sdf.Path`\n The new prims will be placed under this path.\n\n `stage : Optional[int]`\n The stage it's necessary to add the new prims. If None, it takes\n the stage from the USD Context.", "snippet": "omni.kit.commands.execute(\"ImportLayerCommand\",\n layer=layer, # pxr.Sdf.Layer\n root=Sdf.Path(\"/\"), # pxr.Sdf.Path\n stage=None) # typing.Union[pxr.Usd.Stage, NoneType]\n" }, { "title": "LinkSpecsCommand", "description": "[omni.kit.usd.layers.impl.layer_commands]\n\nLinks spec paths to layers undoable.", "snippet": "omni.kit.commands.execute(\"LinkSpecsCommand\",\n spec_paths=spec_paths, # typing.Union[str, typing.List[str]]\n layer_identifiers=layer_identifiers, # typing.Union[str, typing.List[str]]\n additive=True, # bool\n hierarchy=False, # bool\n usd_context=\"\") # typing.Union[str, omni.usd._usd.UsdContext]\n" }, { "title": "LockLayer", "description": "[omni.kit.usd.layers.impl.layer_commands]\n\nSet Layer's lock status undoable.", "snippet": "omni.kit.commands.execute(\"LockLayer\",\n layer_identifier=layer_identifier, # str\n locked=locked, # bool\n usd_context=\"\") # typing.Union[str, omni.usd._usd.UsdContext]\n" }, { "title": "LockSpecsCommand", "description": "[omni.kit.usd.layers.impl.layer_commands]\n\nLocks spec paths undoable.", "snippet": "omni.kit.commands.execute(\"LockSpecsCommand\",\n spec_paths=spec_paths, # typing.Union[str, typing.List[str]]\n hierarchy=False,\n usd_context=\"\") # typing.Union[str, omni.usd._usd.UsdContext]\n" }, { "title": "MergeLayersCommand", "description": "[omni.kit.usd.layers.impl.layer_commands]\n\nMerge Layers undoable.", "snippet": "omni.kit.commands.execute(\"MergeLayersCommand\",\n dst_parent_layer_identifier=dst_parent_layer_identifier, # str\n dst_layer_identifier=dst_layer_identifier,\n src_parent_layer_identifier=src_parent_layer_identifier, # str\n src_layer_identifier=src_layer_identifier, # str\n dst_stronger_than_src=dst_stronger_than_src, # bool\n usd_context=\"\") # typing.Union[str, omni.usd._usd.UsdContext]\n" }, { "title": "ModifyLayerMetadataCommand", "description": "[omni.kit.property.layer.commands]\n\nModify layer metadata undoable.", "snippet": "omni.kit.commands.execute(\"ModifyLayerMetadataCommand\",\n layer_identifier=layer_identifier,\n parent_layer_identifier=parent_layer_identifier,\n meta_index=meta_index,\n value=value)\n" }, { "title": "ModifyStageAxisCommand", "description": "[omni.kit.property.layer.commands]\n\nModify stage up axis undoable.", "snippet": "omni.kit.commands.execute(\"ModifyStageAxisCommand\",\n stage=stage,\n axis=axis)\n" }, { "title": "MovePrimSpecsToLayerCommand", "description": "[omni.kit.usd.layers.impl.layer_commands]\n\nMerge prim spec from src layer to dst layer and remove it from src layer.", "snippet": "omni.kit.commands.execute(\"MovePrimSpecsToLayerCommand\",\n dst_layer_identifier=dst_layer_identifier, # str\n src_layer_identifier=src_layer_identifier, # str\n prim_spec_path=prim_spec_path, # str\n dst_stronger_than_src=dst_stronger_than_src, # bool\n usd_context=\"\") # typing.Union[str, omni.usd._usd.UsdContext]\n" }, { "title": "MoveSublayerCommand", "description": "[omni.kit.usd.layers.impl.layer_commands]\n\nMove Sublayer undoable.", "snippet": "omni.kit.commands.execute(\"MoveSublayerCommand\",\n from_parent_layer_identifier=from_parent_layer_identifier, # str\n from_sublayer_position=from_sublayer_position, # int\n to_parent_layer_identifier=to_parent_layer_identifier, # str\n to_sublayer_position=to_sublayer_position, # int\n remove_source=False, # bool\n usd_context=\"\") # typing.Union[str, omni.usd._usd.UsdContext]\n" }, { "title": "NewUsdShadeMaterialCommand", "description": "[omni.kit.window.material_graph.usdshade_commands]", "snippet": "omni.kit.commands.execute(\"NewUsdShadeMaterialCommand\",\n parent_path=parent_path, # pxr.Sdf.Path\n identifier=identifier, # str\n position=None, # typing.Union[typing.Tuple[int], NoneType]\n select_new_prim=False, # bool\n stage=None, # typing.Union[pxr.Usd.Stage, NoneType]\n context_name=None) # typing.Union[str, NoneType]\n" }, { "title": "NewUsdShadeNodeCommand", "description": "[omni.kit.window.material_graph.usdshade_commands]", "snippet": "omni.kit.commands.execute(\"NewUsdShadeNodeCommand\",\n parent_path=parent_path,\n source_asset=source_asset,\n identifier=identifier,\n position=position,\n stage=None)\n" }, { "title": "NewUsdShadeNodeGraphCommand", "description": "[omni.kit.window.material_graph.usdshade_commands]", "snippet": "omni.kit.commands.execute(\"NewUsdShadeNodeGraphCommand\",\n parent_path=parent_path,\n identifier=identifier,\n position=position,\n stage=None)\n" }, { "title": "Redo", "description": "[omni.kit.undo.undo]", "snippet": "omni.kit.commands.execute(\"Redo\")\n" }, { "title": "RefreshScriptingPropertyWindowCommand", "description": "[omni.kit.scripting.scripts.command]", "snippet": "omni.kit.commands.execute(\"RefreshScriptingPropertyWindowCommand\")\n" }, { "title": "RemoveItemFromCollection", "description": "[omni.kit.core.collection.commands]\n\nIf the item has been directly included in the collection, we can remove it from the includes list", "snippet": "omni.kit.commands.execute(\"RemoveItemFromCollection\",\n prim_or_prop_path=prim_or_prop_path, # str\n collection_path=collection_path, # str\n usd_context_name=\"\") # str\n" }, { "title": "RemoveMeasurementsCommand", "description": "[omni.kit.tool.measure.scripts.common.commands]\n\n Command that removes the measurement from OgnMeasureCore.\n Undo recreates the measurement as a new measurement from scratch.", "snippet": "omni.kit.commands.execute(\"RemoveMeasurementsCommand\",\n callback=callback) # typing.Callable\n" }, { "title": "RemovePrimSpecCommand", "description": "[omni.kit.usd.layers.impl.layer_commands]\n\nRemove Prim undoable.", "snippet": "omni.kit.commands.execute(\"RemovePrimSpecCommand\",\n layer_identifier=layer_identifier, # str\n prim_spec_path=prim_spec_path, # typing.Union[pxr.Sdf.Path, typing.List[pxr.Sdf.Path]]\n usd_context=\"\") # typing.Union[str, omni.usd._usd.UsdContext]\n" }, { "title": "RemoveScriptingAPICommand", "description": "[omni.kit.scripting.scripts.command]", "snippet": "omni.kit.commands.execute(\"RemoveScriptingAPICommand\",\n layer=None, # pxr.Sdf.Layer\n paths=[]) # typing.List[pxr.Sdf.Path]\n" }, { "title": "RemoveSublayerCommand", "description": "[omni.kit.usd.layers.impl.layer_commands]\n\nRemove Sublayer undoable.", "snippet": "omni.kit.commands.execute(\"RemoveSublayerCommand\",\n layer_identifier=layer_identifier, # str\n sublayer_position=sublayer_position, # int\n usd_context=\"\") # typing.Union[str, omni.usd._usd.UsdContext]\n" }, { "title": "RemoveXformOpAndAttrbuteCommand", "description": "[omni.kit.property.transform.scripts.transform_commands]\n\nRemove XformOp And Attribute.\n\nArgs:\n op_order_attr_path (str): path of the xformOpOrder attribute.\n op_name (str): name of the xformOp to be removed\nExample: \n We might want to remove xformOp:translate from the xformOpOrder token array\n But we still keep the xformOp:translate attribute itself", "snippet": "omni.kit.commands.execute(\"RemoveXformOpAndAttrbuteCommand\",\n op_order_attr_path=op_order_attr_path, # str\n op_name=op_name, # str\n op_order_index=op_order_index) # int\n" }, { "title": "RemoveXformOpCommand", "description": "[omni.kit.property.transform.scripts.transform_commands]\n\nRemove XformOp Only.\n\nArgs:\n op_order_attr_path (str): path of the xformOpOrder attribute.\n op_name (str): name of the xformOp to be removed\nExample: \n We might want to remove xformOp:translate from the xformOpOrder token array\n But we still keep the xformOp:translate attribute itself", "snippet": "omni.kit.commands.execute(\"RemoveXformOpCommand\",\n op_order_attr_path=op_order_attr_path, # str\n op_name=op_name, # str\n op_order_index=op_order_index) # int\n" }, { "title": "RenameCollection", "description": "[omni.kit.core.collection.commands]\n\nRename a collection under the same prim", "snippet": "omni.kit.commands.execute(\"RenameCollection\",\n old_collection_path=old_collection_path, # str\n new_collection_name=new_collection_name, # str\n usd_context_name=\"\") # str\n" }, { "title": "Repeat", "description": "[omni.kit.undo.undo]", "snippet": "omni.kit.commands.execute(\"Repeat\")\n" }, { "title": "ReplaceSublayerCommand", "description": "[omni.kit.usd.layers.impl.layer_commands]\n\nReplace Layer undoable.", "snippet": "omni.kit.commands.execute(\"ReplaceSublayerCommand\",\n layer_identifier=layer_identifier, # str\n sublayer_position=sublayer_position, # int\n new_layer_path=new_layer_path, # str\n usd_context=\"\") # typing.Union[str, omni.usd._usd.UsdContext]\n" }, { "title": "SelectAllCommand", "description": "[omni.kit.selection.selection]\n\nSelect all prims.\n\nArgs:\n type (Union[str, None]): Specific type name. If it's None, it will select\n all prims. If it has type str with value \"\", it will select all prims without any type.\n Otherwise, it will select prims with that type.", "snippet": "omni.kit.commands.execute(\"SelectAllCommand\",\n type=None)\n" }, { "title": "SelectFilterCommand", "description": "[omni.kit.quicksearch.select.commands]", "snippet": "omni.kit.commands.execute(\"SelectFilterCommand\",\n filter=filter,\n types=[])\n" }, { "title": "SelectHierarchyCommand", "description": "[omni.kit.selection.selection]", "snippet": "omni.kit.commands.execute(\"SelectHierarchyCommand\")\n" }, { "title": "SelectInvertCommand", "description": "[omni.kit.selection.selection]", "snippet": "omni.kit.commands.execute(\"SelectInvertCommand\")\n" }, { "title": "SelectLeafCommand", "description": "[omni.kit.selection.selection]", "snippet": "omni.kit.commands.execute(\"SelectLeafCommand\")\n" }, { "title": "SelectListCommand", "description": "[omni.kit.selection.selection]", "snippet": "omni.kit.commands.execute(\"SelectListCommand\")\n" }, { "title": "SelectNoneCommand", "description": "[omni.kit.selection.selection]", "snippet": "omni.kit.commands.execute(\"SelectNoneCommand\")\n" }, { "title": "SelectParentCommand", "description": "[omni.kit.selection.selection]", "snippet": "omni.kit.commands.execute(\"SelectParentCommand\")\n" }, { "title": "SelectPrimsInCollection", "description": "[omni.kit.core.collection.commands]", "snippet": "omni.kit.commands.execute(\"SelectPrimsInCollection\",\n collection_path=\"\", # str\n usd_context_name=\"\") # str\n" }, { "title": "SelectSimilarCommand", "description": "[omni.kit.selection.selection]", "snippet": "omni.kit.commands.execute(\"SelectSimilarCommand\")\n" }, { "title": "SelectVariantPrimCommand", "description": "[omni.kit.property.usd.variants_model]", "snippet": "omni.kit.commands.execute(\"SelectVariantPrimCommand\",\n prim_path=prim_path, # str\n vset_name=vset_name, # str\n var_name=var_name, # str\n usd_context_name=\"\") # str\n" }, { "title": "SequencerClipCreateCommand", "description": "[omni.kit.sequencer.core.scripts.sequencer_commands]\n\nCreate a clip on a track.", "snippet": "omni.kit.commands.execute(\"SequencerClipCreateCommand\",\n track_path=track_path, # str\n clip_name=\"\", # str\n prim_path=\"\", # str\n clip_start=0, # float\n clip_end=None, # float\n select_prim=False)\n" }, { "title": "SequencerClipDuplicateCommand", "description": "[omni.kit.sequencer.core.scripts.sequencer_commands]\n\nCommand to duplicate a Sequence clip.", "snippet": "omni.kit.commands.execute(\"SequencerClipDuplicateCommand\",\n clip_id=clip_id, # str\n inherit_translation=False) # bool\n" }, { "title": "SequencerClipSetAnimationCommand", "description": "[omni.kit.sequencer.core.scripts.sequencer_commands]\n\nSet clip animation source to prim", "snippet": "omni.kit.commands.execute(\"SequencerClipSetAnimationCommand\",\n clip_path=clip_path, # pxr.Sdf.Path\n anim_prim_path=anim_prim_path, # pxr.Sdf.Path\n update_clip_time=True) # bool\n" }, { "title": "SequencerClipSetTargetCommand", "description": "[omni.kit.sequencer.core.scripts.sequencer_commands]\n\nSet Clip target prim.", "snippet": "omni.kit.commands.execute(\"SequencerClipSetTargetCommand\",\n clip_path=clip_path, # pxr.Sdf.Path\n asset_prim_path=asset_prim_path, # pxr.Sdf.Path\n update_time=False) # bool\n" }, { "title": "SequencerClipSplitCommand", "description": "[omni.kit.sequencer.core.scripts.sequencer_commands]\n\nCommand to split clips at specified time.", "snippet": "omni.kit.commands.execute(\"SequencerClipSplitCommand\",\n clip_paths=clip_paths, # typing.List[str]\n split_at_time=split_at_time) # float\n" }, { "title": "SequencerClipUpdateTimeCommand", "description": "[omni.kit.sequencer.core.scripts.sequencer_commands]\n\nCommmand to set clip start/end times.", "snippet": "omni.kit.commands.execute(\"SequencerClipUpdateTimeCommand\",\n clip_id=clip_id, # pxr.Sdf.Path\n clip_start=clip_start, # float\n clip_end=clip_end, # float\n old_clip_start=None, # float\n old_clip_end=None) # float\n" }, { "title": "SequencerClipUpdateTrimCommand", "description": "[omni.kit.sequencer.core.scripts.sequencer_commands]\n\nCommand to set play start/end times.", "snippet": "omni.kit.commands.execute(\"SequencerClipUpdateTrimCommand\",\n clip_id=clip_id, # str\n play_start=play_start, # float\n play_end=play_end, # float\n old_play_start=None, # float\n old_play_end=None) # float\n" }, { "title": "SequencerCreatePrimCommandBase", "description": "[omni.kit.sequencer.core.scripts.sequencer_commands]\n\nBase class to create a prim (and remove when undo)\nEnsures unique name, and handles selection.", "snippet": "omni.kit.commands.execute(\"SequencerCreatePrimCommandBase\",\n path_to=path_to, # pxr.Sdf.Path\n context_name=\"\", # typing.Union[str, NoneType]\n prepend_default_prim=True) # typing.Union[bool, NoneType]\n" }, { "title": "SequencerCreateReferenceCommand", "description": "[omni.kit.sequencer.core.scripts.sequencer_commands]\n\nWraps the usd command for create reference - returns the referenced prim path.", "snippet": "omni.kit.commands.execute(\"SequencerCreateReferenceCommand\",\n path_to=path_to, # pxr.Sdf.Path\n asset_path=asset_path) # str\n" }, { "title": "SequencerCreateSequenceCommand", "description": "[omni.kit.sequencer.core.scripts.sequencer_commands]\n\nCreates a new Sequencer prim.\nReturns SequenceSchema.Sequence.", "snippet": "omni.kit.commands.execute(\"SequencerCreateSequenceCommand\",\n path_to=Sdf.Path(\"/Sequence\")) # typing.Union[pxr.Sdf.Path, NoneType]\n" }, { "title": "SequencerSetChildLocation", "description": "[omni.kit.sequencer.core.scripts.sequencer_commands]\n\nSet prim child location.", "snippet": "omni.kit.commands.execute(\"SequencerSetChildLocation\",\n parent_path=parent_path, # str\n child_path=child_path, # str\n to_location=-1, # int\n from_location=None) # int\n" }, { "title": "SequencerSetNameChildrenOrder", "description": "[omni.kit.sequencer.core.scripts.sequencer_commands]\n\nSets the children order of a prim by name.", "snippet": "omni.kit.commands.execute(\"SequencerSetNameChildrenOrder\",\n parent_path=parent_path, # str\n children_order=children_order, # typing.List[str]\n previous_order=None) # typing.Union[typing.List[str], NoneType]\n" }, { "title": "SequencerSetTargetCommand", "description": "[omni.kit.sequencer.core.scripts.sequencer_commands]\n\nSet the prim target of a prim relationship.", "snippet": "omni.kit.commands.execute(\"SequencerSetTargetCommand\",\n prim_path=prim_path, # str\n target_prim=target_prim, # str\n relationship_name=relationship_name) # str\n" }, { "title": "SequencerSettingsSetSnapToFrameCommand", "description": "[omni.kit.sequencer.core.scripts.sequencer_commands]\n\nCommand to set Snap to Frame option.\nArgs:\n on (bool, optional): Snap To Frame value. Defaults to True.", "snippet": "omni.kit.commands.execute(\"SequencerSettingsSetSnapToFrameCommand\",\n on=True)\n" }, { "title": "SequencerTrackCreateCommand", "description": "[omni.kit.sequencer.core.scripts.sequencer_commands]\n\nCreates a new Sequencer Track prim.\nReturns SequenceSchema.Track", "snippet": "omni.kit.commands.execute(\"SequencerTrackCreateCommand\",\n sequence_path=sequence_path, # pxr.Sdf.Path\n track_type=track_type, # str\n track_name=\"\", # typing.Union[str, NoneType]\n location=-1) # int\n" }, { "title": "SequencerTrackMoveCommand", "description": "[omni.kit.sequencer.core.scripts.sequencer_commands]\n\nMove track position in Sequencer up or down.", "snippet": "omni.kit.commands.execute(\"SequencerTrackMoveCommand\",\n track_path=track_path, # str\n move_vector=0) # int\n" }, { "title": "SequencerTrackVisibleSetCommand", "description": "[omni.kit.sequencer.core.scripts.sequencer_commands]\n\nSet visibility of a Track.", "snippet": "omni.kit.commands.execute(\"SequencerTrackVisibleSetCommand\",\n track_path=None, # pxr.Sdf.Path\n is_visible=True)\n" }, { "title": "SequencerUIStreamAudioCommand", "description": "[omni.kit.sequencer.core.scripts.sequencer_audio_commands]\n\nCommand to record stage audio to file.", "snippet": "omni.kit.commands.execute(\"SequencerUIStreamAudioCommand\",\n audio_path=audio_path) # str\n" }, { "title": "SetActiveViewportCameraCommand", "description": "[omni.kit.viewport_legacy.scripts.commands]\n\nSets Viewport's actively bound camera to given camera at give path.\n\nArgs:\n new_active_cam_path (Union[str, Sdf.Path): new camera path to bind to viewport.\n viewport_name (str): name of the viewport to set active camera (for multi-viewport).", "snippet": "omni.kit.commands.execute(\"SetActiveViewportCameraCommand\",\n new_active_cam_path=new_active_cam_path, # typing.Union[str, pxr.Sdf.Path]\n viewport_name=\"\") # str\n" }, { "title": "SetCollectionExpansionRule", "description": "[omni.kit.core.collection.commands]", "snippet": "omni.kit.commands.execute(\"SetCollectionExpansionRule\",\n collection_path=collection_path, # str\n expansion_rule=expansion_rule, # str\n usd_context_name=\"\") # str\n" }, { "title": "SetEditTargetCommand", "description": "[omni.kit.usd.layers.impl.layer_commands]\n\nSelect Layer as Edit Target undoable.", "snippet": "omni.kit.commands.execute(\"SetEditTargetCommand\",\n layer_identifier=layer_identifier, # str\n usd_context=\"\") # typing.Union[str, omni.usd._usd.UsdContext]\n" }, { "title": "SetLayerMutenessCommand", "description": "[omni.kit.usd.layers.impl.layer_commands]\n\nSet Layer's muteness undoable.", "snippet": "omni.kit.commands.execute(\"SetLayerMutenessCommand\",\n layer_identifier=layer_identifier, # str\n muted=muted, # bool\n usd_context=\"\") # typing.Union[str, omni.usd._usd.UsdContext]\n" }, { "title": "SetLightingMenuModeCommand", "description": "[omni.kit.viewport.menubar.lighting.commands]\n\nSet the current lighting rig\n\nArgs:\n lighting_mode: (str) The lgihting mode to set to\n usd_context_name: (str) The UsdContext to target", "snippet": "omni.kit.commands.execute(\"SetLightingMenuModeCommand\",\n lighting_mode=lighting_mode, # str\n usd_context_name=\"\") # str\n" }, { "title": "SetViewportCameraCommand", "description": "[omni.kit.viewport.menubar.camera.commands]\n\nSets a Viewport's actively bound camera to camera at given path\n\nArgs:\n camera_path (Union[str, Sdf.Path): New camera path to bind to viewport.\n viewport_api: the viewport to target.", "snippet": "omni.kit.commands.execute(\"SetViewportCameraCommand\",\n camera_path=camera_path, # typing.Union[str, pxr.Sdf.Path]\n viewport_api=viewport_api)\n" }, { "title": "StitchPrimSpecsToLayer", "description": "[omni.kit.usd.layers.impl.layer_commands]\n\nFlatten specific prims in the stage.\n\nIt will remove original prim specs after flatten.", "snippet": "omni.kit.commands.execute(\"StitchPrimSpecsToLayer\",\n prim_paths=prim_paths, # typing.List[str]\n target_layer_identifier=target_layer_identifier, # str\n usd_context=\"\") # typing.Union[str, omni.usd._usd.UsdContext]\n" }, { "title": "ToggleExtension", "description": "[omni.kit.window.extensions.ext_commands]\n\nToggle extension. Enables/disables an extension.\n\nArgs:\n ext_id(str): Extension id.\n enable(bool): Enable or disable.", "snippet": "omni.kit.commands.execute(\"ToggleExtension\",\n ext_id=ext_id, # str\n enable=enable) # bool\n" }, { "title": "ToolbarPauseButtonClickedCommand", "description": "[omni.kit.window.toolbar.commands]\n\nOn clicked toolbar pause button.", "snippet": "omni.kit.commands.execute(\"ToolbarPauseButtonClickedCommand\")\n" }, { "title": "ToolbarPlayButtonClickedCommand", "description": "[omni.kit.window.toolbar.commands]\n\nOn clicked toolbar play button.", "snippet": "omni.kit.commands.execute(\"ToolbarPlayButtonClickedCommand\")\n" }, { "title": "ToolbarPlayFilterCheckedCommand", "description": "[omni.kit.window.toolbar.commands]\n\nChange settings depending on the status of play filter checkboxes.\n\nArgs:\n path: Path to the setting to change.\n enabled: New value to change to.", "snippet": "omni.kit.commands.execute(\"ToolbarPlayFilterCheckedCommand\",\n setting_path=setting_path,\n enabled=enabled)\n" }, { "title": "ToolbarPlayFilterSelectAllCommand", "description": "[omni.kit.window.toolbar.commands]\n\nSets all play filter settings to True.\n\nArgs:\n settings: Paths to the settings.", "snippet": "omni.kit.commands.execute(\"ToolbarPlayFilterSelectAllCommand\",\n settings=settings)\n" }, { "title": "ToolbarStopButtonClickedCommand", "description": "[omni.kit.window.toolbar.commands]\n\nOn clicked toolbar stop button.", "snippet": "omni.kit.commands.execute(\"ToolbarStopButtonClickedCommand\")\n" }, { "title": "TransformJointCommand", "description": "[omni.kit.property.physx.commands]", "snippet": "omni.kit.commands.execute(\"TransformJointCommand\",\n joint_path=joint_path, # str\n new_transform=new_transform, # pxr.Gf.Matrix4d\n orig_transform=orig_transform) # pxr.Gf.Matrix4d\n" }, { "title": "Undo", "description": "[omni.kit.undo.undo]", "snippet": "omni.kit.commands.execute(\"Undo\")\n" }, { "title": "UnlinkSpecsCommand", "description": "[omni.kit.usd.layers.impl.layer_commands]\n\nUnlinks spec paths to layers undoable.", "snippet": "omni.kit.commands.execute(\"UnlinkSpecsCommand\",\n spec_paths=spec_paths, # typing.Union[str, typing.List[str]]\n layer_identifiers=layer_identifiers, # typing.Union[str, typing.List[str]]\n hierarchy=False,\n usd_context=\"\") # typing.Union[str, omni.usd._usd.UsdContext]\n" }, { "title": "UnlockSpecsCommand", "description": "[omni.kit.usd.layers.impl.layer_commands]\n\nUnlocks spec paths undoable.", "snippet": "omni.kit.commands.execute(\"UnlockSpecsCommand\",\n spec_paths=spec_paths, # typing.Union[str, typing.List[str]]\n hierarchy=False,\n usd_context=\"\") # typing.Union[str, omni.usd._usd.UsdContext]\n" }, { "title": "UsdShadeDisconnectSourceCommand", "description": "[omni.kit.window.material_graph.usdshade_commands]\n\nUndoable UsdShade.Input.DisconnectSource", "snippet": "omni.kit.commands.execute(\"UsdShadeDisconnectSourceCommand\",\n target=target) # pxr.UsdShade.Input\n" }, { "title": "UsdUINodeGraphNodeSetCommand", "description": "[omni.kit.graph.usd.commands.commands]\n\nSet UsdUINodeGraphNode attribute value.\n\nArgs:\n attribute (str): Name of the UsdUINodeGraphNode attribute to set.\n prim_path (Sdf.Path): Prim path.\n value: Value to change to.\n prev: Value to undo to.\n stage (Usd.Stage): Stage on which to perform the action.", "snippet": "omni.kit.commands.execute(\"UsdUINodeGraphNodeSetCommand\",\n attribute=attribute, # str\n prim_path=prim_path, # pxr.Sdf.Path\n value=value,\n prev=prev,\n stage=None) # pxr.Usd.Stage\n" }, { "title": "UsdUIRemovePositionCommand", "description": "[omni.kit.graph.usd.commands.commands]\n\nRemove UsdUI position attribute from prim.\n\nArgs:\n prim_path (Sdf.Path): Prim path.\n stage (Usd.Stage): Stage on which to perform the action.", "snippet": "omni.kit.commands.execute(\"UsdUIRemovePositionCommand\",\n prim_path=prim_path, # pxr.Sdf.Path\n stage=None) # pxr.Usd.Stage\n" } ] }, { "title": "omni.paint", "snippets": [ { "title": "ChangeBrushParamCommand", "description": "[omni.paint.system.ui.paint_tool.commands]", "snippet": "omni.kit.commands.execute(\"ChangeBrushParamCommand\",\n brush=brush,\n param=param,\n value=value,\n prev_value=prev_value)\n" }, { "title": "DoPaintEraseCommand", "description": "[omni.paint.system.core.painter.commands]", "snippet": "omni.kit.commands.execute(\"DoPaintEraseCommand\",\n position=position)\n" }, { "title": "DoPaintFloodCommand", "description": "[omni.paint.system.core.painter.commands]", "snippet": "omni.kit.commands.execute(\"DoPaintFloodCommand\",\n flood_mode=flood_mode) # str\n" }, { "title": "DoPaintStampCommand", "description": "[omni.paint.system.core.painter.commands]", "snippet": "omni.kit.commands.execute(\"DoPaintStampCommand\",\n position=position,\n radius=radius,\n target_meshes=target_meshes)\n" }, { "title": "ModifyPointInstancerAttrCommand", "description": "[omni.paint.brush.modify.brush.command]", "snippet": "omni.kit.commands.execute(\"ModifyPointInstancerAttrCommand\",\n prim=prim,\n attr_name=attr_name,\n values=values)\n" }, { "title": "ModifyPointInstancerVisibleCommand", "description": "[omni.paint.brush.modify.brush.command]", "snippet": "omni.kit.commands.execute(\"ModifyPointInstancerVisibleCommand\",\n prim=prim,\n values=values)\n" }, { "title": "ScatterBrushEraseCommand", "description": "[omni.paint.brush.scatter.extension]", "snippet": "omni.kit.commands.execute(\"ScatterBrushEraseCommand\",\n erasers=erasers)\n" }, { "title": "ScatterBrushPaintCommand", "description": "[omni.paint.brush.scatter.extension]", "snippet": "omni.kit.commands.execute(\"ScatterBrushPaintCommand\",\n instancing_type=instancing_type,\n paint_candicator=paint_candicator,\n out_paint_asset_prims=out_paint_asset_prims)\n" }, { "title": "SetPaintBrushCommand", "description": "[omni.paint.system.core.painter.commands]", "snippet": "omni.kit.commands.execute(\"SetPaintBrushCommand\",\n brush_name=brush_name) # str\n" } ] }, { "title": "omni.particle", "snippets": [ { "title": "CreateParticleSystemEntityCommand", "description": "[omni.particle.system.core.scripts.commands]", "snippet": "omni.kit.commands.execute(\"CreateParticleSystemEntityCommand\",\n callback=callback) # typing.Callable[[], typing.List[str]]\n" } ] }, { "title": "omni.physxcamera", "snippets": [ { "title": "PhysXAddDroneCameraCommand", "description": "[omni.physxcamera.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXAddDroneCameraCommand\",\n subjectPrimPath=subjectPrimPath,\n cameraPrimPath=cameraPrimPath)\n" }, { "title": "PhysXAddFollowLookCameraCommand", "description": "[omni.physxcamera.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXAddFollowLookCameraCommand\",\n subjectPrimPath=subjectPrimPath,\n cameraPrimPath=cameraPrimPath)\n" }, { "title": "PhysXAddFollowVelocityCameraCommand", "description": "[omni.physxcamera.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXAddFollowVelocityCameraCommand\",\n subjectPrimPath=subjectPrimPath,\n cameraPrimPath=cameraPrimPath)\n" }, { "title": "PhysXUpdateAllCamerasCommand", "description": "[omni.physxcamera.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXUpdateAllCamerasCommand\",\n enabled=enabled)\n" } ] }, { "title": "omni.physxcommands", "snippets": [ { "title": "AddCollisionGroupCommand", "description": "[omni.physxcommands]\n\nWrapper for omni.physx.utils.addCollisionGroup. Creates a UsdPhysics.CollisionGroup prim.\n\nArgs:\n stage: USD stage.\n path: Path of the primitive to be created at. ", "snippet": "omni.kit.commands.execute(\"AddCollisionGroupCommand\",\n stage=stage,\n path=path)\n" }, { "title": "AddD6PhysicsJointComponentCommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"AddD6PhysicsJointComponentCommand\",\n usd_prim=usd_prim, # pxr.Usd.Prim\n component=component) # str\n" }, { "title": "AddDeformableBodyComponentCommand", "description": "[omni.physxcommands]\n\n Adds a deformable body component to a skin UsdGeom.Mesh using an optional set of TetrahedralMesh paths to define collision and simulation meshes.\n\n Parameters:\n skin_mesh_path: Path to UsdGeom.Mesh to which PhysxDeformableBodyAPI is applied and that will be driven by the\n simulation.\n\n collision_mesh_path: *Optional* path to collision PhysxSchema.TetrahedralMesh. If not provided, it is\n created from the mesh at skin_mesh_path.\n\n simulation_mesh_path: *Optional* path to simulation PhysxSchema.TetrahedralMesh. If not provided, it is\n created from the collision TetrahedralMesh. The simulation mesh path may be identical to\n the collision mesh path.\n\n voxel_resolution: Resolution along longest axis-aligned-bounding-box axis to create simulation\n TetrahedralMesh from voxelizing collision TetrahedralMesh.\n\n collision_simplification: Boolean flag indicating if simplification should be applied to the mesh before creating a\n softbody out of it.\n\n collision_simplification_remeshing: Boolean flag indicating if the simplification should be based on remeshing.\n Ignored if collision_simplification equals False.\n\n collision_simplification_remeshing_resolution: The resolution used for remeshing. A value of 0 indicates that a heuristic is used to determine\n the resolution. Ignored if collision_simplification_remeshing is False.\n\n collision_simplification_target_triangle_count: The target triangle count used for the simplification. A value of 0 indicates\n that a heuristic based on the simulation_hexahedral_resolution is to determine the target count.\n Ignored if collision_simplification equals False.\n\n collision_simplification_force_conforming: Boolean flag indicating that the tretrahedralizer used to generate the collision mesh should produce\n tetrahedra that conform to the triangle mesh. If False the implementation chooses the tretrahedralizer\n used. \n\n ...: Optional USD schema attributes, please refer to USD schema documentation.\n Returns:\n True / False that indicates success of command execution", "snippet": "omni.kit.commands.execute(\"AddDeformableBodyComponentCommand\",\n skin_mesh_path=skin_mesh_path, # pxr.Sdf.Path\n collision_mesh_path=Sdf.Path.emptyPath, # pxr.Sdf.Path\n simulation_mesh_path=Sdf.Path.emptyPath, # pxr.Sdf.Path\n voxel_resolution=10, # int\n collision_simplification=True, # bool\n collision_simplification_remeshing=True, # bool\n collision_simplification_remeshing_resolution=0, # int\n collision_simplification_target_triangle_count=0, # int\n collision_simplification_force_conforming=False, # bool\n solver_position_iteration_count=None, # int\n vertex_velocity_damping=None, # float\n sleep_damping=None, # float\n sleep_threshold=None, # float\n settling_threshold=None, # float\n self_collision=None, # bool\n self_collision_filter_distance=None) # float\n" }, { "title": "AddDeformableBodyMaterialCommand", "description": "[omni.physxcommands]\n\nWrapper for omni.physx.deformableUtils.add_deformable_body_material.\nCreates a UsdShade.Material prim if needed and adds a PhysxSchema.PhysxDeformableBodyMaterialAPI to it.\n\nArgs:\n stage: USD stage.\n path: Path of the primitive to be created at. \n dampingScale: Physics material param.\n density: Physics material param.\n dynamicFriction: Physics material param.\n elasticityDamping: Physics material param.\n poissonsRatio: Physics material param.\n youngsModulus: Physics material param.", "snippet": "omni.kit.commands.execute(\"AddDeformableBodyMaterialCommand\",\n stage=stage,\n path=path,\n dampingScale=None,\n density=None,\n dynamicFriction=None,\n elasticityDamping=None,\n poissonsRatio=None,\n youngsModulus=None)\n" }, { "title": "AddDiffuseParticlesCommand", "description": "[omni.physxcommands]\n\nWrapper for omni.physx.utils.add_physx_diffuse_particles. Adds a\nPhysxSchema.PhysxDiffuseParticlesAPI to a primitive with PhysxSchema.PhysxParticleSetAPI.\n\nAPI params, see schema doc\n stage\n path\n enabled\n max_diffuse_particle_multiplier\n threshold\n lifetime\n air_drag\n bubble_drag\n buoyancy\n kinetic_energy_weight\n pressure_weight\n divergence_weight\n collision_decay\n use_accurate_velocity", "snippet": "omni.kit.commands.execute(\"AddDiffuseParticlesCommand\",\n stage=stage,\n path=path,\n enabled=None,\n max_diffuse_particle_multiplier=None,\n threshold=None,\n lifetime=None,\n air_drag=None,\n bubble_drag=None,\n buoyancy=None,\n kinetic_energy_weight=None,\n pressure_weight=None,\n divergence_weight=None,\n collision_decay=None,\n use_accurate_velocity=None)\n" }, { "title": "AddDistancePhysicsJointComponentCommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"AddDistancePhysicsJointComponentCommand\",\n usd_prim=usd_prim, # pxr.Usd.Prim\n component=component) # str\n" }, { "title": "AddFixedPhysicsJointComponentCommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"AddFixedPhysicsJointComponentCommand\",\n usd_prim=usd_prim, # pxr.Usd.Prim\n component=component) # str\n" }, { "title": "AddGroundPlaneCommand", "description": "[omni.physxcommands]\n\nWrapper for omni.physx.physicsUtils.add_ground_plane. Adds a zero-thick plane to prevent physics-enabled prims from falling to infinity. Creates an UsdGeom.Xform with a UsdGeom.Mesh and a PhysxSchema.Plane child primitives.\n\nArgs:\n stage: USD stage.\n planePath: Path for the root xform to be created at. Finds first free path.\n axis: Up axis.\n size: Halfsize of one side.\n position: Center of the plane.\n color: Display color.\n\nReturns:\n Path where the plane was actually created.", "snippet": "omni.kit.commands.execute(\"AddGroundPlaneCommand\",\n stage=stage,\n planePath=planePath,\n axis=axis,\n size=size,\n position=position,\n color=color)\n" }, { "title": "AddPBDMaterialCommand", "description": "[omni.physxcommands]\n\nWrapper for omni.physx.particleUtils.add_pbd_particle_material. Adds a PhysxSchema.PhysxPBDMaterialAPI to a\nUsdShade.Material prim, and creates the material prim if needed.\n\nArgs:\n stage: USD stage.\n path: Path of the material to add the API to / or create a material if needed\n\n Material params, see schema API doc\n friction\n particle_friction_scale\n damping\n viscosity\n vorticity_confinement\n surface_tension\n cohesion\n adhesion\n particle_adhesion_scale\n adhesion_offset_scale\n gravity_scale\n lift\n drag\n density\n cfl_coefficient", "snippet": "omni.kit.commands.execute(\"AddPBDMaterialCommand\",\n stage=stage,\n path=path,\n friction=None,\n particle_friction_scale=None,\n damping=None,\n viscosity=None,\n vorticity_confinement=None,\n surface_tension=None,\n cohesion=None,\n adhesion=None,\n particle_adhesion_scale=None,\n adhesion_offset_scale=None,\n gravity_scale=None,\n lift=None,\n drag=None,\n density=None,\n cfl_coefficient=None)\n" }, { "title": "AddPairFilterCommand", "description": "[omni.physxcommands]\n\nWrapper for omni.physx.utils.addPairFilter. Filters out collisions between primitives using UsdPhysics.FilteredPairsAPI.\n\nArgs:\n stage: USD stage.\n primPaths: List of paths. ", "snippet": "omni.kit.commands.execute(\"AddPairFilterCommand\",\n stage=stage,\n primPaths=primPaths)\n" }, { "title": "AddParticleAnisotropyCommand", "description": "[omni.physxcommands]\n\nWrapper for omni.physx.utils.add_physx_particle_anisotropy. Adds a\nPhysxSchema.PhysxParticleAnisotropyAPI to a particle system.\n\nArgs:\n stage: USD stage.\n path: Path of the primitive to be created at.\n\n API params, see schema doc\n enabled\n scale\n min\n max", "snippet": "omni.kit.commands.execute(\"AddParticleAnisotropyCommand\",\n stage=stage,\n path=path,\n enabled=None,\n scale=None,\n min=None,\n max=None)\n" }, { "title": "AddParticleClothComponentCommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"AddParticleClothComponentCommand\",\n prim_path=prim_path)\n" }, { "title": "AddParticleIsosurfaceCommand", "description": "[omni.physxcommands]\n\nWrapper for omni.physx.utils.add_physx_particle_isosurface. Adds a\nPhysxSchema.PhysxParticleIsosurfaceAPI to a particle system.\n\nArgs:\n stage: USD stage.\n path: Path of the primitive to be created at.\n\n API params, see schema doc\n enabled\n max_vertices\n max_triangles\n max_subgrids\n grid_spacing\n surface_distance\n grid_filtering_passes\n grid_smoothing_radius\n enable_anisotropy\n anisotropy_min\n anisotropy_max\n anisotropy_radius\n num_mesh_smoothing_passes\n num_mesh_normal_smoothing_passes\n", "snippet": "omni.kit.commands.execute(\"AddParticleIsosurfaceCommand\",\n stage=stage,\n path=path,\n enabled=None,\n max_vertices=None,\n max_triangles=None,\n max_subgrids=None,\n grid_spacing=None,\n surface_distance=None,\n grid_filtering_passes=None,\n grid_smoothing_radius=None,\n num_mesh_smoothing_passes=None,\n num_mesh_normal_smoothing_passes=None)\n" }, { "title": "AddParticleSamplingCommand", "description": "[omni.physxcommands]\n\nAdds the particle sampling API to a mesh and generate a particle prim\n\nArgs:\n prim: the USD prim this command is executed on", "snippet": "omni.kit.commands.execute(\"AddParticleSamplingCommand\",\n prim=prim)\n" }, { "title": "AddParticleSetCommand", "description": "[omni.physxcommands]\n\nAdds the PhysxParticleSetAPI to UsdGeomPointBased\n\nArgs:\n prim: the USD prim this command is executed on", "snippet": "omni.kit.commands.execute(\"AddParticleSetCommand\",\n prim=prim)\n" }, { "title": "AddParticleSmoothingCommand", "description": "[omni.physxcommands]\n\nWrapper for omni.physx.utils.add_physx_particle_smoothing. Adds a\nPhysxSchema.PhysxParticleSmoothingAPI to a particle system.\n\nArgs:\n stage: USD stage.\n path: Path of the primitive to be created at.\n\n API params, see schema doc\n enabled\n strength", "snippet": "omni.kit.commands.execute(\"AddParticleSmoothingCommand\",\n stage=stage,\n path=path,\n enabled=None,\n strength=None)\n" }, { "title": "AddParticleSystemCommand", "description": "[omni.physxcommands]\n\nWrapper for omni.physx.utils.add_physx_particle_system. Adds a\nPhysxSchema.PhysxParticleSystem.\n\nArgs:\n stage: USD stage\n target_particle_system_path: Path of the primitive to be created at.\n\n API params, see schema doc:\n\n enabled\n simulation_owner\n contact_offset\n particle_contact_offset\n solid_rest_offset\n fluid_rest_offset\n enable_ccd\n solver_position_iterations\n max_depenetration_velocity\n wind\n max_neighborhood\n max_velocity\n global_self_collision_enabled\n non_particle_collision_enabled", "snippet": "omni.kit.commands.execute(\"AddParticleSystemCommand\",\n target_particle_system_path=None, # pxr.Sdf.Path\n enabled=None, # bool\n simulation_owner=None, # pxr.Sdf.Path\n contact_offset=None, # float\n rest_offset=None, # float\n particle_contact_offset=None, # float\n solid_rest_offset=None, # float\n fluid_rest_offset=None, # float\n enable_ccd=None, # bool\n solver_position_iteration_count=None, # int\n max_depenetration_velocity=None, # float\n wind=None, # pxr.Gf.Vec3f\n max_neighborhood=None, # int\n max_velocity=None, # float\n global_self_collision_enabled=None, # bool\n non_particle_collision_enabled=None) # bool\n" }, { "title": "AddPhysicsComponentCommand", "description": "[omni.physxcommands]\n\nAdd physics component command. See omni.physx.commands source for currently valid component names.\n\nArgs:\n usd_prim: USD prim to apply a component to.\n str: Component name.\n multiple_api_token: Component instance name (if applicable).", "snippet": "omni.kit.commands.execute(\"AddPhysicsComponentCommand\",\n usd_prim=usd_prim, # pxr.Usd.Prim\n component=component, # str\n multiple_api_token=None) # str\n" }, { "title": "AddPhysicsSceneCommand", "description": "[omni.physxcommands]\n\nWrapper for omni.physx.utils.addPhysicsScene. Adds a UsdPhysics.Scene prim with default params.\n\nArgs:\n stage: USD stage.\n path: Path of the primitive to be created at. ", "snippet": "omni.kit.commands.execute(\"AddPhysicsSceneCommand\",\n stage=stage,\n path=path)\n" }, { "title": "AddPrismaticPhysicsJointComponentCommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"AddPrismaticPhysicsJointComponentCommand\",\n usd_prim=usd_prim, # pxr.Usd.Prim\n component=component) # str\n" }, { "title": "AddRevolutePhysicsJointComponentCommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"AddRevolutePhysicsJointComponentCommand\",\n usd_prim=usd_prim, # pxr.Usd.Prim\n component=component) # str\n" }, { "title": "AddRigidBodyMaterialCommand", "description": "[omni.physxcommands]\n\nWrapper for omni.physx.utils.addRigidBodyMaterial. Creates a UsdShade.Material prim if needed and adds a UsdPhysics.MaterialAPI to it.\n\nArgs:\n stage: USD stage.\n path: Path of the primitive to be created at. \n density: Physics material param.\n staticFriction: Physics material param.\n dynamicFriction: Physics material param.\n restitution: Physics material param.", "snippet": "omni.kit.commands.execute(\"AddRigidBodyMaterialCommand\",\n stage=stage,\n path=path,\n density=None,\n staticFriction=None,\n dynamicFriction=None,\n restitution=None)\n" }, { "title": "AddSphericalPhysicsJointComponentCommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"AddSphericalPhysicsJointComponentCommand\",\n usd_prim=usd_prim, # pxr.Usd.Prim\n component=component) # str\n" }, { "title": "ApplyAPISchemaCommand", "description": "[omni.physxcommands]\n\nUndoable Apply API command.\n\nArgs:\n api: API class.\n prim: Target primitive.\n api_prefix: Prefix of a multiple-apply API.\n multiple_api_token: Token of a multiple-apply API.", "snippet": "omni.kit.commands.execute(\"ApplyAPISchemaCommand\",\n api=api,\n prim=prim,\n api_prefix=None,\n multiple_api_token=None)\n" }, { "title": "ChangeAttributeCommand", "description": "[omni.physxcommands]\n\nChange prim property undoable.\n\nArgs:\n attr (attribute): Attribute to change.\n value: Value to change to.\n value: Value to undo to.", "snippet": "omni.kit.commands.execute(\"ChangeAttributeCommand\",\n attr=attr, # pxr.Usd.Attribute\n widget=widget, # typing.Any\n value=value, # typing.Any\n prev=prev) # typing.Any\n" }, { "title": "CreateJointCommand", "description": "[omni.physxcommands]\n\nWrapper for omni.physx.utils.createJoint. Connects two primitives with a physical joints.\n\nArgs:\n stage: Path of the target primitive.\n joint_type: Fixed, Revolute, Prismatic, Spherical or Distance. If left blank a D6 Joint is used.\n from_prim: From primitive.\n to_prim: To primitive.\n\nReturns: \n Joint primitive.", "snippet": "omni.kit.commands.execute(\"CreateJointCommand\",\n stage=stage,\n joint_type=joint_type,\n from_prim=from_prim,\n to_prim=to_prim)\n" }, { "title": "CreateJointsCommand", "description": "[omni.physxcommands]\n\nWrapper for omni.physx.utils.createJoints. Connects a list of primitives with their parent or a pseudo-root with physical joints.\n\nArgs:\n stage: Path of the target primitive.\n joint_type: Fixed, Revolute, Prismatic, Spherical or Distance. If left blank a D6 Joint is used.\n paths: A list of paths.\n join_to_parent: Connect primitives to their parents if True, otherwise to a scene pseudo-root.\n\nReturns: \n Joint primitives.", "snippet": "omni.kit.commands.execute(\"CreateJointsCommand\",\n stage=stage,\n joint_type=joint_type,\n paths=paths,\n join_to_parent=False)\n" }, { "title": "CreatePhysicsAttachmentCommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"CreatePhysicsAttachmentCommand\",\n target_attachment_path=target_attachment_path, # pxr.Sdf.Path\n actor0_path=actor0_path, # pxr.Sdf.Path\n actor1_path=actor1_path) # pxr.Sdf.Path\n" }, { "title": "ImportTetrahedralMeshCommand", "description": "[omni.physxcommands]\n\n Creates a PhysxSchema.TetrahedralMesh from a TetMesh file. Must provide either path_without_extension\n as a non-empty string or a node_str + tet_str [ + face_str (optional)]\n\n Parameters:\n target_tet_mesh_path: Target path for new PhysxSchema.TetrahedralMesh.\n target_surface_mesh_path: Target path for the associated surface mesh (can be None)\n path_without_extension: Base file path to import (should not have file extension),\n use an empty string to ignore\n node_str: pass a string for the node file contents directly (optional)\n tet_str: pass a string for the tetrahedral mesh file contents directly (optional)\n face_str: pass a string for the surface mesh file contents directly (optional)\n suppress_errors: primarily for running tests, when testing conditions that are supposed to fail\n Returns:\n True / False that indicates success of command execution.\n", "snippet": "omni.kit.commands.execute(\"ImportTetrahedralMeshCommand\",\n target_tet_mesh_path=target_tet_mesh_path, # pxr.Sdf.Path\n target_surface_mesh_path=None, # typing.Union[pxr.Sdf.Path, NoneType]\n path_without_extension=\"\", # str\n node_str=\"\", # str\n tet_str=\"\", # str\n face_str=\"\", # str\n suppress_errors=False) # bool\n" }, { "title": "PhysicsCommand", "description": "[omni.physxcommands]\n\nBase class for physics commands. Adds an execute helper to not force the user to use only keyword arguments", "snippet": "omni.kit.commands.execute(\"PhysicsCommand\")\n" }, { "title": "RemoveAttributeCommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"RemoveAttributeCommand\",\n attribute=attribute,\n prim=prim)\n" }, { "title": "RemoveD6PhysicsJointComponentCommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"RemoveD6PhysicsJointComponentCommand\",\n usd_prim=usd_prim, # pxr.Usd.Prim\n component=component) # str\n" }, { "title": "RemoveDeformableBodyComponentCommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"RemoveDeformableBodyComponentCommand\",\n prim_path=prim_path)\n" }, { "title": "RemoveDistancePhysicsJointComponentCommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"RemoveDistancePhysicsJointComponentCommand\",\n usd_prim=usd_prim, # pxr.Usd.Prim\n component=component) # str\n" }, { "title": "RemoveFixedPhysicsJointComponentCommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"RemoveFixedPhysicsJointComponentCommand\",\n usd_prim=usd_prim, # pxr.Usd.Prim\n component=component) # str\n" }, { "title": "RemovePairFilterCommand", "description": "[omni.physxcommands]\n\nWrapper for omni.physx.utils.removePairFilter. Removes UsdPhysics.FilteredPairsAPI from primitives.\n\nArgs:\n stage: USD stage.\n primPaths: List of paths. ", "snippet": "omni.kit.commands.execute(\"RemovePairFilterCommand\",\n stage=stage,\n primPaths=primPaths)\n" }, { "title": "RemoveParticleClothComponentCommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"RemoveParticleClothComponentCommand\",\n prim_path=prim_path) # pxr.Sdf.Path\n" }, { "title": "RemoveParticleSamplingCommand", "description": "[omni.physxcommands]\n\nRemoves particle sampling API from a mesh.\nWill remove the particle prim that was generated using the sampler.\n\nArgs:\n stage: the stage with the particles\n prim: the USD prim this command is executed on", "snippet": "omni.kit.commands.execute(\"RemoveParticleSamplingCommand\",\n stage=stage,\n prim=prim)\n" }, { "title": "RemoveParticleSetCommand", "description": "[omni.physxcommands]\n\nRemoves the PhysxParticleSetAPI\n\nArgs:\n stage: the USD stage containing the particles\n prim: the USD prim with the API", "snippet": "omni.kit.commands.execute(\"RemoveParticleSetCommand\",\n stage=stage,\n prim=prim)\n" }, { "title": "RemovePhysicsComponentCommand", "description": "[omni.physxcommands]\n\nRemove physics component. See omni.physx.commands source for currently valid components.\n\nArgs:\n usd_prim: USD prim to apply a component to.\n str: Component name.\n multiple_api_token: Component instance name (if applicable).", "snippet": "omni.kit.commands.execute(\"RemovePhysicsComponentCommand\",\n usd_prim=usd_prim, # pxr.Usd.Prim\n component=component, # str\n multiple_api_token=None) # str\n" }, { "title": "RemovePrismaticPhysicsJointComponentCommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"RemovePrismaticPhysicsJointComponentCommand\",\n usd_prim=usd_prim, # pxr.Usd.Prim\n component=component) # str\n" }, { "title": "RemoveRelationshipCommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"RemoveRelationshipCommand\",\n relationship=relationship,\n prim=prim)\n" }, { "title": "RemoveRevolutePhysicsJointComponentCommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"RemoveRevolutePhysicsJointComponentCommand\",\n usd_prim=usd_prim, # pxr.Usd.Prim\n component=component) # str\n" }, { "title": "RemoveRigidBodyCommand", "description": "[omni.physxcommands]\n\nWrapper for omni.physx.utils.removeRigidBody.\n\nArgs:\n path: Path of the target primitive.", "snippet": "omni.kit.commands.execute(\"RemoveRigidBodyCommand\",\n path=path)\n" }, { "title": "RemoveSpatialTendonAttachmentAPICommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"RemoveSpatialTendonAttachmentAPICommand\",\n attachment_path=attachment_path, # str\n attachment_api=attachment_api) # str\n" }, { "title": "RemoveSphericalPhysicsJointComponentCommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"RemoveSphericalPhysicsJointComponentCommand\",\n usd_prim=usd_prim, # pxr.Usd.Prim\n component=component) # str\n" }, { "title": "RemoveStaticColliderCommand", "description": "[omni.physxcommands]\n\nWrapper for omni.physx.utils.removeStaticCollider.\n\nArgs:\n path: Path of the target primitive.", "snippet": "omni.kit.commands.execute(\"RemoveStaticColliderCommand\",\n path=path)\n" }, { "title": "RemoveTendonComponentsCommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"RemoveTendonComponentsCommand\",\n usd_prim=usd_prim, # pxr.Usd.Prim\n component=component) # str\n" }, { "title": "SetCustomMetadataCommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"SetCustomMetadataCommand\",\n stage=stage,\n metadata_name=metadata_name,\n new_values=new_values,\n old_values=old_values)\n" }, { "title": "SetRigidBodyCommand", "description": "[omni.physxcommands]\n\nWrapper for omni.physx.utils.setRigidBody. Applies UsdPhysics.RigidBodyAPI and a UsdPhysics.CollisionAPI to target prim. Applies UsdPhysics.MeshCollisionAPI if it's a mesh. Collision API's are also applied to the whole subtree if the target prim is an xform.\n\nArgs:\n path: Path of the target primitive.\n approximationShape: Physics param.\n kinematic: Physics param.", "snippet": "omni.kit.commands.execute(\"SetRigidBodyCommand\",\n path=path,\n approximationShape=\"convexHull\",\n kinematic=False)\n" }, { "title": "SetSpatialTendonAttachmentParentCommand", "description": "[omni.physxcommands]", "snippet": "omni.kit.commands.execute(\"SetSpatialTendonAttachmentParentCommand\",\n child_attachment_path=child_attachment_path, # str\n parent_attachment_path=parent_attachment_path) # str\n" }, { "title": "SetStaticColliderCommand", "description": "[omni.physxcommands]\n\nWrapper for omni.physx.utils.setStaticCollider. Applies Collision APIs (UsdPhysics.CollisionAPI, UsdPhysics.MeshCollisionAPI) to a target prim and its subtree.\n\nArgs:\n path: Path of the target primitive.\n approximationShape: Physics param.", "snippet": "omni.kit.commands.execute(\"SetStaticColliderCommand\",\n path=path,\n approximationShape=\"none\")\n" }, { "title": "UnapplyAPISchemaCommand", "description": "[omni.physxcommands]\n\nUndoable Unapply API command.\n\nArgs:\n api: API class.\n prim: Target primitive.\n api_prefix: Prefix of a multiple-apply API.\n multiple_api_token: Token of a multiple-apply API.", "snippet": "omni.kit.commands.execute(\"UnapplyAPISchemaCommand\",\n api=api,\n prim=prim,\n api_prefix=None,\n multiple_api_token=None)\n" } ] }, { "title": "omni.physxsupportui", "snippets": [ { "title": "CreateCollidersCommand", "description": "[omni.physxsupportui.scripts.action_bar]", "snippet": "omni.kit.commands.execute(\"CreateCollidersCommand\",\n stage=stage,\n prim_paths=prim_paths)\n" } ] }, { "title": "omni.physxui", "snippets": [ { "title": "ClearPhysicsComponentsCommand", "description": "[omni.physxui.scripts.commands]", "snippet": "omni.kit.commands.execute(\"ClearPhysicsComponentsCommand\",\n stage=stage,\n prim_paths=prim_paths)\n" } ] }, { "title": "omni.physxvehicle", "snippets": [ { "title": "PhysXVehicleAddArrayEntryCommand", "description": "[omni.physxvehicle.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXVehicleAddArrayEntryCommand\",\n arrayAttributePath=arrayAttributePath,\n entry=entry)\n" }, { "title": "PhysXVehicleChangeArrayEntryCommand", "description": "[omni.physxvehicle.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXVehicleChangeArrayEntryCommand\",\n arrayAttributePath=arrayAttributePath,\n entryIndex=entryIndex,\n value=value,\n oldValue=None,\n fillValue=None,\n minFillSize=None)\n" }, { "title": "PhysXVehicleCommandResponseChangeEntryCommand", "description": "[omni.physxvehicle.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXVehicleCommandResponseChangeEntryCommand\",\n valueArrayPath=valueArrayPath,\n indexArrayPath=indexArrayPath,\n entryIndex=entryIndex,\n valueEntry=valueEntry,\n oldValueEntry=oldValueEntry,\n indexEntry=indexEntry,\n fillValue=fillValue,\n maxIndexCount=maxIndexCount)\n" }, { "title": "PhysXVehicleControllerEnableAutoReverseCommand", "description": "[omni.physxvehicle.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXVehicleControllerEnableAutoReverseCommand\",\n primPath=primPath,\n enabled=enabled)\n" }, { "title": "PhysXVehicleControllerEnableInputCommand", "description": "[omni.physxvehicle.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXVehicleControllerEnableInputCommand\",\n primPath=primPath,\n enabled=enabled)\n" }, { "title": "PhysXVehicleControllerEnableMouseCommand", "description": "[omni.physxvehicle.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXVehicleControllerEnableMouseCommand\",\n primPath=primPath,\n enabled=enabled)\n" }, { "title": "PhysXVehicleControllerSetSteeringFilterTimeCommand", "description": "[omni.physxvehicle.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXVehicleControllerSetSteeringFilterTimeCommand\",\n primPath=primPath,\n timeConstant=timeConstant)\n" }, { "title": "PhysXVehicleControllerSetSteeringSensitivityCommand", "description": "[omni.physxvehicle.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXVehicleControllerSetSteeringSensitivityCommand\",\n primPath=primPath,\n sensitivity=sensitivity)\n" }, { "title": "PhysXVehicleDifferentialChangeEntryCommand", "description": "[omni.physxvehicle.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXVehicleDifferentialChangeEntryCommand\",\n valueArrayPaths=valueArrayPaths,\n valueArrayPathIndex=valueArrayPathIndex,\n indexArrayPath=indexArrayPath,\n entryIndex=entryIndex,\n valueEntry=valueEntry,\n oldValueEntry=oldValueEntry,\n indexEntry=indexEntry)\n" }, { "title": "PhysXVehicleRemoveArrayEntryCommand", "description": "[omni.physxvehicle.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXVehicleRemoveArrayEntryCommand\",\n arrayAttributePath=arrayAttributePath,\n entryIndex=entryIndex,\n oldValue=None)\n" }, { "title": "PhysXVehicleSetArrayEntryCommand", "description": "[omni.physxvehicle.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXVehicleSetArrayEntryCommand\",\n arrayAttributePath=arrayAttributePath,\n entries=entries)\n" }, { "title": "PhysXVehicleSetRelationshipCommand", "description": "[omni.physxvehicle.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXVehicleSetRelationshipCommand\",\n relationshipPath=relationshipPath,\n targetPath=targetPath)\n" }, { "title": "PhysXVehicleSuspensionFrameTransformsAutocomputeCommand", "description": "[omni.physxvehicle.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXVehicleSuspensionFrameTransformsAutocomputeCommand\",\n primPath=primPath)\n" }, { "title": "PhysXVehicleTireFrictionTableAddCommand", "description": "[omni.physxvehicle.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXVehicleTireFrictionTableAddCommand\",\n setPrimAsSelected=True) # bool\n" }, { "title": "PhysXVehicleTireFrictionTableAddEntryCommand", "description": "[omni.physxvehicle.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXVehicleTireFrictionTableAddEntryCommand\",\n tireFrictionTablePath=tireFrictionTablePath,\n materialPath=materialPath,\n frictionValue=frictionValue)\n" }, { "title": "PhysXVehicleTireFrictionTableChangeEntryCommand", "description": "[omni.physxvehicle.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXVehicleTireFrictionTableChangeEntryCommand\",\n tireFrictionTablePath=tireFrictionTablePath,\n entryIndex=entryIndex,\n frictionValue=frictionValue,\n oldFrictionValue=None)\n" }, { "title": "PhysXVehicleTireFrictionTableRemoveEntryCommand", "description": "[omni.physxvehicle.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXVehicleTireFrictionTableRemoveEntryCommand\",\n tireFrictionTablePath=tireFrictionTablePath,\n entryIndex=entryIndex)\n" }, { "title": "PhysXVehicleWheelSimTransformsAutocomputeCommand", "description": "[omni.physxvehicle.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXVehicleWheelSimTransformsAutocomputeCommand\",\n primPath=primPath)\n" }, { "title": "PhysXVehicleWizardCreateCommand", "description": "[omni.physxvehicle.scripts.commands]", "snippet": "omni.kit.commands.execute(\"PhysXVehicleWizardCreateCommand\",\n vehicleData=vehicleData)\n" } ] }, { "title": "omni.physxzerogravity", "snippets": [ { "title": "PlacementModeTransformCommand", "description": "[omni.physxzerogravity.scripts.placement_mode]", "snippet": "omni.kit.commands.execute(\"PlacementModeTransformCommand\",\n physx_authoring=physx_authoring,\n capture_session_id=capture_session_id)\n" }, { "title": "ZeroGravityClearAllCommand", "description": "[omni.physxzerogravity.scripts.extension]\n\n Clears all zerogravity markup.\n\n Parameters:\n None.\n\n Returns:\n None.", "snippet": "omni.kit.commands.execute(\"ZeroGravityClearAllCommand\")\n" }, { "title": "ZeroGravityClearSelectedCommand", "description": "[omni.physxzerogravity.scripts.extension]\n\n Clear zerogravity markup from the selected prim.\n\n Parameters:\n None.\n\n Returns:\n None.", "snippet": "omni.kit.commands.execute(\"ZeroGravityClearSelectedCommand\")\n" }, { "title": "ZeroGravityMarkSweepItemsDynamicCommand", "description": "[omni.physxzerogravity.scripts.extension]\n\n Sets whether to use dynamic markers for zerogravity automatic sweep mode.\n\n Parameters:\n use_dynamic_markers_for_swept_items:\n If set to true, prims nearby to the selection will be marked as dynamic. Otherwise as static.\n\n Returns:\n None.", "snippet": "omni.kit.commands.execute(\"ZeroGravityMarkSweepItemsDynamicCommand\",\n use_dynamic_markers_for_swept_items=use_dynamic_markers_for_swept_items)\n" }, { "title": "ZeroGravityRestoreAllTransformsCommand", "description": "[omni.physxzerogravity.scripts.extension]\n\n Restores all original transforms undoing zerogravity applied transforms.\n\n Parameters:\n None.\n\n Returns:\n None.", "snippet": "omni.kit.commands.execute(\"ZeroGravityRestoreAllTransformsCommand\")\n" }, { "title": "ZeroGravitySetDroppingCommand", "description": "[omni.physxzerogravity.scripts.extension]\n\n Enables or disables dropping mode for selected zerogravity dynamic marked prims.\n\n Parameters:\n dropping:\n If set to true, selected zerogravity dynamic markup assets will start falling down.\n Set to false, disables zerogravity dropping mode.\n\n Returns:\n None.", "snippet": "omni.kit.commands.execute(\"ZeroGravitySetDroppingCommand\",\n dropping=dropping)\n" }, { "title": "ZeroGravitySetEnabledCommand", "description": "[omni.physxzerogravity.scripts.extension]\n\n Enables zero gravity mode and allows physically correct placement of objects in the scene.\n\n Parameters:\n enabled:\n If set to true, enables zerogravity, otherwise it disables it.\n\n Returns:\n None.", "snippet": "omni.kit.commands.execute(\"ZeroGravitySetEnabledCommand\",\n enabled=enabled)\n" }, { "title": "ZeroGravitySetSelectedDynamicCommand", "description": "[omni.physxzerogravity.scripts.extension]\n\n Applies dynamic zerogravity markup to the selected prim.\n\n Parameters:\n None.\n\n Returns:\n None.", "snippet": "omni.kit.commands.execute(\"ZeroGravitySetSelectedDynamicCommand\")\n" }, { "title": "ZeroGravitySetSelectedStaticCommand", "description": "[omni.physxzerogravity.scripts.extension]\n\n Applies static zerogravity markup to the selected prim.\n\n Parameters:\n None.\n\n Returns:\n None.", "snippet": "omni.kit.commands.execute(\"ZeroGravitySetSelectedStaticCommand\")\n" }, { "title": "ZeroGravitySetSweepModeCommand", "description": "[omni.physxzerogravity.scripts.extension]\n\n Enables or disables automatic sweeping mode for zerogravity prims and automatically marks prims around the\n selected prims as static or dynamic.\n\n Parameters:\n sweep_mode:\n If set to true, enables sweep mode. Otherwise disables it.\n\n Returns:\n None.", "snippet": "omni.kit.commands.execute(\"ZeroGravitySetSweepModeCommand\",\n sweep_mode=sweep_mode)\n" }, { "title": "ZeroGravitySweepAreaVisualizeCommand", "description": "[omni.physxzerogravity.scripts.extension]\n\n Show or hide a sweep area bounding box visualization.\n\n Parameters:\n visualize_aabb:\n If set to true, a bounding box for the current sweep area will be shown in the viewport.\n\n Returns:\n None.", "snippet": "omni.kit.commands.execute(\"ZeroGravitySweepAreaVisualizeCommand\",\n visualize_aabb=visualize_aabb)\n" } ] }, { "title": "omni.ramp", "snippets": [ { "title": "SetRampValuesCommand", "description": "[omni.ramp.scripts.commands]", "snippet": "omni.kit.commands.execute(\"SetRampValuesCommand\",\n prim_path=None,\n pos_attr_name=None,\n val_attr_name=None,\n int_attr_name=None,\n old_positions=None,\n old_values=None,\n old_interps=None,\n new_positions=None,\n new_values=None,\n new_interps=None)\n" } ] }, { "title": "omni.rtx", "snippets": [ { "title": "RestoreDefaultRenderSettingCommand", "description": "[omni.rtx.window.settings.commands]\n\nRestore default setting for Renderer.\n\nArgs:\n path: Path to the setting to be reset.", "snippet": "omni.kit.commands.execute(\"RestoreDefaultRenderSettingCommand\",\n path=path) # str\n" }, { "title": "RestoreDefaultRenderSettingSectionCommand", "description": "[omni.rtx.window.settings.commands]\n\nRestore default settings for the whole section.\n\nArgs:\n path: Path to the settings section to be reset.", "snippet": "omni.kit.commands.execute(\"RestoreDefaultRenderSettingSectionCommand\",\n path=path) # str\n" }, { "title": "SetCurrentRenderer", "description": "[omni.rtx.window.settings.commands]\n\nSets the current renderer\nArgs:\n renderer_name: name of the renderer", "snippet": "omni.kit.commands.execute(\"SetCurrentRenderer\",\n renderer_name=renderer_name) # str\n" }, { "title": "SetCurrentStack", "description": "[omni.rtx.window.settings.commands]\n\nSets the current stack (needs to be one which is valid for the current renderer) \nArgs:\n stack_name: name of the stack", "snippet": "omni.kit.commands.execute(\"SetCurrentStack\",\n stack_name=stack_name) # str\n" } ] }, { "title": "omni.scene", "snippets": [ { "title": "SceneOptimizerComputeExtents", "description": "[omni.scene.optimizer.core.scripts.commands]", "snippet": "omni.kit.commands.execute(\"SceneOptimizerComputeExtents\")\n" }, { "title": "SceneOptimizerDeduplicateGeometry", "description": "[omni.scene.optimizer.core.scripts.commands]", "snippet": "omni.kit.commands.execute(\"SceneOptimizerDeduplicateGeometry\")\n" }, { "title": "SceneOptimizerJsonParser", "description": "[omni.scene.optimizer.core.scripts.commands]", "snippet": "omni.kit.commands.execute(\"SceneOptimizerJsonParser\")\n" }, { "title": "SceneOptimizerMerge", "description": "[omni.scene.optimizer.core.scripts.commands]", "snippet": "omni.kit.commands.execute(\"SceneOptimizerMerge\")\n" }, { "title": "SceneOptimizerOptimizeMaterials", "description": "[omni.scene.optimizer.core.scripts.commands]", "snippet": "omni.kit.commands.execute(\"SceneOptimizerOptimizeMaterials\")\n" }, { "title": "SceneOptimizerOptimizeSkelRoots", "description": "[omni.scene.optimizer.core.scripts.commands]", "snippet": "omni.kit.commands.execute(\"SceneOptimizerOptimizeSkelRoots\")\n" }, { "title": "SceneOptimizerPivot", "description": "[omni.scene.optimizer.core.scripts.commands]", "snippet": "omni.kit.commands.execute(\"SceneOptimizerPivot\")\n" }, { "title": "SceneOptimizerPrintStats", "description": "[omni.scene.optimizer.core.scripts.commands]", "snippet": "omni.kit.commands.execute(\"SceneOptimizerPrintStats\")\n" }, { "title": "SceneOptimizerProcessPointClouds", "description": "[omni.scene.optimizer.core.scripts.commands]", "snippet": "omni.kit.commands.execute(\"SceneOptimizerProcessPointClouds\")\n" }, { "title": "SceneOptimizerPruneLeaves", "description": "[omni.scene.optimizer.core.scripts.commands]", "snippet": "omni.kit.commands.execute(\"SceneOptimizerPruneLeaves\")\n" } ] }, { "title": "omni.tools", "snippets": [ { "title": "AddValidTranslateOpCommand", "description": "[omni.tools.pivot.pivot_tool_commands]\n\nPivot Tool - internal command", "snippet": "omni.kit.commands.execute(\"AddValidTranslateOpCommand\",\n prim_path=prim_path, # str\n context=\"\") # str\n" }, { "title": "ApplyArrayCommand", "description": "[omni.tools.array.extension]\n\nUsed by the Array Tool UI to 'Apply' the array - undoable/redoable.\n\nShould NOT be used outside of the Array Tool extension.\n\nOptional Args:\n usd_context_name (str): The USD context where this command should be used - allows for this command to be used by multiple USD contexts simultaneously.", "snippet": "omni.kit.commands.execute(\"ApplyArrayCommand\",\n usd_context_name=\"\") # str\n" }, { "title": "ApplyRandomizerCommand", "description": "[omni.tools.randomizer.extension]\n\nUsed by the Randomizer Tool UI to 'Apply' the randomizer - undoable/redoable.\n\nShould NOT be used outside of the Randomizer Tool extension.\n\nOptional Args:\n usd_context_name (str): The USD context where this command should be used - allows for this command to be used by multiple USD contexts simultaneously.", "snippet": "omni.kit.commands.execute(\"ApplyRandomizerCommand\",\n usd_context_name=\"\") # str\n" }, { "title": "CopyPrimSelectCommand", "description": "[omni.tools.array.array_core]", "snippet": "omni.kit.commands.execute(\"CopyPrimSelectCommand\",\n path_from=path_from, # str\n path_to=None, # str\n duplicate_layers=False, # bool\n combine_layers=False, # bool\n exclusive_select=True, # bool\n usd_context_name=\"\", # str\n flatten_references=False, # bool\n copy_to_introducing_layer=False) # bool\n" }, { "title": "CreateArrayCommand", "description": "[omni.tools.array.extension]\n\nCreates an Array of prims - undoable/redoable.\n\nCan be used outside of the Array Tool extension.\n\nRequired Args:\n target_prims (list): The list of prims to array. Expects prims, not prim paths.\n array_values (dict): The values to use to construct the array. Expects a dictionary matching the one seen in ArrayParams().\n\nOptional Args:\n usd_context_name (str): The USD context where this command should be used - allows for this command to be used by multiple USD contexts simultaneously.\n\nReturns:\n Do() (tuple): (Created prim paths: list, Grouped prims path: list, Seleced prims path: list)", "snippet": "omni.kit.commands.execute(\"CreateArrayCommand\",\n target_prims=target_prims, # typing.List[pxr.Usd.Prim]\n array_values=array_values, # dict\n usd_context_name=\"\") # str\n" }, { "title": "CreateInstanceSelectCommand", "description": "[omni.tools.array.array_core]", "snippet": "omni.kit.commands.execute(\"CreateInstanceSelectCommand\",\n path_from=path_from) # str\n" }, { "title": "DistributeToolDistributeTranslateOnAxisCommand", "description": "[omni.tools.distribute.commands]\n\nDistribute a list of Prims on the X/Y/Z world axis - undoable/redoable.\n\nCan be used outside of the Distribute Tool extension.\n\nRequired Args:\n prim_paths (List[str]): A list of prim paths of prims to distribute.\n axis (omni.tools.distribute.constants.DistributionAxis): World axis to distribute prims on. Also supports int value (0 = X, 1 = Y, 2 = Z).\n\nOptional Args:\n distribute_between (omni.tools.distribute.constants.DistributeBetweenType): Determines if the distribution occurs between any two Prims with the min/max Translate value on the given distribution Axis, or the Endpoints passed via argument.\n distribute_using (omni.tools.distribute.constants.CenterType): Determines if the distribution occurs using the Prims' current Bounding Box center or Pivot/Mesh origin.\n endpoint_a_prim_path (str): The Prim path for Endpoint A. Will be ignored if distribute_between is Axis Min/Max.\n endpoint_b_prim_path (str): The Prim path for Endpoint B. Will be ignored if distribute_between is Axis Min/Max.\n context (str): Specify the USD context.\n skip_hidden_prims (bool): If True, Prims in the distribution list with their visibility turned off will be ignored.", "snippet": "omni.kit.commands.execute(\"DistributeToolDistributeTranslateOnAxisCommand\",\n prim_paths=prim_paths, # typing.List\n axis=axis, # omni.tools.distribute.constants.DistributionAxis\n distribute_between=DistributeBetweenType.AXIS_MIN_MAX, # omni.tools.distribute.constants.DistributeBetweenType\n distribute_using=CenterType.BBOX_CENTER, # omni.tools.distribute.constants.DistributeBetweenType\n endpoint_a_prim_path=None, # str\n endpoint_b_prim_path=None, # str\n context=\"\", # str\n skip_hidden_prims=False) # bool\n" }, { "title": "FixTransformOpOrderWithPivotCommand", "description": "[omni.tools.pivot.pivot_tool_commands]\n\nPivot Tool - internal command", "snippet": "omni.kit.commands.execute(\"FixTransformOpOrderWithPivotCommand\",\n prim_path=prim_path, # str\n prev_xform_order=prev_xform_order, # list\n context=\"\") # str\n" }, { "title": "GroupPrimsSelectCommand", "description": "[omni.tools.array.array_core]", "snippet": "omni.kit.commands.execute(\"GroupPrimsSelectCommand\",\n prim_paths=prim_paths, # typing.List[typing.Union[str, pxr.Sdf.Path]]\n stage=None, # typing.Union[pxr.Usd.Stage, NoneType]\n context_name=None, # typing.Union[str, NoneType]\n destructive=True)\n" }, { "title": "PivotToolAddPivotCommand", "description": "[omni.tools.pivot.pivot_tool_commands]\n\nPivot Tool: Add Pivot to supported Xformable Prims. Prims need to have a valid full XformOp stack..\n\nArgs:\n prim_paths (List[str]): Prim paths of Prims to add PivotOp to.\n\n center_pivot (bool): Optional - Centers the added pivot at the bounding box center\n\n context (str): Optional - USD context", "snippet": "omni.kit.commands.execute(\"PivotToolAddPivotCommand\",\n prim_paths=prim_paths, # typing.List[str]\n center_pivot=True, # bool\n context=\"\") # str\n" }, { "title": "PivotToolRemovePivotCommand", "description": "[omni.tools.pivot.pivot_tool_commands]\n\nPivot Tool: Remove Pivot from supported Xformable Prims. Prims need to have a valid full XformOp stack..\n\nArgs:\n prim_paths (List[str]): Prim paths of Prims to add PivotOp to.\n\n maintain_position (bool): Modify TranslateOp to avoid drift.\n\n bbox_includes_child_prims (bool): Bounding box is extended to include Xformable child Prims.\n\n context (str): Optional context", "snippet": "omni.kit.commands.execute(\"PivotToolRemovePivotCommand\",\n prim_paths=prim_paths, # list\n maintain_position=True, # bool\n bbox_includes_child_prims=True, # bool\n context=\"\") # str\n" }, { "title": "PivotToolResetPivotCommand", "description": "[omni.tools.pivot.pivot_tool_commands]\n\nPivot Tool: Zero out the Pivot position on Xformable Prims with PivotOp.\nPrims need to have a valid full XformOp stack..\n\nArgs:\n prim_paths (List[str]): Prim paths of Prims to update PivotOp on.\n\n maintain_position (bool): Modify TranslateOp to avoid drift.\n\n bbox_includes_child_prims (bool): Bounding box is extended to include Xformable child Prims.\n\n auto_enable_pivots (bool): Automatically enable any disabled PivotOps.\n\n context (str): Optional context", "snippet": "omni.kit.commands.execute(\"PivotToolResetPivotCommand\",\n prim_paths=prim_paths, # list\n maintain_position=True, # bool\n bbox_includes_child_prims=True, # bool\n auto_enable_pivots=True, # bool\n context=\"\") # str\n" }, { "title": "PivotToolSetPivotFromPrimWorldPositionCommand", "description": "[omni.tools.pivot.pivot_tool_commands]\n\nPivot Tool: Set Pivot position on Xformable Prims with PivotOp from an arbitrary Prim's World Position.\nPrims need to have a valid full XformOp stack..\n\nArgs:\n prim_paths (List[str]): Prim paths of Prims to update PivotOp on.\n\n world_position_prim_path (str): Prim whose world position to apply to each PivotOp.\n\n maintain_position (bool): Modify TranslateOp to avoid drift.\n\n bbox_includes_child_prims (bool): Bounding box is extended to include Xformable child Prims.\n\n auto_enable_pivots (bool): Automatically enable any disabled PivotOps.\n\n context (str): Optional context", "snippet": "omni.kit.commands.execute(\"PivotToolSetPivotFromPrimWorldPositionCommand\",\n prim_paths=prim_paths, # list\n world_position_prim_path=world_position_prim_path, # str\n maintain_position=True, # bool\n bbox_includes_child_prims=True, # bool\n auto_enable_pivots=True, # bool\n context=\"\") # str\n" }, { "title": "PivotToolSetPivotFromWorldPositionCommand", "description": "[omni.tools.pivot.pivot_tool_commands]\n\nPivot Tool: Set Pivot position on Xformable Prims with PivotOp from an arbitrary World Position.\nPrims need to have a valid full XformOp stack..\n\nArgs:\n prim_paths (List[str]): Prim paths of Prims to update PivotOp on.\n\n world_position (Gf.Vec3d): World position to apply to each PivotOp.\n\n maintain_position (bool): Modify TranslateOp to avoid drift.\n\n bbox_includes_child_prims (bool): Bounding box is extended to include Xformable child Prims.\n\n auto_enable_pivots (bool): Automatically enable any disabled PivotOps.\n\n context (str): Optional context", "snippet": "omni.kit.commands.execute(\"PivotToolSetPivotFromWorldPositionCommand\",\n prim_paths=prim_paths, # list\n world_position=world_position, # pxr.Gf.Vec3d\n maintain_position=True, # bool\n bbox_includes_child_prims=True, # bool\n auto_enable_pivots=True, # bool\n context=\"\") # str\n" }, { "title": "PivotToolSetPivotToBoundingBoxBaseCommand", "description": "[omni.tools.pivot.pivot_tool_commands]\n\nPivot Tool: Set Pivot position on Xformable Prims with PivotOp to the\nbottom center of their respective bounding boxes.\nPrims need to have a valid full XformOp stack..\n\nArgs:\n prim_paths (List[str]): Prim paths of Prims to update PivotOp on.\n\n maintain_position (bool): Modify TranslateOp to avoid drift.\n\n bbox_includes_child_prims (bool): Bounding box is extended to include Xformable child Prims.\n\n auto_enable_pivots (bool): Automatically enable any disabled PivotOps.\n\n context (str): Optional context", "snippet": "omni.kit.commands.execute(\"PivotToolSetPivotToBoundingBoxBaseCommand\",\n prim_paths=prim_paths, # list\n maintain_position=True, # bool\n bbox_includes_child_prims=True, # bool\n auto_enable_pivots=True, # bool\n context=\"\") # str\n" }, { "title": "PivotToolSetPivotToBoundingBoxCenterCommand", "description": "[omni.tools.pivot.pivot_tool_commands]\n\nPivot Tool: Set Pivot position on Xformable Prims with PivotOp to the center of their respective bounding boxes.\nPrims need to have a valid full XformOp stack..\n\nArgs:\n prim_paths (List[str]): Prim paths of Prims to update PivotOp on.\n\n maintain_position (bool): Modify TranslateOp to avoid drift.\n\n bbox_includes_child_prims (bool): Bounding box is extended to include Xformable child Prims.\n\n auto_enable_pivots (bool): Automatically enable any disabled PivotOps.\n\n context (str): Optional context", "snippet": "omni.kit.commands.execute(\"PivotToolSetPivotToBoundingBoxCenterCommand\",\n prim_paths=prim_paths, # list\n maintain_position=True, # bool\n bbox_includes_child_prims=True, # bool\n auto_enable_pivots=True, # bool\n context=\"\") # str\n" }, { "title": "PivotToolUpdatePivotCommand", "description": "[omni.tools.pivot.pivot_tool_commands]\n\nPivot Tool: Update Pivot on Xformable Prims with PivotOp.\nPrims need to have a valid full XformOp stack..\n\nArgs:\n prim_paths (List[str]): Prim paths of Prims to update PivotOp on.\n\n new_pivot_position (Gf.Vec3d): New Pivot position to set all Pivots to.\n\n use_normalized_position (bool): Position values are normalized and relative to each Prim's bounding box.\n\n maintain_position (bool): Modify TranslateOp to avoid drift.\n\n bbox_includes_child_prims (bool): Bounding box is extended to include Xformable child Prims.\n\n auto_enable_pivots (bool): Automatically enable any disabled PivotOps.\n\n context (str): Optional context", "snippet": "omni.kit.commands.execute(\"PivotToolUpdatePivotCommand\",\n prim_paths=prim_paths, # list\n new_pivot_position=new_pivot_position, # pxr.Gf.Vec3d\n use_normalized_position=True, # bool\n maintain_position=True, # bool\n bbox_includes_child_prims=True, # bool\n auto_enable_pivots=True, # bool\n context=\"\") # str\n" }, { "title": "RandomizeMaterialsCommand", "description": "[omni.tools.randomizer.extension]\n\nRandomly assign materials to the provided prims - undoable/redoable.\n\nCan be used outside of the Randomizer Tool extension.\n\nRequired Args:\n target_prims (list): The list of prims to operate on. Expects prims, not paths. (Usd.Prim)\n material_list (list): The list of material paths to randomly assign from. Expects a list of paths, not prims. (Sdf.Path or str)\n\nOptional Args:\n replace_material_list (list): A list of material paths to replace with materials from the material_list on the target_prims. Expects a list of paths, not prims.\n shared_material_replacement (bool): Replace repeated occurrences of the same material with the same random material. If false, use a new random material for each replace occurrence. Only used when providing a replace materials list.\n include_children (bool): Include all valid child prims of the provided target_prims in material randomization/replace calculations.\n seed (int): The random seed to use for this operation. If none is given one will be generated.\n usd_context_name (str): The USD context where this command should be used - allows for this command to be used by multiple USD contexts simultaneously.", "snippet": "omni.kit.commands.execute(\"RandomizeMaterialsCommand\",\n target_prims=target_prims, # typing.List[pxr.Usd.Prim]\n material_list=material_list, # typing.List[str]\n replace_material_list=[], # typing.List[str]\n shared_material_replacement=True, # bool\n include_children=False, # bool\n seed=None, # int\n usd_context_name=\"\") # str\n" }, { "title": "RandomizeSelectionCommand", "description": "[omni.tools.randomizer.extension]\n\nRandomly select a percentage of the provided prims - undoable/redoable.\n\nCan be used outside of the Randomizer Tool extension.\n\nRequired Args:\n target_prim_paths (list): The list of prim paths to operate on\n percent_to_select (int): A percent of the original provided prims to randomly select, between 0 and 100.\n\nOptional Args:\n seed (int): The random seed to use for this operation. If none is given one will be generated.\n usd_context_name (str): The USD context where this command should be used - allows for this command to be used by multiple USD contexts simultaneously.", "snippet": "omni.kit.commands.execute(\"RandomizeSelectionCommand\",\n target_prim_paths=target_prim_paths, # typing.List[str]\n percent_to_select=percent_to_select, # int\n seed=None, # int\n usd_context_name=\"\") # str\n" }, { "title": "RandomizeTransformsCommand", "description": "[omni.tools.randomizer.extension]\n\nRandomize transformations on provided prims - undoable/redoable.\n\nCan be used outside of the Randomizer Tool extension.\n\nRequired Args:\n target_prims (list): The list of prims to operate on\n\nOptional Args:\n translate_ranges (tuple(Gf.Vec2d, Gf.Vec2d, Gf.Vec2d)): Min and Max value range for X,Y,Z axes\n rotate_ranges (tuple(Gf.Vec2d, Gf.Vec2d, Gf.Vec2d)): Min and Max value range for X,Y,Z axes\n scale_ranges (tuple(Gf.Vec2d, Gf.Vec2d, Gf.Vec2d)): Min and Max value range for X,Y,Z axes\n seed (int): The random seed to use for this operation. If none is given one will be generated.\n uniform_scaling (bool): If True, the provided scale ranges will be set to the same min and max values, and scaling applied to the selected prims will be uniform on a per-prim basis.\n usd_context_name (str): The USD context where this command should be used - allows for this command to be used by multiple USD contexts simultaneously.", "snippet": "omni.kit.commands.execute(\"RandomizeTransformsCommand\",\n target_prims=target_prims, # typing.List[pxr.Usd.Prim]\n translate_ranges=(Gf.Vec2d(0.0, 0.0), Gf.Vec2d(0.0, 0.0), Gf.Vec2d(0.0, 0.0)), # tuple\n rotate_ranges=(Gf.Vec2d(0.0, 0.0), Gf.Vec2d(0.0, 0.0), Gf.Vec2d(0.0, 0.0)), # tuple\n scale_ranges=(Gf.Vec2d(0.0, 0.0), Gf.Vec2d(0.0, 0.0), Gf.Vec2d(0.0, 0.0)), # tuple\n seed=None, # int\n uniform_scaling=False, # bool\n usd_context_name=\"\") # str\n" }, { "title": "RefreshPropertyPanelCommand", "description": "[omni.tools.pivot.pivot_tool_commands]\n\nPivot Tool - internal command", "snippet": "omni.kit.commands.execute(\"RefreshPropertyPanelCommand\")\n" }, { "title": "RemovePivotFromTransformOpOrderCommand", "description": "[omni.tools.pivot.pivot_tool_commands]\n\nPivot Tool - internal command", "snippet": "omni.kit.commands.execute(\"RemovePivotFromTransformOpOrderCommand\",\n prim_path=prim_path, # str\n prev_xform_order=prev_xform_order, # list\n context=\"\") # str\n" }, { "title": "RemovePivotWithMaintainPositionCommand", "description": "[omni.tools.pivot.pivot_tool_commands]\n\nPivot Tool - internal command", "snippet": "omni.kit.commands.execute(\"RemovePivotWithMaintainPositionCommand\",\n prim_paths=typing.List[str],\n context=\"\") # str\n" } ] }, { "title": "omni.usd", "snippets": [ { "title": "AddPayloadCommand", "description": "[omni.usd.commands.usd_commands]", "snippet": "omni.kit.commands.execute(\"AddPayloadCommand\",\n stage=stage,\n prim_path=prim_path, # pxr.Sdf.Path\n payload=payload, # pxr.Sdf.Payload\n position=Usd.ListPositionBackOfPrependList)\n" }, { "title": "AddReferenceCommand", "description": "[omni.usd.commands.usd_commands]", "snippet": "omni.kit.commands.execute(\"AddReferenceCommand\",\n stage=stage,\n prim_path=prim_path, # pxr.Sdf.Path\n reference=reference, # pxr.Sdf.Reference\n position=Usd.ListPositionBackOfPrependList)\n" }, { "title": "AddRelationshipTargetCommand", "description": "[omni.usd.commands.usd_commands]\n\nAdd target to a relationship", "snippet": "omni.kit.commands.execute(\"AddRelationshipTargetCommand\",\n relationship=relationship, # pxr.Usd.Relationship\n target=target, # pxr.Sdf.Path\n position=Usd.ListPositionBackOfPrependList)\n" }, { "title": "BindMaterialCommand", "description": "[omni.usd.commands.usd_commands]\n\nBind material undoable.\n\nArgs:\n prim_path (str or list): Path(s) to prim or collection\n material_path (str): Path to material to bind.\n strength (float): Strength.\n stage (Usd.Stage): Stage to operate. Optional.\n context_name (str): The usd context to operate. Optional.", "snippet": "omni.kit.commands.execute(\"BindMaterialCommand\",\n prim_path=prim_path, # typing.Union[str, list]\n material_path=material_path, # str\n strength=None,\n stage=None, # typing.Union[pxr.Usd.Stage, NoneType]\n context_name=None) # typing.Union[str, NoneType]\n" }, { "title": "ChangeAttributesColorSpaceCommand", "description": "[omni.usd.commands.usd_commands]\n\nChange attribute color space undoable.\n\nArgs:\n attributes (List[str]): attributes to set color space on.\n color_space: Value of metadata to change to.", "snippet": "omni.kit.commands.execute(\"ChangeAttributesColorSpaceCommand\",\n attributes=attributes, # typing.List[pxr.Usd.Attribute]\n color_space=color_space) # typing.Any\n" }, { "title": "ChangeMetadataCommand", "description": "[omni.usd.commands.usd_commands]\n\nChange object metadata undoable.\n\nArgs:\n object_paths (List[str]): Object paths, can be attribute or prim.\n key: Key of metadata to change.\n value: Value of metadata to change to.\n usd_context_name (str): Name of the usd context to work on. Leave to \"\" to use default USD context.", "snippet": "omni.kit.commands.execute(\"ChangeMetadataCommand\",\n object_paths=object_paths, # typing.List[str]\n key=key, # typing.Any\n value=value, # typing.Any\n usd_context_name=\"\") # str\n" }, { "title": "ChangeMetadataInPrimsCommand", "description": "[omni.usd.commands.usd_commands]\n\nChange prim metadata undoable.\n\nArgs:\n prim_paths (List[str]): Prim paths.\n key: Key of metadata to change.\n value: Value of metadata to change to.\n usd_context_name (str): Name of the usd context to work on. Leave to \"\" to use default USD context.", "snippet": "omni.kit.commands.execute(\"ChangeMetadataInPrimsCommand\",\n prim_paths=prim_paths, # typing.List[str]\n key=key, # typing.Any\n value=value, # typing.Any\n usd_context_name=\"\") # str\n" }, { "title": "ChangePropertyCommand", "description": "[omni.usd.commands.usd_commands]\n\nChange prim property undoable.\n\nArgs:\n prop_path (str): Prim property path.\n value (Any): Value to change to.\n prev (Any): Value to undo to.\n timecode (Usd.TimeCode): The timecode to set property value to.\n type_to_create_if_not_exist (Sdf.ValueTypeName): If not None AND property does not already exist, a new property will be created with given type and value.\n target_layer (sdf.Layer): Target layer to write value to. Leave to None to use current stage's EditTarget.\n usd_context_name (str): Name of the usd context to work on. Leave to \"\" to use default USD context.\n is_custom (bool): If the property is created, specifiy if it is a 'custom' property (not part of the Schema).\n variability (Sdf.Variability): If the property is created, specify the variability.", "snippet": "omni.kit.commands.execute(\"ChangePropertyCommand\",\n prop_path=prop_path, # str\n value=value, # typing.Any\n prev=prev, # typing.Any\n timecode=DEFAULT,\n type_to_create_if_not_exist=None, # pxr.Sdf.ValueTypeNames\n target_layer=None, # pxr.Sdf.Layer\n usd_context_name=\"\", # str\n is_custom=False, # bool\n variability=Sdf.VariabilityVarying) # pxr.Sdf.Variability\n" }, { "title": "ClearCurvesSplitsOverridesCommand", "description": "[omni.usd.commands.usd_commands]\n\nClear Curves Splits Overrides .\n", "snippet": "omni.kit.commands.execute(\"ClearCurvesSplitsOverridesCommand\")\n" }, { "title": "ClearRefinementOverridesCommand", "description": "[omni.usd.commands.usd_commands]\n\nClear Refinement Overrides .\n", "snippet": "omni.kit.commands.execute(\"ClearRefinementOverridesCommand\")\n" }, { "title": "CopyPrimCommand", "description": "[omni.usd.commands.usd_commands]\n\nCopy primitive undoable.\n\nArgs:\n path_from (str): Path to copy from.\n\n path_to (str): Path to copy to. If `None` next free path is generated.\n\n duplicate_layers (bool): Duplicate layers on copy.\n\n combine_layers (bool): Combine layers on copy. When it's in omni.usd.LayerEditMode.AUTO_AUTHORING mode, this will always be true.\n\n exclusive_select (bool): If to exclusively select (clear old selections) the newly create object.\n\n flatten_references (bool): Flatten references during copy. It's only valid when combine_layers is True, and not in AUTO_AUTHORING mode.\n\n copy_to_introducing_layer (bool): If to copy it to the introducing layer, or the current edit target. By default, it's current edit target.", "snippet": "omni.kit.commands.execute(\"CopyPrimCommand\",\n path_from=path_from, # str\n path_to=None, # str\n duplicate_layers=False, # bool\n combine_layers=False, # bool\n exclusive_select=True, # bool\n usd_context_name=\"\", # str\n flatten_references=False, # bool\n copy_to_introducing_layer=False) # bool\n" }, { "title": "CopyPrimsCommand", "description": "[omni.usd.commands.usd_commands]\n\nCopy multiple primitives undoable.\n\nArgs:\n paths_from List[str]: Paths to copy from.\n\n paths_to List[str]: Paths to copy to. If `None` or length smaller than paths_from, then next free path is generated for missing paths.\n\n duplicate_layers (bool): Duplicate layers on copy.\n\n combine_layers (bool): Combine layers on copy.\n\n flatten_references (bool): Flatten references during copy. It's only valid when combine_layers is True, and not in AUTO_AUTHORING mode.\n\n copy_to_introducing_layer (bool): If to copy it to the introducing layer, or the current edit target. By default, it's current edit target.\n Its's valid only when combine_layers is true.", "snippet": "omni.kit.commands.execute(\"CopyPrimsCommand\",\n paths_from=paths_from, # typing.List[str]\n paths_to=None, # typing.List[str]\n duplicate_layers=False, # bool\n combine_layers=False, # bool\n flatten_references=False, # bool\n copy_to_introducing_layer=False) # bool\n" }, { "title": "CreateAudioPrimFromAssetPathCommand", "description": "[omni.usd.commands.usd_commands]\n\nCreate reference undoable.\n\nIt creates a new Audio prim.\n\nArgs:\n usd_context (omni.usd.UsdContext): UsdContext this command to run on.\n path_to (Sdf.Path): Path to create a new prim.\n asset_path (str): The asset it's necessary to add to references.\n select_prim (bool): = True, Whether to select the newly created UsdPrim or not.", "snippet": "omni.kit.commands.execute(\"CreateAudioPrimFromAssetPathCommand\",\n usd_context=usd_context, # omni.usd._usd.UsdContext\n path_to=path_to, # pxr.Sdf.Path\n asset_path=asset_path, # str\n select_prim=True) # bool\n" }, { "title": "CreateDefaultXformOnPrimCommand", "description": "[omni.usd.commands.usd_commands]\n\nCreate DefaultXform On Prim undoable.\n\nArgs:\n prim_path (str): Path of the primitive to be create xform attribtues", "snippet": "omni.kit.commands.execute(\"CreateDefaultXformOnPrimCommand\",\n prim_path=prim_path) # str\n" }, { "title": "CreateInstanceCommand", "description": "[omni.usd.commands.usd_commands]\n\nInstance primitive undoable.\n\nIt creates a new prim, adds the master object to references, and flags this prim as instanceable. It the prim is\nXform, this command copies the transforms from the current frame. If the source prim is already instanceable, it\ntries to find master prim of this prim and uses it, so it's perfectly safe to press Ctrl-I multiple times.\n\nArgs:\n path_from (str): Path to instance from.", "snippet": "omni.kit.commands.execute(\"CreateInstanceCommand\",\n path_from=path_from) # str\n" }, { "title": "CreateInstancesCommand", "description": "[omni.usd.commands.usd_commands]\n\nInstance multiple primitives undoable.\n\nArgs:\n paths_from List[str]: Paths to instance from.", "snippet": "omni.kit.commands.execute(\"CreateInstancesCommand\",\n paths_from=paths_from) # typing.List[str]\n" }, { "title": "CreateMdlMaterialPrimCommand", "description": "[omni.usd.commands.usd_commands]\n\nCreate Mdl Material undoable.\n\nArgs:\n mtl_url (str):\n mtl_name (str):\n mtl_path (str):\n select_new_prim (bool):\n stage (Usd.Stage): Stage to operate. Optional.\n context_name (str): The usd context to operate. Optional.", "snippet": "omni.kit.commands.execute(\"CreateMdlMaterialPrimCommand\",\n mtl_url=mtl_url, # str\n mtl_name=mtl_name, # str\n mtl_path=mtl_path, # str\n select_new_prim=False, # bool\n stage=None, # typing.Union[pxr.Usd.Stage, NoneType]\n context_name=None) # typing.Union[str, NoneType]\n" }, { "title": "CreatePayloadCommand", "description": "[omni.usd.commands.usd_commands]\n\nCreate payload undoable.\n\nIt creates a new prim and adds the asset and path as payloads.\n\nArgs:\n usd_context (omni.usd.UsdContext): UsdContext this command to run on.\n path_to (Sdf.Path): Path to create a new prim.\n asset_path (str): The asset it's necessary to add to payloads.\n prim_path (Sdf.Path): The prim in asset to payload.\n instanceable (bool): Whether to set the prim instanceable. It works together with `/persistent/app/stage/instanceableOnCreatingReference` setting.\n select_prim (bool): = True, Whether to select the newly created UsdPrim or not.", "snippet": "omni.kit.commands.execute(\"CreatePayloadCommand\",\n usd_context=usd_context, # omni.usd._usd.UsdContext\n path_to=path_to, # pxr.Sdf.Path\n asset_path=None, # str\n prim_path=None, # pxr.Sdf.Path\n instanceable=True, # bool\n select_prim=True) # bool\n" }, { "title": "CreatePreviewSurfaceMaterialPrimCommand", "description": "[omni.usd.commands.usd_commands]\n\nCreate Preview Surface Material undoable.\n\nArgs:\n mtl_path (str):\n select_new_prim (bool):", "snippet": "omni.kit.commands.execute(\"CreatePreviewSurfaceMaterialPrimCommand\",\n mtl_path=mtl_path, # str\n select_new_prim=False) # bool\n" }, { "title": "CreatePreviewSurfaceTextureMaterialPrimCommand", "description": "[omni.usd.commands.usd_commands]\n\nCreate Preview Surface Texture Material undoable.\n\nArgs:\n mtl_path (str):\n select_new_prim (bool):", "snippet": "omni.kit.commands.execute(\"CreatePreviewSurfaceTextureMaterialPrimCommand\",\n mtl_path=mtl_path,\n select_new_prim=False) # bool\n" }, { "title": "CreatePrimCommand", "description": "[omni.usd.commands.usd_commands]\n\nCreate primitive undoable. It is same as `CreatePrimWithDefaultXformCommand`.\nKept for backward compatibility.\n\nArgs:\n prim_type (str): Primitive type, e.g. \"Sphere\", \"Cube\" etc.\n prim_path (str): Path of the primitive to be created at. If None is provided, it will be placed at stage root or under default prim using Type name.\n select_new_prim (bool) : Whether to select the prim after it's created.\n attributes (Dict[str, object]): optional attributes dict to set after creation.", "snippet": "omni.kit.commands.execute(\"CreatePrimCommand\",\n prim_type=prim_type, # str\n prim_path=None, # str\n select_new_prim=True, # bool\n attributes={}, # typing.Dict[str, typing.Any]\n create_default_xform=True,\n stage=None, # typing.Union[pxr.Usd.Stage, NoneType]\n context_name=None) # typing.Union[str, NoneType]\n" }, { "title": "CreatePrimCommandBase", "description": "[omni.usd.commands.usd_commands]\n\nBase class to create a prim (and remove when undo)\n\nArgs:\n usd_context (omni.usd.UsdContext): UsdContext this command to run on.\n path_to (Sdf.Path): Path to create a new prim.\n asset_path (str): The asset it's necessary to add to references.\n select_prim (bool): = True, Whether to select the newly created UsdPrim or not.", "snippet": "omni.kit.commands.execute(\"CreatePrimCommandBase\",\n usd_context=usd_context, # omni.usd._usd.UsdContext\n path_to=path_to, # pxr.Sdf.Path\n asset_path=asset_path, # str\n select_prim=True) # bool\n" }, { "title": "CreatePrimWithDefaultXformCommand", "description": "[omni.usd.commands.usd_commands]\n\nCreate primitive undoable.\n\nArgs:\n prim_type (str): Primitive type, e.g. \"Sphere\", \"Cube\" etc.\n prim_path (str): Path of the primitive to be created at. If None is provided, it will be placed at stage root or under default prim using Type name.\n select_new_prim (bool) : Whether to select the prim after it's created.\n attributes (Dict[str, object]): optional attributes dict to set after creation.", "snippet": "omni.kit.commands.execute(\"CreatePrimWithDefaultXformCommand\",\n prim_type=prim_type, # str\n prim_path=None, # str\n select_new_prim=True, # bool\n attributes={}, # typing.Dict[str, typing.Any]\n create_default_xform=True,\n stage=None, # typing.Union[pxr.Usd.Stage, NoneType]\n context_name=None) # typing.Union[str, NoneType]\n" }, { "title": "CreatePrimsCommand", "description": "[omni.usd.commands.usd_commands]\n\nCreate multiple primitives undoable.\n\nExample of command which calls other commands. Undo/Redo grouping handled automatically.\n\nArgs:\n prim_types (List[str]): List of primitive types to create, e.g [\"Sphere\", \"Cone\"].", "snippet": "omni.kit.commands.execute(\"CreatePrimsCommand\",\n prim_types=prim_types) # typing.List[str]\n" }, { "title": "CreateReferenceCommand", "description": "[omni.usd.commands.usd_commands]\n\nCreate reference undoable.\n\nIt creates a new prim and adds the asset and path as references.\n\nArgs:\n usd_context (omni.usd.UsdContext): UsdContext this command to run on.\n path_to (Sdf.Path): Path to create a new prim.\n asset_path (str): The asset it's necessary to add to references.\n prim_path (Sdf.Path): The prim in asset to reference.\n instanceable (bool): Whether to set the prim instanceable. It works together with `/persistent/app/stage/instanceableOnCreatingReference` setting.\n select_prim (bool): = True, Whether to select the newly created UsdPrim or not.", "snippet": "omni.kit.commands.execute(\"CreateReferenceCommand\",\n usd_context=usd_context, # omni.usd._usd.UsdContext\n path_to=path_to, # pxr.Sdf.Path\n asset_path=None, # str\n prim_path=None, # pxr.Sdf.Path\n instanceable=True, # bool\n select_prim=True) # bool\n" }, { "title": "CreateUsdAttributeCommand", "description": "[omni.usd.commands.usd_commands]\n\nCreate USD Attribute.\n\nArgs:\n prim (Usd.Prim): Usd.Prim that will get a new attribute.\n attr_name (str): New attribute's name.\n attr_type (Sdf.ValueTypeName): New attribute's type.\n custom (bool): If the attribute is custom.\n variability (Sdf.Variability): whether the attribute may vary over time and value coordinates, and if its value comes through authoring or from its owner.\n attr_value (Any, optional): New attribute's value. Leave it as None to use default value.\n\nExample of usage:\n omni.kit.commands.execute(\"CreateUsdAttribute\",\n prim=prim,\n attr_name=\"custom\",\n attr_type=Sdf.ValueTypeNames.Double3)", "snippet": "omni.kit.commands.execute(\"CreateUsdAttributeCommand\",\n prim=prim, # pxr.Usd.Prim\n attr_name=attr_name, # str\n attr_type=attr_type, # pxr.Sdf.ValueTypeName\n custom=True, # bool\n variability=Sdf.VariabilityVarying, # pxr.Sdf.Variability\n attr_value=None) # typing.Any\n" }, { "title": "CreateUsdAttributeOnPathCommand", "description": "[omni.usd.commands.usd_commands]\n\nCreate USD Attribute.\n\nArgs:\n attr_path (Union[Sdf.Path, str]): Path to the new attribute to be created. The prim of this path must already exist.\n attr_type (Sdf.ValueTypeName): New attribute's type.\n custom (bool): If the attribute is custom.\n variability (Sdf.Variability): whether the attribute may vary over time and value coordinates, and if its value comes through authoring or from its owner.\n attr_value (Any, optional): New attribute's value. Leave it as None to use default value.\n usd_context_name(str): Name of the usd context to execute the command on.\n\nExample of usage:\n omni.kit.commands.execute(\"CreateUsdAttribute\",\n prim=prim,\n attr_name=\"custom\",\n attr_type=Sdf.ValueTypeNames.Double3)", "snippet": "omni.kit.commands.execute(\"CreateUsdAttributeOnPathCommand\",\n attr_path=attr_path, # typing.Union[pxr.Sdf.Path, str]\n attr_type=attr_type, # pxr.Sdf.ValueTypeName\n custom=True, # bool\n variability=Sdf.VariabilityVarying, # pxr.Sdf.Variability\n attr_value=None, # typing.Any\n usd_context_name=\"\") # str\n" }, { "title": "DeletePrimsCommand", "description": "[omni.usd.commands.usd_commands]\n\nDelete primitives undoable.\n\nArgs:\n paths (List[str]): Paths to prims to delete.\n\n destructive: If it's false, the delete will only happen in the current target, and follows:\n 1. If the prim spec is a def, it will remove the prim spec.\n 2. If the prim spec is a over, it will only deactivate this prim.\n 3. If the prim spec is not existed, it will create over prim and deactivate it.\n 4. If there is an overridden in a stronger layer, it will report errors.\n\n If it's true, it will remove all prim specs in all local layers.\n\n By default, it's True and means the delete operation is destructive for back-compatibility.\n\n stage (Usd.Stage): Stage to operate. Optional.\n context_name (str): The usd context to operate. Optional.", "snippet": "omni.kit.commands.execute(\"DeletePrimsCommand\",\n paths=paths, # typing.List[typing.Union[str, pxr.Sdf.Path]]\n destructive=True,\n stage=None, # typing.Union[pxr.Usd.Stage, NoneType]\n context_name=None) # typing.Union[str, NoneType]\n" }, { "title": "FramePrimsCommand", "description": "[omni.usd.commands.usd_commands]\n\nTransform a primitive to encompass the bounds of a list of paths.\n\nArgs:\n prim_to_move: Path to the primitive that is being moved.\n prims_to_frame(Sequence[Union[str, Sdf.Path]]): Sequence of primitives to use to calculate the bounds to frame.\n time_code(Usd.TimeCode): Timecode to set values at.\n usd_context_name(str): Name of the usd context to work on.\n aspect_ratio(float): Width / Height of the final image.\n use_horizontal_fov(bool): Whether to use a camera's horizontal or vertical field of view for framing.\n horizontal_fov(float): Default horizontal field-of-view to use for framing if one cannot be calculated.\n zoom(float): Final zoom in or out of the framed box. Values above 0.5 move further away and below 0.5 go closer.", "snippet": "omni.kit.commands.execute(\"FramePrimsCommand\",\n prim_to_move=prim_to_move, # typing.Union[str, pxr.Sdf.Path]\n prims_to_frame=None, # typing.Sequence[typing.Union[str, pxr.Sdf.Path]]\n time_code=None, # pxr.Usd.TimeCode\n usd_context_name=\"\", # str\n aspect_ratio=1, # float\n use_horizontal_fov=None, # bool\n zoom=0.45, # float\n horizontal_fov=0.20656116130367255) # float\n" }, { "title": "GroupPrimsCommand", "description": "[omni.usd.commands.usd_commands]\n\nGroup primitive undoable.\n\nArgs:\n prim_paths (List[str]): Prim paths that will be grouped.\n stage (Usd.Stage): Stage to operate. Optional.\n context_name (str): The usd context to operate. Optional.\n destructive (bool): If it's true, it will group all prims and remove original prims, which\n may edit other layers that are not edit target currently.\n If it's false, all changes will made only to the current edit target without\n touching other layers. By default, it's true for back compatibility.", "snippet": "omni.kit.commands.execute(\"GroupPrimsCommand\",\n prim_paths=prim_paths, # typing.List[typing.Union[str, pxr.Sdf.Path]]\n stage=None, # typing.Union[pxr.Usd.Stage, NoneType]\n context_name=None, # typing.Union[str, NoneType]\n destructive=True)\n" }, { "title": "MovePrimCommand", "description": "[omni.usd.commands.usd_commands]\n\nMove primitive undoable.\n\nArgs:\n path_from (str): Path to move prim from.\n\n path_to(str): Path to move prim to.\n\n time_code(Usd.TimeCode): Current timecode of the stage.\n\n keep_world_transform(bool): True to keep world transform after prim path is moved. False to keep local transfrom only.\n\n on_move_fn(Callable): Function to call when prim is renamed\n\n destructive(bool): If it's false, it will not remove original prim but deactivate it. By default, it's true\n for back compatibility.", "snippet": "omni.kit.commands.execute(\"MovePrimCommand\",\n path_from=path_from, # typing.Union[str, pxr.Sdf.Path]\n path_to=path_to, # typing.Union[str, pxr.Sdf.Path]\n time_code=DEFAULT, # pxr.Usd.TimeCode\n keep_world_transform=True, # bool\n on_move_fn=None, # typing.Callable\n destructive=True)\n" }, { "title": "MovePrimsCommand", "description": "[omni.usd.commands.usd_commands]\n\nMove primitives undoable.\n\nArgs:\n paths_to_move Dict[str, str]: dictionary contaning entry of path_from : path_to.\n time_code(Usd.TimeCode): Current timecode of the stage.\n keep_world_transform(bool): True to keep world transform after prim path is moved. False to keep local transfrom only.\n destructive(bool): If it's false, it will not remove original prim but deactivate it. By default, it's true\n for back compatibility.", "snippet": "omni.kit.commands.execute(\"MovePrimsCommand\",\n paths_to_move=paths_to_move, # typing.Dict[str, str]\n time_code=DEFAULT, # pxr.Usd.TimeCode\n keep_world_transform=True, # bool\n on_move_fn=None, # typing.Callable\n destructive=True)\n" }, { "title": "PayloadCommandBase", "description": "[omni.usd.commands.usd_commands]", "snippet": "omni.kit.commands.execute(\"PayloadCommandBase\",\n stage=stage,\n prim_path=prim_path, # pxr.Sdf.Path\n payload=payload) # pxr.Sdf.Payload\n" }, { "title": "ReferenceCommandBase", "description": "[omni.usd.commands.usd_commands]", "snippet": "omni.kit.commands.execute(\"ReferenceCommandBase\",\n stage=stage,\n prim_path=prim_path, # pxr.Sdf.Path\n reference=reference) # pxr.Sdf.Reference\n" }, { "title": "RelationshipTargetBase", "description": "[omni.usd.commands.usd_commands]", "snippet": "omni.kit.commands.execute(\"RelationshipTargetBase\",\n relationship=relationship, # pxr.Usd.Relationship\n target=target) # pxr.Sdf.Path\n" }, { "title": "RemovePayloadCommand", "description": "[omni.usd.commands.usd_commands]", "snippet": "omni.kit.commands.execute(\"RemovePayloadCommand\",\n stage=stage,\n prim_path=prim_path, # pxr.Sdf.Path\n payload=payload) # pxr.Sdf.Payload\n" }, { "title": "RemovePropertyCommand", "description": "[omni.usd.commands.usd_commands]\n\nRemove Property.\n\nArgs:\n prop_path (str): Path of the property to be removed.\n usd_context_name (str): Usd context name to run the command on.", "snippet": "omni.kit.commands.execute(\"RemovePropertyCommand\",\n prop_path=prop_path, # typing.Union[pxr.Sdf.Path, str]\n usd_context_name=\"\") # str\n" }, { "title": "RemoveReferenceCommand", "description": "[omni.usd.commands.usd_commands]", "snippet": "omni.kit.commands.execute(\"RemoveReferenceCommand\",\n stage=stage,\n prim_path=prim_path, # pxr.Sdf.Path\n reference=reference) # pxr.Sdf.Reference\n" }, { "title": "RemoveRelationshipTargetCommand", "description": "[omni.usd.commands.usd_commands]\n\nRemove target from a relationship", "snippet": "omni.kit.commands.execute(\"RemoveRelationshipTargetCommand\",\n relationship=relationship, # pxr.Usd.Relationship\n target=target) # pxr.Sdf.Path\n" }, { "title": "ReplacePayloadCommand", "description": "[omni.usd.commands.usd_commands]", "snippet": "omni.kit.commands.execute(\"ReplacePayloadCommand\",\n stage=stage,\n prim_path=prim_path, # pxr.Sdf.Path\n old_payload=old_payload, # pxr.Sdf.Payload\n new_payload=new_payload) # pxr.Sdf.Payload\n" }, { "title": "ReplaceReferenceCommand", "description": "[omni.usd.commands.usd_commands]", "snippet": "omni.kit.commands.execute(\"ReplaceReferenceCommand\",\n stage=stage,\n prim_path=prim_path, # pxr.Sdf.Path\n old_reference=old_reference, # pxr.Sdf.Reference\n new_reference=new_reference) # pxr.Sdf.Reference\n" }, { "title": "ReplaceReferencesCommand", "description": "[omni.usd.commands.usd_commands]\n\nClears/Add references undoable.\n\nNOTE: THIS COMMAND HAS A LOT OF ISSUES AND IS DEPRECATED. PLEASE USE ReplaceReferenceCommand instead!\n\nArgs:\n path (str): Prim path.\n old_url(str): Url to be replaced.\n new_url(str): Replacement url.", "snippet": "omni.kit.commands.execute(\"ReplaceReferencesCommand\",\n path=path, # str\n old_url=old_url, # str\n new_url=new_url) # str\n" }, { "title": "SelectPrimsCommand", "description": "[omni.usd.commands.usd_commands]\n\nSelect primitives undoable.\n\nArgs:\n old_selected_paths (List[str]): Old selected prim paths.\n new_selected_paths (List[str]): Prim paths to be selected.\n expand_in_stage (bool, DEPRECATED): Whether to expand the path in Stage Window on selection.\n This param is left for compatibility.\n\nREMINDER: Both params old_selected_paths and new_selected_paths should be const\nout of the command. And it's caller's responsibility to maintain that. Otherwise, undo will not\nreturn to its original state.", "snippet": "omni.kit.commands.execute(\"SelectPrimsCommand\",\n old_selected_paths=old_selected_paths, # typing.List[str]\n new_selected_paths=new_selected_paths, # typing.List[str]\n expand_in_stage=expand_in_stage) # bool\n" }, { "title": "SetMaterialStrengthCommand", "description": "[omni.usd.commands.usd_commands]\n\nSet material binding strength undoable.\n\nArgs:\n rel: Material binding relationship.\n strength (float): Strength.", "snippet": "omni.kit.commands.execute(\"SetMaterialStrengthCommand\",\n rel=rel,\n strength=strength)\n" }, { "title": "SetRelationshipTargetsCommand", "description": "[omni.usd.commands.usd_commands]\n\nSet target(s) to a relationship", "snippet": "omni.kit.commands.execute(\"SetRelationshipTargetsCommand\",\n relationship=relationship, # pxr.Usd.Relationship\n targets=targets) # typing.List[pxr.Sdf.Path]\n" }, { "title": "ToggleVisibilitySelectedPrimsCommand", "description": "[omni.usd.commands.usd_commands]\n\nToggles the visiblity of the selected primitives undoable.\n\nArgs:\n selected_paths (List[str]): Old selected prim paths.", "snippet": "omni.kit.commands.execute(\"ToggleVisibilitySelectedPrimsCommand\",\n selected_paths=selected_paths) # typing.List[str]\n" }, { "title": "TransformMultiPrimsSRTCpp", "description": "[omni.usd]", "snippet": "omni.kit.commands.execute(\"TransformMultiPrimsSRTCpp\")\n" }, { "title": "TransformPrimCommand", "description": "[omni.usd.commands.usd_commands]\n\nTransform primitive undoable.\n\nArgs:\n path (str): Prim path.\n new_transform_matrix: New transform matrix.\n old_transform_matrix: Optional old transform matrix to undo to. If `None` use current transform.", "snippet": "omni.kit.commands.execute(\"TransformPrimCommand\",\n path=path, # str\n new_transform_matrix=new_transform_matrix, # pxr.Gf.Matrix4d\n old_transform_matrix=None, # pxr.Gf.Matrix4d\n time_code=DEFAULT, # pxr.Usd.TimeCode\n had_transform_at_key=False, # bool\n usd_context_name=\"\") # str\n" }, { "title": "TransformPrimSRTCommand", "description": "[omni.usd.commands.usd_commands]\n\nTransform primitive undoable.\n\nArgs:\n path (str): Prim path.\n new_translation (Gf.Vec3d): New local translation.\n new_rotation_euler (Gf.Vec3d): New local rotation euler angles (in degree).\n new_scale (Gf.Vec3d): New scale.\n new_rotation_order (Gf.Vec3i): New rotation order (e.g. (0, 1, 2) means XYZ). Set to None to stay the same.\n old_translation (Gf.Vec3d): Old local translation. Leave to None to use current value.\n old_rotation_euler (Gf.Vec3d): Old local rotation euler angles. Leave to None to use current value.\n old_rotation_order (Gf.Vec3i): Old local rotation order. Leave to None to use current value.\n old_scale (Gf.Vec3d): Old scale. Leave to None to use current value.\n time_code (Usd.TimeCode): TimeCode to set transform to.\n had_transform_at_key (bool): If there's key for transfrom.\n usd_context_name (str): Usd context name to run the command on.", "snippet": "omni.kit.commands.execute(\"TransformPrimSRTCommand\",\n path=path, # str\n new_translation=None, # pxr.Gf.Vec3d\n new_rotation_euler=None, # pxr.Gf.Vec3d\n new_scale=None, # pxr.Gf.Vec3d\n new_rotation_order=None, # pxr.Gf.Vec3i\n old_translation=None, # pxr.Gf.Vec3d\n old_rotation_euler=None, # pxr.Gf.Vec3d\n old_rotation_order=None, # pxr.Gf.Vec3i\n old_scale=None, # pxr.Gf.Vec3d\n time_code=DEFAULT, # pxr.Usd.TimeCode\n had_transform_at_key=False, # bool\n usd_context_name=\"\") # str\n" }, { "title": "TransformPrimSRTCpp", "description": "[omni.usd]", "snippet": "omni.kit.commands.execute(\"TransformPrimSRTCpp\")\n" }, { "title": "TransformPrimsCommand", "description": "[omni.usd.commands.usd_commands]\n\nTransform multiple primitives undoable.\n\nUndo/Redo grouping handled automatically.\n\nArgs:\n prims_to_transform: List of primitive to transform in a tuple of (path, new_transform, old_transform).", "snippet": "omni.kit.commands.execute(\"TransformPrimsCommand\",\n prims_to_transform=prims_to_transform) # typing.List[typing.Tuple[str, pxr.Gf.Matrix4d, pxr.Gf.Matrix4d, pxr.Usd.TimeCode]]\n" }, { "title": "TransformPrimsSRTCommand", "description": "[omni.usd.commands.usd_commands]\n\nTransform multiple primitives undoable.\n\nUndo/Redo grouping handled automatically.\n\nArgs:\n prims_to_transform: List of primitive to transform in a tuple of\n (path,\n new_translation,\n new_rotation_euler,\n new_rotation_order,\n new_scale,\n old_translation,\n old_rotation_euler,\n old_rotation_order,\n old_scale,\n time_code,\n had_transform_at_key).", "snippet": "omni.kit.commands.execute(\"TransformPrimsSRTCommand\",\n prims_to_transform=prims_to_transform) # typing.List[typing.Tuple[str, pxr.Gf.Vec3d, pxr.Gf.Vec3d, pxr.Gf.Vec3i, pxr.Gf.Vec3d, pxr.Gf.Vec3d, pxr.Gf.Vec3d, pxr.Gf.Vec3i, pxr.Gf.Vec3d, pxr.Usd.TimeCode, bool]]\n" }, { "title": "UnhideAllPrimsCommand", "description": "[omni.usd.commands.usd_commands]", "snippet": "omni.kit.commands.execute(\"UnhideAllPrimsCommand\")\n" } ] } ] }
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/snippets/generate_isaac_sim.py
import json import inspect from types import FunctionType from pxr import Sdf def args_annotations(method): signature = inspect.signature(method) args = [] annotations = [] return_val = signature.return_annotation return_val = class_fullname(return_val) if return_val != type(inspect.Signature.empty) else "None" return_val = "" if return_val in ["inspect._empty", "None"] else return_val for parameter in signature.parameters.values(): if parameter.name in ["self", "args", "kwargs"]: continue # arg if type(parameter.default) == type(inspect.Parameter.empty): args.append("{}={}".format(parameter.name, parameter.name)) else: default_value = parameter.default if type(parameter.default) is str: default_value = '"{}"'.format(parameter.default) elif type(parameter.default) is Sdf.Path: if parameter.default == Sdf.Path.emptyPath: default_value = "Sdf.Path.emptyPath" else: default_value = 'Sdf.Path("{}")'.format(parameter.default) elif inspect.isclass(parameter.default): default_value = class_fullname(parameter.default) args.append("{}={}".format(parameter.name, default_value)) # annotation if parameter.annotation == inspect.Parameter.empty: annotations.append("") else: annotations.append(class_fullname(parameter.annotation)) return args, annotations, return_val def class_fullname(c): try: module = c.__module__ if module == 'builtins': return c.__name__ return module + '.' + c.__name__ except: return str(c) def get_class(klass, object_name): class_name = klass.__qualname__ args, annotations, _ = args_annotations(klass.__init__) # build snippet arguments_as_string = ')' if args: arguments_as_string = '' spaces = len(object_name) + 3 + len(class_name) + 1 for i, arg, annotation in zip(range(len(args)), args, annotations): k = 0 if not i else 1 is_last = i >= len(args) - 1 if annotation: arguments_as_string += " " * k * spaces + "{}{}".format(arg, ") # {}".format(annotation) if is_last else ", # {}\n".format(annotation)) else: arguments_as_string += " " * k * spaces + "{}{}".format(arg, ")" if is_last else ",\n") try: description = klass.__doc__.replace("\n ", "\n") if description.startswith("\n"): description = description[1:] if description.endswith("\n"): description = description[:-1] while " " in description: description = description.replace(" ", " ") except Exception as e: description = None if not description: description = "" snippet = '{} = {}({}'.format(object_name, class_name, arguments_as_string) + "\n" return { "title": class_name, "description": description, "snippet": snippet } def get_methods(klass, object_name): method_names = sorted([x for x, y in klass.__dict__.items() if type(y) == FunctionType and not x.startswith("__")]) snippets = [] for method_name in method_names: if method_name.startswith("_") or method_name.startswith("__"): continue args, annotations, return_val = args_annotations(klass.__dict__[method_name]) # build snippet arguments_as_string = ')' if args: arguments_as_string = '' return_var_name = "" if method_name.startswith("get_"): return_var_name = method_name[4:] + " = " spaces = len(return_var_name) + len(object_name) + 1 + len(method_name) + 1 for i, arg, annotation in zip(range(len(args)), args, annotations): k = 0 if not i else 1 is_last = i >= len(args) - 1 if annotation: arguments_as_string += " " * k * spaces + "{}{}".format(arg, ") # {}".format(annotation) if is_last else ", # {}\n".format(annotation)) else: arguments_as_string += " " * k * spaces + "{}{}".format(arg, ")" if is_last else ",\n") try: description = klass.__dict__[method_name].__doc__.replace("\n ", "\n") while " " in description: description = description.replace(" ", " ") if description.startswith("\n"): description = description[1:] if description.endswith("\n"): description = description[:-1] if description.endswith("\n "): description = description[:-2] except Exception as e: description = None if not description: description = "" if return_var_name: snippet = '{}{}.{}({}'.format(return_var_name, object_name, method_name, arguments_as_string) + "\n" else: snippet = '{}.{}({}'.format(object_name, method_name, arguments_as_string) + "\n" snippets.append({ "title": method_name, "description": description, "snippet": snippet }) return snippets def get_functions(module, module_name, exclude_functions=[]): functions = inspect.getmembers(module, inspect.isfunction) snippets = [] for function in functions: function_name = function[0] if function_name.startswith("_") or function_name.startswith("__"): continue if function_name in exclude_functions: continue args, annotations, return_val = args_annotations(function[1]) # build snippet arguments_as_string = ')' if args: arguments_as_string = '' return_var_name = "" if return_val: return_var_name = "value = " spaces = len(return_var_name) + len(module_name) + 1 + len(function_name) + 1 for i, arg, annotation in zip(range(len(args)), args, annotations): k = 0 if not i else 1 is_last = i >= len(args) - 1 if annotation: arguments_as_string += " " * k * spaces + "{}{}".format(arg, ") # {}".format(annotation) if is_last else ", # {}\n".format(annotation)) else: arguments_as_string += " " * k * spaces + "{}{}".format(arg, ")" if is_last else ",\n") try: description = function[1].__doc__.replace("\n ", "\n") while " " in description: description = description.replace(" ", " ") if description.startswith("\n"): description = description[1:] if description.endswith("\n"): description = description[:-1] if description.endswith("\n "): description = description[:-2] except Exception as e: description = None if not description: description = "" if return_var_name: snippet = '{}{}.{}({}'.format(return_var_name, module_name, function_name, arguments_as_string) + "\n" else: snippet = '{}.{}({}'.format(module_name, function_name, arguments_as_string) + "\n" snippets.append({ "title": function_name, "description": description, "snippet": snippet }) return snippets from omni.isaac.core.articulations import Articulation, ArticulationGripper, ArticulationSubset, ArticulationView from omni.isaac.core.controllers import ArticulationController, BaseController, BaseGripperController from omni.isaac.core.loggers import DataLogger from omni.isaac.core.materials import OmniGlass, OmniPBR, ParticleMaterial, ParticleMaterialView, PhysicsMaterial, PreviewSurface, VisualMaterial from omni.isaac.core.objects import DynamicCapsule, DynamicCone, DynamicCuboid, DynamicCylinder, DynamicSphere from omni.isaac.core.objects import FixedCapsule, FixedCone, FixedCuboid, FixedCylinder, FixedSphere, GroundPlane from omni.isaac.core.objects import VisualCapsule, VisualCone, VisualCuboid, VisualCylinder, VisualSphere from omni.isaac.core.physics_context import PhysicsContext from omni.isaac.core.prims import BaseSensor, ClothPrim, ClothPrimView, GeometryPrim, GeometryPrimView, ParticleSystem, ParticleSystemView, RigidContactView, RigidPrim, RigidPrimView, XFormPrim, XFormPrimView from omni.isaac.core.robots import Robot, RobotView from omni.isaac.core.scenes import Scene, SceneRegistry from omni.isaac.core.simulation_context import SimulationContext from omni.isaac.core.world import World from omni.isaac.core.tasks import BaseTask, FollowTarget, PickPlace, Stacking from omni.isaac.core.prims._impl.single_prim_wrapper import _SinglePrimWrapper import omni.isaac.core.utils.bounds as utils_bounds import omni.isaac.core.utils.carb as utils_carb import omni.isaac.core.utils.collisions as utils_collisions import omni.isaac.core.utils.constants as utils_constants import omni.isaac.core.utils.distance_metrics as utils_distance_metrics import omni.isaac.core.utils.extensions as utils_extensions import omni.isaac.core.utils.math as utils_math import omni.isaac.core.utils.mesh as utils_mesh import omni.isaac.core.utils.nucleus as utils_nucleus import omni.isaac.core.utils.numpy as utils_numpy import omni.isaac.core.utils.physics as utils_physics import omni.isaac.core.utils.prims as utils_prims import omni.isaac.core.utils.random as utils_random import omni.isaac.core.utils.render_product as utils_render_product import omni.isaac.core.utils.rotations as utils_rotations import omni.isaac.core.utils.semantics as utils_semantics import omni.isaac.core.utils.stage as utils_stage import omni.isaac.core.utils.string as utils_string import omni.isaac.core.utils.transformations as utils_transformations import omni.isaac.core.utils.torch as utils_torch import omni.isaac.core.utils.types as utils_types import omni.isaac.core.utils.viewports as utils_viewports import omni.isaac.core.utils.xforms as utils_xforms # from omni.isaac.dynamic_control import _dynamic_control # _dynamic_control_interface = _dynamic_control.acquire_dynamic_control_interface() from omni.isaac.ui import ui_utils from omni.isaac.kit import SimulationApp # core snippets = [] # articulations subsnippets = [] s0 = get_class(Articulation, "articulation") s1 = get_methods(Articulation, "articulation") s2 = get_methods(_SinglePrimWrapper, "articulation") subsnippets.append({"title": "Articulation", "snippets": [s0] + s1 + s2}) s0 = get_class(ArticulationGripper, "articulation_gripper") s1 = get_methods(ArticulationGripper, "articulation_gripper") subsnippets.append({"title": "ArticulationGripper", "snippets": [s0] + s1}) s0 = get_class(ArticulationSubset, "articulation_subset") s1 = get_methods(ArticulationSubset, "articulation_subset") subsnippets.append({"title": "ArticulationSubset", "snippets": [s0] + s1}) s0 = get_class(ArticulationView, "articulation_view") s1 = get_methods(ArticulationView, "articulation_view") s2 = get_methods(XFormPrimView, "articulation_view") subsnippets.append({"title": "ArticulationView", "snippets": [s0] + s1 + s2}) snippets.append({"title": "Articulations", "snippets": subsnippets}) # controllers subsnippets = [] s0 = get_class(ArticulationController, "articulation_controller") s1 = get_methods(ArticulationController, "articulation_controller") subsnippets.append({"title": "ArticulationController", "snippets": [s0] + s1}) s0 = get_class(BaseController, "base_controller") s1 = get_methods(BaseController, "base_controller") subsnippets.append({"title": "BaseController", "snippets": [s0] + s1}) s0 = get_class(BaseGripperController, "base_gripper_controller") s1 = get_methods(BaseGripperController, "base_gripper_controller") subsnippets.append({"title": "BaseGripperController", "snippets": [s0] + s1}) snippets.append({"title": "Controllers", "snippets": subsnippets}) # loggers s0 = get_class(DataLogger, "data_logger") s1 = get_methods(DataLogger, "data_logger") snippets.append({"title": "DataLogger", "snippets": [s0] + s1}) # materials subsnippets = [] s0 = get_class(OmniGlass, "omni_glass") s1 = get_methods(OmniGlass, "omni_glass") subsnippets.append({"title": "OmniGlass", "snippets": [s0] + s1}) s0 = get_class(OmniPBR, "omni_pbr") s1 = get_methods(OmniPBR, "omni_pbr") subsnippets.append({"title": "OmniPBR", "snippets": [s0] + s1}) s0 = get_class(ParticleMaterial, "particle_material") s1 = get_methods(ParticleMaterial, "particle_material") subsnippets.append({"title": "ParticleMaterial", "snippets": [s0] + s1}) s0 = get_class(ParticleMaterialView, "particle_material_view") s1 = get_methods(ParticleMaterialView, "particle_material_view") subsnippets.append({"title": "ParticleMaterialView", "snippets": [s0] + s1}) s0 = get_class(PhysicsMaterial, "physics_material") s1 = get_methods(PhysicsMaterial, "physics_material") subsnippets.append({"title": "PhysicsMaterial", "snippets": [s0] + s1}) s0 = get_class(PreviewSurface, "preview_surface") s1 = get_methods(PreviewSurface, "preview_surface") subsnippets.append({"title": "PreviewSurface", "snippets": [s0] + s1}) s0 = get_class(VisualMaterial, "visual_material") s1 = get_methods(VisualMaterial, "visual_material") subsnippets.append({"title": "VisualMaterial", "snippets": [s0] + s1}) snippets.append({"title": "Materials", "snippets": subsnippets}) # objects subsnippets = [] s0 = get_class(DynamicCapsule, "dynamic_capsule") s1 = get_methods(DynamicCapsule, "dynamic_capsule") s2 = get_methods(RigidPrim, "dynamic_capsule") s3 = get_methods(VisualCapsule, "dynamic_capsule") s4 = get_methods(GeometryPrim, "dynamic_capsule") s5 = get_methods(_SinglePrimWrapper, "dynamic_capsule") subsnippets.append({"title": "DynamicCapsule", "snippets": [s0] + s1 + s2 + s3 + s4 + s5}) s0 = get_class(DynamicCone, "dynamic_cone") s1 = get_methods(DynamicCone, "dynamic_cone") s2 = get_methods(RigidPrim, "dynamic_cone") s3 = get_methods(VisualCone, "dynamic_cone") s4 = get_methods(GeometryPrim, "dynamic_cone") s5 = get_methods(_SinglePrimWrapper, "dynamic_cone") subsnippets.append({"title": "DynamicCone", "snippets": [s0] + s1 + s2 + s3 + s4 + s5}) s0 = get_class(DynamicCuboid, "dynamic_cuboid") s1 = get_methods(DynamicCuboid, "dynamic_cuboid") s2 = get_methods(RigidPrim, "dynamic_cuboid") s3 = get_methods(VisualCuboid, "dynamic_cuboid") s4 = get_methods(GeometryPrim, "dynamic_cuboid") s5 = get_methods(_SinglePrimWrapper, "dynamic_cuboid") subsnippets.append({"title": "DynamicCuboid", "snippets": [s0] + s1 + s2 + s3 + s4 + s5}) s0 = get_class(DynamicCylinder, "dynamic_cylinder") s1 = get_methods(DynamicCylinder, "dynamic_cylinder") s2 = get_methods(RigidPrim, "dynamic_cylinder") s3 = get_methods(VisualCylinder, "dynamic_cylinder") s4 = get_methods(GeometryPrim, "dynamic_cylinder") s5 = get_methods(_SinglePrimWrapper, "dynamic_cylinder") subsnippets.append({"title": "DynamicCylinder", "snippets": [s0] + s1 + s2 + s3 + s4 + s5}) s0 = get_class(DynamicSphere, "dynamic_sphere") s1 = get_methods(DynamicSphere, "dynamic_sphere") s2 = get_methods(RigidPrim, "dynamic_sphere") s3 = get_methods(VisualSphere, "dynamic_sphere") s4 = get_methods(GeometryPrim, "dynamic_sphere") s5 = get_methods(_SinglePrimWrapper, "dynamic_sphere") subsnippets.append({"title": "DynamicSphere", "snippets": [s0] + s1 + s2 + s3 + s4 + s5}) s0 = get_class(FixedCapsule, "fixed_capsule") s1 = get_methods(VisualCapsule, "fixed_capsule") s2 = get_methods(GeometryPrim, "fixed_capsule") s3 = get_methods(_SinglePrimWrapper, "fixed_capsule") subsnippets.append({"title": "FixedCapsule", "snippets": [s0] + s1 + s2 + s3}) s0 = get_class(FixedCone, "fixed_cone") s1 = get_methods(VisualCone, "fixed_cone") s2 = get_methods(GeometryPrim, "fixed_cone") s3 = get_methods(_SinglePrimWrapper, "fixed_cone") subsnippets.append({"title": "FixedCone", "snippets": [s0] + s1 + s2 + s3}) s0 = get_class(FixedCuboid, "fixed_cuboid") s1 = get_methods(VisualCuboid, "fixed_cuboid") s2 = get_methods(GeometryPrim, "fixed_cuboid") s3 = get_methods(_SinglePrimWrapper, "fixed_cuboid") subsnippets.append({"title": "FixedCuboid", "snippets": [s0] + s1 + s2 + s3}) s0 = get_class(FixedCylinder, "fixed_cylinder") s1 = get_methods(VisualCylinder, "fixed_cylinder") s2 = get_methods(GeometryPrim, "fixed_cylinder") s3 = get_methods(_SinglePrimWrapper, "fixed_cylinder") subsnippets.append({"title": "FixedCylinder", "snippets": [s0] + s1 + s2 + s3}) s0 = get_class(FixedSphere, "fixed_sphere") s1 = get_methods(VisualSphere, "fixed_sphere") s2 = get_methods(GeometryPrim, "fixed_sphere") s3 = get_methods(_SinglePrimWrapper, "fixed_sphere") subsnippets.append({"title": "FixedSphere", "snippets": [s0] + s1 + s2 + s3}) s0 = get_class(GroundPlane, "ground_plane") s1 = get_methods(GroundPlane, "ground_plane") subsnippets.append({"title": "GroundPlane", "snippets": [s0] + s1}) s0 = get_class(VisualCapsule, "visual_capsule") s1 = get_methods(VisualCapsule, "visual_capsule") s2 = get_methods(GeometryPrim, "visual_capsule") s3 = get_methods(_SinglePrimWrapper, "visual_capsule") subsnippets.append({"title": "VisualCapsule", "snippets": [s0] + s1 + s2 + s3}) s0 = get_class(VisualCone, "visual_cone") s1 = get_methods(VisualCone, "visual_cone") s2 = get_methods(GeometryPrim, "visual_cone") s3 = get_methods(_SinglePrimWrapper, "visual_cone") subsnippets.append({"title": "VisualCone", "snippets": [s0] + s1 + s2 + s3}) s0 = get_class(VisualCuboid, "visual_cuboid") s1 = get_methods(VisualCuboid, "visual_cuboid") s2 = get_methods(GeometryPrim, "visual_cuboid") s3 = get_methods(_SinglePrimWrapper, "visual_cuboid") subsnippets.append({"title": "VisualCuboid", "snippets": [s0] + s1 + s2 + s3}) s0 = get_class(VisualCylinder, "visual_cylinder") s1 = get_methods(VisualCylinder, "visual_cylinder") s2 = get_methods(GeometryPrim, "visual_cylinder") s3 = get_methods(_SinglePrimWrapper, "visual_cylinder") subsnippets.append({"title": "VisualCylinder", "snippets": [s0] + s1 + s2 + s3}) s0 = get_class(VisualSphere, "visual_sphere") s1 = get_methods(VisualSphere, "visual_sphere") s2 = get_methods(GeometryPrim, "visual_sphere") s3 = get_methods(_SinglePrimWrapper, "visual_sphere") subsnippets.append({"title": "VisualSphere", "snippets": [s0] + s1 + s2 + s3}) snippets.append({"title": "Objects", "snippets": subsnippets}) # physics_context s0 = get_class(PhysicsContext, "physics_context") s1 = get_methods(PhysicsContext, "physics_context") snippets.append({"title": "PhysicsContext", "snippets": [s0] + s1}) # prims subsnippets = [] s0 = get_class(BaseSensor, "base_sensor") s1 = get_methods(BaseSensor, "base_sensor") s2 = get_methods(_SinglePrimWrapper, "base_sensor") subsnippets.append({"title": "BaseSensor", "snippets": [s0] + s1 + s2}) s0 = get_class(ClothPrim, "cloth_prim") s1 = get_methods(ClothPrim, "cloth_prim") s2 = get_methods(_SinglePrimWrapper, "cloth_prim") subsnippets.append({"title": "ClothPrim", "snippets": [s0] + s1 + s2}) s0 = get_class(ClothPrimView, "cloth_prim_view") s1 = get_methods(ClothPrimView, "cloth_prim_view") s2 = get_methods(XFormPrimView, "cloth_prim_view") subsnippets.append({"title": "ClothPrimView", "snippets": [s0] + s1 + s2}) s0 = get_class(GeometryPrim, "geometry_prim") s1 = get_methods(GeometryPrim, "geometry_prim") s2 = get_methods(_SinglePrimWrapper, "geometry_prim") subsnippets.append({"title": "GeometryPrim", "snippets": [s0] + s1 + s2}) s0 = get_class(GeometryPrimView, "geometry_prim_view") s1 = get_methods(GeometryPrimView, "geometry_prim_view") s2 = get_methods(XFormPrimView, "geometry_prim_view") subsnippets.append({"title": "GeometryPrimView", "snippets": [s0] + s1 + s2}) s0 = get_class(ParticleSystem, "particle_system") s1 = get_methods(ParticleSystem, "particle_system") subsnippets.append({"title": "ParticleSystem", "snippets": [s0] + s1}) s0 = get_class(ParticleSystemView, "particle_system_view") s1 = get_methods(ParticleSystemView, "particle_system_view") subsnippets.append({"title": "ParticleSystemView", "snippets": [s0] + s1}) s0 = get_class(RigidContactView, "rigid_contact_view") s1 = get_methods(RigidContactView, "rigid_contact_view") subsnippets.append({"title": "RigidContactView", "snippets": [s0] + s1}) s0 = get_class(RigidPrim, "rigid_prim") s1 = get_methods(RigidPrim, "rigid_prim") s2 = get_methods(_SinglePrimWrapper, "rigid_prim") subsnippets.append({"title": "RigidPrim", "snippets": [s0] + s1 + s2}) s0 = get_class(RigidPrimView, "rigid_prim_view") s1 = get_methods(RigidPrimView, "rigid_prim_view") s2 = get_methods(XFormPrimView, "rigid_prim_view") subsnippets.append({"title": "RigidPrimView", "snippets": [s0] + s1 + s2}) s0 = get_class(XFormPrim, "xform_prim") s1 = get_methods(XFormPrim, "xform_prim") s2 = get_methods(_SinglePrimWrapper, "xform_prim") subsnippets.append({"title": "XFormPrim", "snippets": [s0] + s1 + s2}) s0 = get_class(XFormPrimView, "xform_prim_view") s1 = get_methods(XFormPrimView, "xform_prim_view") subsnippets.append({"title": "XFormPrimView", "snippets": [s0] + s1}) snippets.append({"title": "Prims", "snippets": subsnippets}) # robots subsnippets = [] s0 = get_class(Robot, "robot") s1 = get_methods(Robot, "robot") s2 = get_methods(Articulation, "robot") s3 = get_methods(_SinglePrimWrapper, "robot") subsnippets.append({"title": "Robot", "snippets": [s0] + s1 + s2 + s3}) s0 = get_class(RobotView, "robot_view") s1 = get_methods(RobotView, "robot_view") s2 = get_methods(ArticulationView, "robot_view") s3 = get_methods(XFormPrimView, "robot_view") subsnippets.append({"title": "RobotView", "snippets": [s0] + s1 + s2 + s3}) snippets.append({"title": "Robots", "snippets": subsnippets}) # scenes subsnippets = [] s0 = get_class(Scene, "scene") s1 = get_methods(Scene, "scene") subsnippets.append({"title": "Scene", "snippets": [s0] + s1}) s0 = get_class(SceneRegistry, "scene_registry") s1 = get_methods(SceneRegistry, "scene_registry") subsnippets.append({"title": "SceneRegistry", "snippets": [s0] + s1}) snippets.append({"title": "Scenes", "snippets": subsnippets}) # simulation_context s0 = get_class(SimulationContext, "simulation_context") s1 = get_methods(SimulationContext, "simulation_context") snippets.append({"title": "SimulationContext", "snippets": [s0] + s1}) # world s0 = get_class(World, "world") s1 = get_methods(World, "world") s2 = get_methods(SimulationContext, "world") snippets.append({"title": "World", "snippets": [s0] + s1 + s2}) # tasks subsnippets = [] s0 = get_class(BaseTask, "base_task") s1 = get_methods(BaseTask, "base_task") subsnippets.append({"title": "BaseTask", "snippets": [s0] + s1}) s0 = get_class(FollowTarget, "follow_target") s1 = get_methods(FollowTarget, "follow_target") s2 = get_methods(BaseTask, "follow_target") subsnippets.append({"title": "FollowTarget", "snippets": [s0] + s1 + s2}) s0 = get_class(PickPlace, "pick_place") s1 = get_methods(PickPlace, "pick_place") s2 = get_methods(BaseTask, "pick_place") subsnippets.append({"title": "PickPlace", "snippets": [s0] + s1 + s2}) s0 = get_class(Stacking, "stacking") s1 = get_methods(Stacking, "stacking") s2 = get_methods(BaseTask, "stacking") subsnippets.append({"title": "Stacking", "snippets": [s0] + s1 + s2}) snippets.append({"title": "Tasks", "snippets": subsnippets}) # core utils snippets_utils = [] s0 = get_functions(utils_bounds, "bounds_utils", exclude_functions=["get_prim_at_path"]) snippets_utils.append({"title": "Bounds", "snippets": s0}) s0 = get_functions(utils_carb, "carb_utils") snippets_utils.append({"title": "Carb", "snippets": s0}) s0 = get_functions(utils_collisions, "collisions_utils", exclude_functions=["get_current_stage"]) snippets_utils.append({"title": "Collisions", "snippets": s0}) s0 = get_functions(utils_constants, "constants_utils") snippets_utils.append({"title": "Constants", "snippets": [{"title": "AXES_INDICES", "description": "Mapping from axis name to axis ID", "snippet": "AXES_INDICES\n"}, {"title": "AXES_TOKEN", "description": "Mapping from axis name to axis USD token", "snippet": "AXES_TOKEN\n"}]}) s0 = get_functions(utils_distance_metrics, "distance_metrics_utils") snippets_utils.append({"title": "Distance Metrics", "snippets": s0}) s0 = get_functions(utils_extensions, "extensions_utils") snippets_utils.append({"title": "Extensions", "snippets": s0}) s0 = get_functions(utils_math, "math_utils") snippets_utils.append({"title": "Math", "snippets": s0}) s0 = get_functions(utils_mesh, "mesh_utils", exclude_functions=["get_stage_units", "get_relative_transform"]) snippets_utils.append({"title": "Mesh", "snippets": s0}) s0 = get_functions(utils_nucleus, "nucleus_utils", exclude_functions=["namedtuple", "urlparse", "get_version"]) snippets_utils.append({"title": "Nucleus", "snippets": s0}) s0 = get_functions(utils_numpy, "numpy_utils") snippets_utils.append({"title": "Numpy", "snippets": s0}) s0 = get_functions(utils_physics, "physics_utils", exclude_functions=["get_current_stage"]) snippets_utils.append({"title": "Physics", "snippets": s0}) s0 = get_functions(utils_prims, "prims_utils", exclude_functions=["add_reference_to_stage", "get_current_stage", "find_root_prim_path_from_regex", "add_update_semantics"]) snippets_utils.append({"title": "Prims", "snippets": s0}) s0 = get_functions(utils_random, "random_utils", exclude_functions=["get_world_pose_from_relative", "get_translation_from_target", "euler_angles_to_quat"]) snippets_utils.append({"title": "Random", "snippets": s0}) s0 = get_functions(utils_render_product, "render_product_utils", exclude_functions=["set_prim_hide_in_stage_window", "set_prim_no_delete", "get_current_stage"]) snippets_utils.append({"title": "Render Product", "snippets": s0}) s0 = get_functions(utils_rotations, "rotations_utils") snippets_utils.append({"title": "Rotations", "snippets": s0}) s0 = get_functions(utils_semantics, "semantics_utils") snippets_utils.append({"title": "Semantics", "snippets": s0}) s0 = get_functions(utils_stage, "stage_utils") snippets_utils.append({"title": "Stage", "snippets": s0}) s0 = get_functions(utils_string, "string_utils") snippets_utils.append({"title": "String", "snippets": s0}) s0 = get_functions(utils_transformations, "transformations_utils", exclude_functions=["gf_quat_to_np_array"]) snippets_utils.append({"title": "Transformations", "snippets": s0}) s0 = get_functions(utils_torch, "torch_utils") snippets_utils.append({"title": "Torch", "snippets": s0}) subsnippets = [] s0 = get_class(utils_types.ArticulationAction, "articulation_action") s1 = get_methods(utils_types.ArticulationAction, "articulation_action") subsnippets.append({"title": "ArticulationAction", "snippets": [s0] + s1}) s0 = get_class(utils_types.ArticulationActions, "articulation_actions") subsnippets.append(s0) s0 = get_class(utils_types.DataFrame, "data_frame") s1 = get_methods(utils_types.DataFrame, "data_frame") subsnippets.append({"title": "DataFrame", "snippets": [s0] + s1}) s0 = get_class(utils_types.DOFInfo, "dof_Info") subsnippets.append(s0) s0 = get_class(utils_types.DynamicState, "dynamic_state") subsnippets.append(s0) s0 = get_class(utils_types.DynamicsViewState, "dynamics_view_state") subsnippets.append(s0) s0 = get_class(utils_types.JointsState, "joints_state") subsnippets.append(s0) s0 = get_class(utils_types.XFormPrimState, "xform_prim_state") subsnippets.append(s0) s0 = get_class(utils_types.XFormPrimViewState, "xform_prim_view_state") subsnippets.append(s0) s0 = get_functions(utils_types, "types_utils") snippets_utils.append({"title": "Types", "snippets": subsnippets}) s0 = get_functions(utils_viewports, "viewports_utils", exclude_functions=["get_active_viewport", "get_current_stage", "set_prim_hide_in_stage_window", "set_prim_no_delete"]) snippets_utils.append({"title": "Viewports", "snippets": s0}) s0 = get_functions(utils_xforms, "xforms_utils") snippets_utils.append({"title": "XForms", "snippets": s0}) # ui utils snippets_ui_utils = [] s0 = get_functions(ui_utils, "ui_utils") snippets_ui_utils.append({"title": "UI Utils", "snippets": s0}) # SimulationApp snippets_simulation_app = [] s0 = get_class(SimulationApp, "simulation_app") s1 = get_methods(SimulationApp, "simulation_app") snippets_simulation_app.append({"title": "SimulationApp", "snippets": [s0] + s1}) with open("isaac-sim-snippets-core.json", "w") as f: json.dump(snippets, f, indent=0) with open("isaac-sim-snippets-utils.json", "w") as f: json.dump(snippets_utils, f, indent=0) with open("isaac-sim-snippets-ui-utils.json", "w") as f: json.dump(snippets_ui_utils, f, indent=0) with open("isaac-sim-snippets-simulation-app.json", "w") as f: json.dump(snippets_simulation_app, f, indent=0) print("DONE")
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/snippets/python-kit.json
{ "snippets": [ { "title": "Carb", "snippets": [ { "title": "Common import", "description": "Common import statements", "snippet": "import carb\n" }, { "title": "Get settings", "description": "Get Omniverse application/extension settings", "snippet": "settings = carb.settings.get_settings()\n\n# setting path: application: \"/app/key\", extension: \"/exts/the.ext.name/key\"\nvalue = settings.get(\"${1:setting_path}\")\n" }, { "title": "Set settings (persistent or not)", "description": "Set Omniverse application/extension settings", "snippet": "settings = carb.settings.get_settings()\n\n# setting path: application: \"/app/key\", extension \"/exts/the.ext.name/key\")\n# value types: int: 23, float: 3.14, bool: False, str: \"summer\", array: [9,13,17], dict: {\"a\": 2, \"b\": \"winter\"}\n# all settings stored under \"/persistent\" (e.g \"/persistent/exts/the.ext.name/key\") are saved between sessions\n# - location of the persistent settings file: settings.get(\"/app/userConfigPath\")\nsettings.set(\"${1:setting_path}\", ${2:value})\n" }, { "title": "Log info", "description": "Log an info message", "snippet": "carb.log_info(\"${1:message}\")\n" }, { "title": "Log warning", "description": "Log a warning message", "snippet": "carb.log_warn(\"${1:message}\")\n" }, { "title": "Log error", "description": "Log an error message", "snippet": "carb.log_error(\"${1:message}\")\n" } ] }, { "title": "Events", "snippets": [ { "title": "Custom events", "description": "Create and subscribe/unsubscribe to custom events", "snippet": "import carb.events\nimport omni.kit.app\n\n# event is unique integer id (create it from string by hashing, using helper function)\n# [ext name].[event name] is the recommended naming convention\nMY_CUSTOM_EVENT = carb.events.type_from_string(\"${1:omni.my.extension.MY_CUSTOM_EVENT}\")\n\n# common event bus (event queue which is popped every update (frame))\nbus = omni.kit.app.get_app().get_message_bus_event_stream()\n\n# callback\ndef on_custom_event(event):\n print(event.type, event.type == MY_CUSTOM_EVENT, event.payload)\n\n# subscription (keep subscription objects alive for subscription to work)\n# - push to queue is called immediately when pushed\n# - pop is called on next update\ncustom_event_push_sub = bus.create_subscription_to_push_by_type(MY_CUSTOM_EVENT, on_custom_event)\ncustom_event_pop_sub = bus.create_subscription_to_pop_by_type(MY_CUSTOM_EVENT, on_custom_event)\n\n# push event the bus with custom payload\nbus.push(MY_CUSTOM_EVENT, payload={\"data\": 2, \"x\": \"y\"})\n\n# unsubscription\ncustom_event_push_sub = None\ncustom_event_pop_sub = None\n" }, { "title": "Keyboard input event", "description": "Subscribe/unsubscribe to keyboard input events", "snippet": "import carb.input\nimport omni.appwindow\n\n# callback\ndef on_keyboard_event(event):\n print(f\"Input event: {event.device} {event.input} {event.keyboard} {event.modifiers} {event.type}\")\n # e.g. key A pressed/released\n if event.input == carb.input.KeyboardInput.A:\n if event.type == carb.input.KeyboardEventType.KEY_PRESS:\n print(\"Key A pressed\")\n elif event.type == carb.input.KeyboardEventType.KEY_RELEASE:\n print(\"Key A released\")\n\n# get keyboard\nkeyboard = omni.appwindow.get_default_app_window().get_keyboard()\n\n# subscription\nkeyboard_event_sub = (carb.input.acquire_input_interface()\n .subscribe_to_keyboard_events(keyboard, on_keyboard_event))\n\n# unsubscription\ncarb.input.acquire_input_interface().unsubscribe_to_keyboard_events(keyboard, keyboard_event_sub)\n" }, { "title": "Physics event", "description": "Subscribe/unsubscribe to physics events", "snippet": "import carb.events\nimport omni.physx\n\n# callback\ndef on_physics_event(dt):\n print(f\"Physics event: {dt}\")\n\n# subscription\nphysics_event_sub = (omni.physx.acquire_physx_interface()\n .subscribe_physics_step_events(on_physics_event))\n\n# unsubscription\nphysics_event_sub = None\n" }, { "title": "Setting changes", "description": "Subscribe/unsubscribe to setting changes", "snippet": "import omni.kit.app\nimport carb.settings\n\nsettings = carb.settings.get_settings()\n\n# callback\ndef on_setting_changes(value, change_type):\n # change_type: carb.settings.ChangeEventType.CHANGED, carb.settings.ChangeEventType.DESTROYED\n print(value, change_type)\n\n# subscription\nsetting_changes_sub = omni.kit.app.SettingChangeSubscription(\"${1:/exts/the.ext.name/key}\", on_setting_changes)\n\n# e.g. modify value\nsettings.set(\"/exts/the.ext.name/key\", 23)\n\n# unsubscription\nsetting_changes_sub = None\n" }, { "title": "Shutdown event", "description": "Subscribe/unsubscribe to shutdown events", "snippet": "import carb.events\nimport omni.kit.app\n\n# callback\ndef on_shutdown_event(event):\n if event.type == omni.kit.app.POST_QUIT_EVENT_TYPE:\n print(\"We are about to shutdown\")\n\n# subscription\nshutdown_event_sub = (omni.kit.app.get_app().get_shutdown_event_stream()\n .create_subscription_to_pop(on_shutdown_event, name=\"name for debugging\", order=0))\n\n# unsubscription\nshutdown_event_sub = None\n" }, { "title": "Stage event", "description": "Subscribe/unsubscribe to stage events", "snippet": "import carb.events\nimport omni.usd\n\n# callback\ndef on_stage_event(event):\n print(f\"Stage event: {event.type} {event.sender} {event.payload}\")\n if event.type == int(omni.usd.StageEventType.SAVED):\n pass\n elif event.type == int(omni.usd.StageEventType.SAVE_FAILED):\n pass\n elif event.type == int(omni.usd.StageEventType.OPENING):\n pass\n elif event.type == int(omni.usd.StageEventType.OPENED):\n pass\n elif event.type == int(omni.usd.StageEventType.OPEN_FAILED):\n pass\n elif event.type == int(omni.usd.StageEventType.CLOSING):\n pass\n elif event.type == int(omni.usd.StageEventType.CLOSED):\n pass\n elif event.type == int(omni.usd.StageEventType.SELECTION_CHANGED):\n pass\n elif event.type == int(omni.usd.StageEventType.ASSETS_LOADED):\n pass\n elif event.type == int(omni.usd.StageEventType.ASSETS_LOAD_ABORTED):\n pass\n elif event.type == int(omni.usd.StageEventType.GIZMO_TRACKING_CHANGED):\n pass\n elif event.type == int(omni.usd.StageEventType.MDL_PARAM_LOADED):\n pass\n elif event.type == int(omni.usd.StageEventType.SETTINGS_LOADED):\n pass\n elif event.type == int(omni.usd.StageEventType.SETTINGS_SAVING):\n pass\n elif event.type == int(omni.usd.StageEventType.OMNIGRAPH_START_PLAY):\n pass\n elif event.type == int(omni.usd.StageEventType.OMNIGRAPH_STOP_PLAY):\n pass\n elif event.type == int(omni.usd.StageEventType.SIMULATION_START_PLAY):\n pass\n elif event.type == int(omni.usd.StageEventType.SIMULATION_STOP_PLAY):\n pass\n elif event.type == int(omni.usd.StageEventType.ANIMATION_START_PLAY):\n pass\n elif event.type == int(omni.usd.StageEventType.ANIMATION_STOP_PLAY):\n pass\n elif event.type == int(omni.usd.StageEventType.DIRTY_STATE_CHANGED):\n pass\n\n# subscription \nstage_event_sub = (omni.usd.get_context()\n .get_stage_event_stream()\n .create_subscription_to_pop(on_stage_event, name=\"subscription name\"))\n\n# unsubscription\nstage_event_sub = None\n" }, { "title": "Timeline event", "description": "Subscribe/unsubscribe to timeline events", "snippet": "import carb.events\nimport omni.timeline\n\n# callback\ndef on_timeline_event(event):\n print(f\"Timeline event: {event.type} {event.sender} {event.payload}\")\n if event.type == int(omni.timeline.TimelineEventType.PLAY):\n pass\n elif event.type == int(omni.timeline.TimelineEventType.PAUSE):\n pass\n elif event.type == int(omni.timeline.TimelineEventType.STOP):\n pass\n elif event.type == int(omni.timeline.TimelineEventType.CURRENT_TIME_CHANGED):\n pass\n elif event.type == int(omni.timeline.TimelineEventType.CURRENT_TIME_TICKED):\n pass\n elif event.type == int(omni.timeline.TimelineEventType.LOOP_MODE_CHANGED):\n pass\n elif event.type == int(omni.timeline.TimelineEventType.START_TIME_CHANGED):\n pass\n elif event.type == int(omni.timeline.TimelineEventType.END_TIME_CHANGED):\n pass\n elif event.type == int(omni.timeline.TimelineEventType.TIME_CODE_PER_SECOND_CHANGED):\n pass\n elif event.type == int(omni.timeline.TimelineEventType.AUTO_UPDATE_CHANGED):\n pass\n elif event.type == int(omni.timeline.TimelineEventType.PREROLLING_CHANGED):\n pass\n\n# subscription\ntimeline_event_sub = (omni.timeline.get_timeline_interface()\n .get_timeline_event_stream()\n .create_subscription_to_pop(on_timeline_event, name=\"subscription Name\"))\n\n# unsubscription\ntimeline_event_sub = None\n" }, { "title": "Update event", "description": "Subscribe/unsubscribe to update events", "snippet": "import carb.events\nimport omni.kit.app\n\n# callback\ndef on_update_event(event):\n print(f\"Update event: {event.type} {event.sender} {event.payload}\")\n\n# subscription\nupdate_event_sub = (omni.kit.app.get_app()\n .get_update_event_stream()\n .create_subscription_to_pop(on_update_event, name=\"subscription Name\"))\n\n# unsubscription\nupdate_event_sub = None\n" } ] }, { "title": "Extensions", "snippets": [ { "title": "Common import", "description": "Common import statements", "snippet": "import omni.kit.app\n" }, { "title": "Enable an extension", "description": "Enable an extension immediately or non-immediate", "snippet": "extension_manager = omni.kit.app.get_app().get_extension_manager()\n\n# enable immediately\nextension_manager.set_extension_enabled_immediate(\"${1:omni.kit.window.about}\", True)\n# enable non-immediate (executed on the next update)\nextension_manager.set_extension_enabled(\"${1:omni.kit.window.about}\", True)\n" }, { "title": "Check if an extension is enabled", "description": "Check if an extension is enabled", "snippet": "extension_enabled = extension_manager.is_extension_enabled(\"${1:omni.kit.window.about}\")\nprint(extension_enabled)\n" }, { "title": "Get extension config", "description": "Get the config for an extension", "snippet": "manager = omni.kit.app.get_app().get_extension_manager()\n\n# there could be multiple extensions with same name, but different version\n# many functions accept extension id: [ext name]-[ext version].\next_id = manager.get_enabled_extension_id(\"${1:omni.kit.window.script_editor}\")\ndata = manager.get_extension_dict(ext_id)\n\n# extension dict contains whole extension.toml as well as some runtime data:\nprint(data[\"package\"]) # package section\nprint(data[\"state/enabled\"]) # is the extension enabled\nprint(data[\"state/dependencies\"]) # resolved runtime dependencies\nprint(data[\"state/startupTime\"]) # time it took to start it (ms)\n\n# it can be converted to python dict for convenience and to prolong lifetime\ndata = data.get_dict()\nprint(type(data))\n" }, { "title": "Get extension file path", "description": "Get the file path to an extension (e.g. to refer to assets included with the extension)", "snippet": "manager = omni.kit.app.get_app().get_extension_manager()\n\n# there could be multiple extensions with same name, but different version\n# many functions accept extension id: [ext name]-[ext version].\n# you can get the extension by name or by python module name:\next_id = manager.get_enabled_extension_id(\"${1:omni.kit.window.script_editor}\")\n# or\next_id = manager.get_extension_id_by_module(\"${1:omni.kit.window.script_editor}\")\n\n# there are few ways to get file path to a extension:\nprint(manager.get_extension_path(ext_id))\nprint(manager.get_extension_dict(ext_id)[\"path\"])\nprint(manager.get_extension_path_by_module(\"${1:omni.kit.window.script_editor}\"))\n" }, { "title": "Get all registered extensions", "description": "Get all the registered local and remote extensions", "snippet": "manager = omni.kit.app.get_app().get_extension_manager()\n\n# there are a lot of extensions, print only first N entries in each loop\nPRINT_ONLY_N = 10\n\n# get all registered local extensions (enabled and disabled)\nmanager = omni.kit.app.get_app().get_extension_manager()\nfor ext in manager.get_extensions()[:PRINT_ONLY_N]:\n print(ext[\"id\"], ext[\"package_id\"], ext[\"name\"], ext[\"version\"], ext[\"path\"], ext[\"enabled\"])\n\n# get all registered non-local extensions (from the registry)\n# this call blocks to download registry (slow).\n# you need to call it at least once, or use refresh_registry() for non-blocking.\nmanager.sync_registry()\nfor ext in manager.get_registry_extensions()[:PRINT_ONLY_N]:\n print(ext[\"id\"], ext[\"package_id\"], ext[\"name\"], ext[\"version\"], ext[\"path\"], ext[\"enabled\"])\n\n# functions above print all versions of each extension. There is other API to get them grouped by name (like in ext manager UI).\n# \"enabled_version\" and \"latest_version\" contains the same dict as returned by functions above, e.g. with \"id\", \"name\", etc.\nfor summary in manager.fetch_extension_summaries()[:PRINT_ONLY_N]:\n print(summary[\"fullname\"], summary[\"flags\"], summary[\"enabled_version\"][\"id\"], summary[\"latest_version\"][\"id\"])\n\n# get all versions for particular extension\nfor ext in manager.fetch_extension_versions(\"omni.kit.window.script_editor\"):\n print(ext[\"id\"])\n" } ] }, { "title": "Python", "snippets": [ { "title": "Install from PyPI", "description": "Install a Python package from PyPI", "snippet": "import omni.kit.pipapi\n\nomni.kit.pipapi.install(package=\"${1:packaging}\",\n version=\"${2:21.3}\",\n module=\"${1:packaging}\", # sometimes module is different from package name\n ignore_import_check=False, # module is used for import check\n ignore_cache=False,\n use_online_index=True,\n surpress_output=False,\n extra_args=[])\n\n# use the newly installed package\nimport ${1:packaging}\n" }, { "title": "Logger instance", "description": "Create a logger instance", "snippet": "import logging\n\nlogger = logging.getLogger(__name__)\n" }, { "title": "Log info", "description": "Log an info message", "snippet": "logger.info(\"${1:message}\")\n" }, { "title": "Log warning", "description": "Log a warning message", "snippet": "logger.warning(\"${1:message}\")\n" }, { "title": "Log error", "description": "Log an error message", "snippet": "logger.error(\"${1:message}\")\n" } ] }, { "title": "Python scripting component", "snippets": [ { "title": "Behavior script template", "description": "Class for developing per USD Prim behaviors", "snippet": "from omni.kit.scripting import BehaviorScript\n\n\nclass ${1:CustomBehaviorScript}(BehaviorScript):\n def on_init(self):\n print(f\"{__class__.__name__}.on_init()->{self.prim_path}\")\n\n def on_destroy(self):\n print(f\"{__class__.__name__}.on_destroy()->{self.prim_path}\")\n\n def on_play(self):\n print(f\"{__class__.__name__}.on_play()->{self.prim_path}\")\n\n def on_pause(self):\n print(f\"{__class__.__name__}.on_pause()->{self.prim_path}\")\n\n def on_stop(self):\n print(f\"{__class__.__name__}.on_stop()->{self.prim_path}\")\n\n def on_update(self, current_time: float, delta_time: float):\n print(f\"{__class__.__name__}.on_update(current_time={current_time}, delta_time={delta_time})->{self.prim_path}\")\n" }, { "title": "Default application window", "description": "Default application window", "snippet": "self.default_app_window" }, { "title": "Input interface", "description": "Application input interface", "snippet": "self.input" }, { "title": "Kit application interface", "description": "Kit application interface", "snippet": "self.app" }, { "title": "Message bus event stream", "description": "Application message bus event stream", "snippet": "self.message_bus_event_stream" }, { "title": "Prim", "description": "Prim that this script is assigned to", "snippet": "self.prim" }, { "title": "Prim path", "description": "Prim path that this script is assigned to", "snippet": "self.prim_path" }, { "title": "Selection interface", "description": "Current USD context selection interface in the application", "snippet": "self.selection" }, { "title": "Settings", "description": "Current settings", "snippet": "self.settings" }, { "title": "Stage", "description": "Current USD stage that is opened/loaded", "snippet": "self.stage" }, { "title": "Timeline", "description": "Application timeline interface", "snippet": "self.timeline" }, { "title": "USD context", "description": "Current USD context", "snippet": "self.usd_context" } ] }, { "title": "UI", "snippets": [ { "title": "Common import", "description": "Common import statements", "snippet": "import omni.kit\nimport omni.ui as ui\nimport omni.kit.notification_manager as nm\n" }, { "title": "Create window", "description": "Create window", "snippet": "# flags: https://docs.omniverse.nvidia.com/py/kit/source/extensions/omni.ui/docs/index.html?omni.ui.add_to_namespace\n# dock: https://docs.omniverse.nvidia.com/py/kit/source/extensions/omni.ui/docs/index.html?#omni.ui.DockPreference\nwindow_flags = ui.WINDOW_FLAGS_NONE\n\nwindow = ui.Window(\"${1:window_name}\", \n width=640, height=480, \n flags=window_flags,\n dockPreference=ui.DockPreference.DISABLED, \n visible=True)\n" }, { "title": "File export dialog", "description": "Basic file export dialog", "snippet": "def export_handler(filename, dirname, extension=\"\", selections=[]):\n print(f\"Export As '{filename}{extension}' to '{dirname}' with additional selections '{selections}'\")\n\nfile_exporter = omni.kit.window.file_importer.get_file_exporter()\nfile_exporter.show_window(title=\"${1:Title}\",\n export_button_label=\"${2:Save}\",\n export_handler=export_handler, # callback called after the user has selected an export location\n filename_url=\"${3:omniverse://localhost/foo}\")\n" }, { "title": "File import dialog", "description": "Basic file import dialog", "snippet": "def import_handler(filename, dirname, selections=[]):\n print(f\"Import '{filename}' from '{dirname}' or selected files '{selections}'\")\n\nfile_importer = omni.kit.window.file_importer.get_file_importer()\nfile_importer.show_window(title=\"${1:Title}\",\n import_handler=import_handler) # callback called after the user has selected a file\n" }, { "title": "Popup notification", "description": "Create a viewport popup notification without buttons", "snippet": "# notification status: INFO, WARNING\nnm.post_notification(\"${1:Message}\", duration=${2:5}, status=nm.NotificationStatus.${3:INFO})\n" }, { "title": "Popup notification (with buttons)", "description": "Create a viewport popup notification with buttons", "snippet": "def clicked_ok():\n print(\"Clicked ok\")\n\ndef clicked_cancel():\n print(\"Clicked cancel\")\n\nok_button = nm.NotificationButtonInfo(\"OK\", on_complete=clicked_ok)\ncancel_button = nm.NotificationButtonInfo(\"CANCEL\", on_complete=clicked_cancel)\n\nnotification_info = nm.post_notification(\"${1:Message}\",\n duration=0,\n hide_after_timeout=False,\n status=nm.NotificationStatus.${2:INFO}, # notification status: INFO, WARNING\n button_infos=[ok_button, cancel_button])\n" } ] }, { "title": "Viewport", "snippets": [ { "title": "Common import", "description": "Common import statements", "snippet": "import omni.usd\nfrom omni.kit.viewport.utility import get_active_viewport, get_active_viewport_window, frame_viewport_selection\n" }, { "title": "Change active camera", "description": "Change the Viewport's active camera", "snippet": "viewport = get_active_viewport()\nif not viewport:\n raise RuntimeError(\"No active viewport\")\n\n# set the viewport's active camera\nviewport.camera_path = \"${1:/World/Camera}\"\n" }, { "title": "Get active viewport window", "description": "Get the active viewport window", "snippet": "# set window_name to None to get the default viewport window\nviewport_window = get_active_viewport_window(window_name=\"${1:window_name}\")\n" }, { "title": "Frame a prim", "description": "Frame a prim. Use the FramePrimsCommand for more advanced options", "snippet": "ctx = omni.usd.get_context()\nctx.get_selection().set_selected_prim_paths([\"${1:/World/Prim}\"], True) # second arg is unused\nframe_viewport_selection(active_viewport)\n" } ] } ] }
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/snippets/python-isaac-sim.json
{ "snippets": [ { "title": "Simulation Application", "snippets": [ { "title": "Argument parser", "description": "Parse command line strings into Python objects", "snippet": "import argparse\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--headless\", default=False, action=\"store_true\", help=\"Run stage headless\")\nparser.add_argument(\"--test\", default=False, action=\"store_true\", help=\"Run in test mode\")\n\nargs, unknown = parser.parse_known_args() # get argument using `args`: e.g. args.headless\n" }, { "title": "SimulationApp template", "description": "Helper class to launch Omniverse Toolkit", "snippet": "from omni.isaac.kit import SimulationApp\n\n\nconfig = {\"headless\": False,\n \"renderer\": \"RayTracedLighting\"}\n\n# Any Omniverse level imports must occur after the class is instantiated. \n# APIs are provided by the extension/runtime plugin system, \n# it must be loaded before they will be available to import.\nsimulation_app = SimulationApp(config)\n\nfor i in range(100):\n simulation_app.update()\n\nsimulation_app.close() # cleanup application\n" }, { "title": "SimulationApp", "snippets": [ { "title": "SimulationApp", "description": "Helper class to launch Omniverse Toolkit.\n\nOmniverse loads various plugins at runtime which cannot be imported unless\nthe Toolkit is already running. Thus, it is necessary to launch the Toolkit first from\nyour python application and then import everything else.\n\nUsage:\n\n.. code-block:: python\n\n # At top of your application\n from omni.isaac.kit import SimulationApp\n config = {\n width: \"1280\",\n height: \"720\",\n headless: False,\n }\n simulation_app = SimulationApp(config)\n\n # Rest of the code follows\n ...\n simulation_app.close()\n\nNote:\n The settings in :obj:`DEFAULT_LAUNCHER_CONFIG` are overwritten by those in :obj:`config`.\n\nArguments:\n config (dict): A dictionary containing the configuration for the app. (default: None)\n experience (str): Path to the application config loaded by the launcher (default: \"\", will load app/omni.isaac.sim.python.kit if left blank)", "snippet": "simulation_app = SimulationApp(launch_config=None, # dict\n experience=\"\") # str\n" }, { "title": "close", "description": "Close the running Omniverse Toolkit.", "snippet": "simulation_app.close()\n" }, { "title": "is_exiting", "description": " bool: True if close() was called previously, False otherwise\n ", "snippet": "simulation_app.is_exiting()\n" }, { "title": "is_running", "description": " bool: convenience function to see if app is running. True if running, False otherwise\n ", "snippet": "simulation_app.is_running()\n" }, { "title": "reset_render_settings", "description": "Reset render settings to those in config.\n\n Note:\n This should be used in case a new stage is opened and the desired config needs\n to be re-applied.\n ", "snippet": "simulation_app.reset_render_settings()\n" }, { "title": "set_setting", "description": " Set a carbonite setting\n\n Args:\n setting (str): carb setting path\n value: value to set the setting to, type is used to properly set the setting.\n ", "snippet": "simulation_app.set_setting(setting=setting, # str\n value=value)\n" }, { "title": "update", "description": " Convenience function to step the application forward one frame\n ", "snippet": "simulation_app.update()\n" } ] } ] }, { "title": "Core", "snippets": [ { "title": "Common imports", "description": "Common import statements (delete unnecessary)", "snippet": "from omni.isaac.core.articulations import Articulation, ArticulationGripper, ArticulationSubset, ArticulationView\nfrom omni.isaac.core.controllers import ArticulationController, BaseController, BaseGripperController\nfrom omni.isaac.core.loggers import DataLogger\nfrom omni.isaac.core.materials import OmniGlass, OmniPBR, ParticleMaterial, ParticleMaterialView, PhysicsMaterial, PreviewSurface, VisualMaterial\nfrom omni.isaac.core.objects import DynamicCapsule, DynamicCone, DynamicCuboid, DynamicCylinder, DynamicSphere\nfrom omni.isaac.core.objects import FixedCapsule, FixedCone, FixedCuboid, FixedCylinder, FixedSphere, GroundPlane\nfrom omni.isaac.core.objects import VisualCapsule, VisualCone, VisualCuboid, VisualCylinder, VisualSphere\nfrom omni.isaac.core.physics_context import PhysicsContext\nfrom omni.isaac.core.prims import BaseSensor, ClothPrim, GeometryPrim, ParticleSystem, RigidPrim, XFormPrim\nfrom omni.isaac.core.prims import ClothPrimView, GeometryPrimView, ParticleSystemView, RigidContactView, RigidPrimView, XFormPrimView\nfrom omni.isaac.core.robots import Robot, RobotView\nfrom omni.isaac.core.scenes import Scene, SceneRegistry\nfrom omni.isaac.core.simulation_context import SimulationContext\nfrom omni.isaac.core.world import World\nfrom omni.isaac.core.tasks import BaseTask, FollowTarget, PickPlace, Stacking\n" }, { "title": "Articulations", "snippets": [ { "title": "Articulation", "snippets": [ { "title": "Articulation", "description": " Provides high level functions to deal with an articulation prim and its attributes/ properties.\n \n Args:\n prim_path (str): prim path of the Prim to encapsulate or create.\n name (str, optional): shortname to be used as a key by Scene class. \n Note: needs to be unique if the object is added to the Scene. \n Defaults to \"articulation\".\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world/ local frame of the prim\n (depends if translation or position is specified).\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n scale (Optional[Sequence[float]], optional): local scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n visible (bool, optional): set to false for an invisible prim in the stage while rendering. Defaults to True.\n articulation_controller (Optional[ArticulationController], optional): a custom ArticulationController which\n inherits from it. Defaults to creating the\n basic ArticulationController.\n enable_dof_force_sensors (bool, optional): enables the solver computed dof force sensors on articulation joints.\n Defaults to False.\n Raises:\n Exception: [description]\n", "snippet": "articulation = Articulation(prim_path=prim_path, # str\n name=\"articulation\", # str\n position=None, # typing.Union[typing.Sequence[float], NoneType]\n translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None, # typing.Union[typing.Sequence[float], NoneType]\n scale=None, # typing.Union[typing.Sequence[float], NoneType]\n visible=None, # typing.Union[bool, NoneType]\n articulation_controller=None, # typing.Union[omni.isaac.core.controllers.articulation_controller.ArticulationController, NoneType]\n enable_dof_force_sensors=False) # bool\n" }, { "title": "apply_action", "description": "[summary]\n\n Args:\n control_actions (ArticulationAction): actions to be applied for next physics step.\n indices (Optional[Union[list, np.ndarray]], optional): degree of freedom indices to apply actions to. \n Defaults to all degrees of freedom.\n\n Raises:\n Exception: [description]\n ", "snippet": "articulation.apply_action(control_actions=control_actions) # omni.isaac.core.utils.types.ArticulationAction\n" }, { "title": "disable_gravity", "description": "Keep gravity from affecting the robot\n ", "snippet": "articulation.disable_gravity()\n" }, { "title": "enable_gravity", "description": "Gravity will affect the robot\n ", "snippet": "articulation.enable_gravity()\n" }, { "title": "get_angular_velocity", "description": "[summary]\n\n Returns:\n np.ndarray: [description]\n ", "snippet": "angular_velocity = articulation.get_angular_velocity()\n" }, { "title": "get_applied_action", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n ArticulationAction: [description]\n ", "snippet": "applied_action = articulation.get_applied_action()\n" }, { "title": "get_applied_joint_efforts", "description": "Gets the efforts applied to the joints\n\n Args:\n joint_indices (Optional[Union[List, np.ndarray]], optional): _description_. Defaults to None.\n\n Raises:\n Exception: _description_\n\n Returns:\n np.ndarray: _description_\n ", "snippet": "applied_joint_efforts = articulation.get_applied_joint_efforts(joint_indices=None) # typing.Union[typing.List, numpy.ndarray, NoneType]\n" }, { "title": "get_articulation_body_count", "description": "[summary]\n\n Returns:\n int: [description]\n ", "snippet": "articulation_body_count = articulation.get_articulation_body_count()\n" }, { "title": "get_articulation_controller", "description": " Returns:\n ArticulationController: PD Controller of all degrees of freedom of an articulation, can apply position targets, velocity targets and efforts.\n ", "snippet": "articulation_controller = articulation.get_articulation_controller()\n" }, { "title": "get_dof_index", "description": "[summary]\n\n Args:\n dof_name (str): [description]\n\n Returns:\n int: [description]\n ", "snippet": "dof_index = articulation.get_dof_index(dof_name=dof_name) # str\n" }, { "title": "get_enabled_self_collisions", "description": "[summary]\n\n Returns:\n bool: [description]\n ", "snippet": "enabled_self_collisions = articulation.get_enabled_self_collisions()\n" }, { "title": "get_joint_efforts", "description": " Deprecated function. Please use get_applied_joint_efforts instead.\n\n Args:\n joint_indices (Optional[Union[List, np.ndarray]], optional): _description_. Defaults to None.\n\n Raises:\n Exception: _description_\n\n Returns:\n np.ndarray: _description_\n ", "snippet": "joint_efforts = articulation.get_joint_efforts(joint_indices=None) # typing.Union[typing.List, numpy.ndarray, NoneType]\n" }, { "title": "get_joint_positions", "description": "_summary_\n\n Args:\n joint_indices (Optional[Union[List, np.ndarray]], optional): _description_. Defaults to None.\n\n Returns:\n np.ndarray: _description_\n ", "snippet": "joint_positions = articulation.get_joint_positions(joint_indices=None) # typing.Union[typing.List, numpy.ndarray, NoneType]\n" }, { "title": "get_joint_velocities", "description": "_summary_\n\n Args:\n joint_indices (Optional[Union[List, np.ndarray]], optional): _description_. Defaults to None.\n\n Returns:\n np.ndarray: _description_\n ", "snippet": "joint_velocities = articulation.get_joint_velocities(joint_indices=None) # typing.Union[typing.List, numpy.ndarray, NoneType]\n" }, { "title": "get_joints_default_state", "description": " Accessor for the default joints state.\n\n Returns:\n JointsState: The defaults that the robot is reset to when post_reset() is called (often\n automatically called during world.reset()).\n ", "snippet": "joints_default_state = articulation.get_joints_default_state()\n" }, { "title": "get_joints_state", "description": "[summary]\n\n Returns:\n JointsState: [description]\n ", "snippet": "joints_state = articulation.get_joints_state()\n" }, { "title": "get_linear_velocity", "description": "[summary]\n\n Returns:\n np.ndarray: [description]\n ", "snippet": "linear_velocity = articulation.get_linear_velocity()\n" }, { "title": "get_sleep_threshold", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "sleep_threshold = articulation.get_sleep_threshold()\n" }, { "title": "get_solver_position_iteration_count", "description": "[summary]\n\n Returns:\n int: [description]\n ", "snippet": "solver_position_iteration_count = articulation.get_solver_position_iteration_count()\n" }, { "title": "get_solver_velocity_iteration_count", "description": "[summary]\n\n Returns:\n int: [description]\n ", "snippet": "solver_velocity_iteration_count = articulation.get_solver_velocity_iteration_count()\n" }, { "title": "get_stabilization_threshold", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "stabilization_threshold = articulation.get_stabilization_threshold()\n" }, { "title": "initialize", "description": "Create a physics simulation view if not passed and creates an articulation view using physX tensor api.\n This needs to be called after each hard reset (i.e stop + play on the timeline) before interacting with any\n of the functions of this class.\n\n Args:\n physics_sim_view (omni.physics.tensors.SimulationView, optional): current physics simulation view. Defaults to None.\n ", "snippet": "articulation.initialize(physics_sim_view=None) # omni.physics.tensors.bindings._physicsTensors.SimulationView\n" }, { "title": "set_angular_velocity", "description": "[summary]\n\n Args:\n velocity (np.ndarray): [description]\n ", "snippet": "articulation.set_angular_velocity(velocity=velocity) # numpy.ndarray\n" }, { "title": "set_enabled_self_collisions", "description": "[summary]\n\n Args:\n flag (bool): [description]\n ", "snippet": "articulation.set_enabled_self_collisions(flag=flag) # bool\n" }, { "title": "set_joint_efforts", "description": "[summary]\n\n Args:\n efforts (np.ndarray): [description]\n joint_indices (Optional[Union[list, np.ndarray]], optional): [description]. Defaults to None.\n\n Raises:\n Exception: [description]\n ", "snippet": "articulation.set_joint_efforts(efforts=efforts, # numpy.ndarray\n joint_indices=None) # typing.Union[typing.List, numpy.ndarray, NoneType]\n" }, { "title": "set_joint_positions", "description": "[summary]\n\n Args:\n positions (np.ndarray): [description]\n indices (Optional[Union[list, np.ndarray]], optional): [description]. Defaults to None.\n\n Raises:\n Exception: [description]\n ", "snippet": "articulation.set_joint_positions(positions=positions, # numpy.ndarray\n joint_indices=None) # typing.Union[typing.List, numpy.ndarray, NoneType]\n" }, { "title": "set_joint_velocities", "description": "[summary]\n\n Args:\n velocities (np.ndarray): [description]\n indices (Optional[Union[list, np.ndarray]], optional): [description]. Defaults to None.\n\n Raises:\n Exception: [description]\n ", "snippet": "articulation.set_joint_velocities(velocities=velocities, # numpy.ndarray\n joint_indices=None) # typing.Union[typing.List, numpy.ndarray, NoneType]\n" }, { "title": "set_joints_default_state", "description": "[summary]\n\n Args:\n positions (Optional[np.ndarray], optional): [description]. Defaults to None.\n velocities (Optional[np.ndarray], optional): [description]. Defaults to None.\n efforts (Optional[np.ndarray], optional): [description]. Defaults to None.\n ", "snippet": "articulation.set_joints_default_state(positions=None, # typing.Union[numpy.ndarray, NoneType]\n velocities=None, # typing.Union[numpy.ndarray, NoneType]\n efforts=None) # typing.Union[numpy.ndarray, NoneType]\n" }, { "title": "set_linear_velocity", "description": "Sets the linear velocity of the prim in stage.\n\n Args:\n velocity (np.ndarray):linear velocity to set the rigid prim to. Shape (3,).\n ", "snippet": "articulation.set_linear_velocity(velocity=velocity) # numpy.ndarray\n" }, { "title": "set_sleep_threshold", "description": "[summary]\n\n Args:\n threshold (float): [description]\n ", "snippet": "articulation.set_sleep_threshold(threshold=threshold) # float\n" }, { "title": "set_solver_position_iteration_count", "description": "[summary]\n\n Args:\n count (int): [description]\n ", "snippet": "articulation.set_solver_position_iteration_count(count=count) # int\n" }, { "title": "set_solver_velocity_iteration_count", "description": "[summary]\n\n Args:\n count (int): [description]\n ", "snippet": "articulation.set_solver_velocity_iteration_count(count=count) # int\n" }, { "title": "set_stabilization_threshold", "description": "[summary]\n\n Args:\n threshold (float): [description]\n ", "snippet": "articulation.set_stabilization_threshold(threshold=threshold) # float\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "articulation.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = articulation.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = articulation.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = articulation.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = articulation.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = articulation.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = articulation.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = articulation.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "articulation.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "articulation.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "articulation.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "articulation.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "articulation.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "articulation.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "articulation.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "articulation.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "articulation.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "ArticulationGripper", "snippets": [ { "title": "ArticulationGripper", "description": "[summary]\n\n Args:\n gripper_dof_names (list): [description]\n gripper_open_position (Optional[np.ndarray], optional): [description]. Defaults to None.\n gripper_closed_position (Optional[np.ndarray], optional): [description]. Defaults to None.\n ", "snippet": "articulation_gripper = ArticulationGripper(gripper_dof_names=gripper_dof_names, # list\n gripper_open_position=None, # typing.Union[numpy.ndarray, NoneType]\n gripper_closed_position=None) # typing.Union[numpy.ndarray, NoneType]\n" }, { "title": "apply_action", "description": "[summary]\n\n Args:\n action (ArticulationAction): [description]\n ", "snippet": "articulation_gripper.apply_action(action=action) # omni.isaac.core.utils.types.ArticulationAction\n" }, { "title": "get_positions", "description": "[summary]\n\n Returns:\n np.ndarray: [description]\n ", "snippet": "positions = articulation_gripper.get_positions()\n" }, { "title": "get_velocities", "description": "[summary]\n\n Returns:\n np.ndarray: [description]\n ", "snippet": "velocities = articulation_gripper.get_velocities()\n" }, { "title": "initialize", "description": "[summary]\n\n Args:\n root_prim_path (str): [description]\n articulation_controller (ArticulationController): [description]\n\n Raises:\n Exception: [description]\n ", "snippet": "articulation_gripper.initialize(root_prim_path=root_prim_path, # str\n articulation_controller=articulation_controller) # omni.isaac.core.controllers.articulation_controller.ArticulationController\n" }, { "title": "set_positions", "description": "[summary]\n\n Args:\n positions (np.ndarray): [description]\n ", "snippet": "articulation_gripper.set_positions(positions=positions) # numpy.ndarray\n" }, { "title": "set_velocities", "description": "[summary]\n\n Args:\n velocities (np.ndarray): [description]\n ", "snippet": "articulation_gripper.set_velocities(velocities=velocities) # numpy.ndarray\n" } ] }, { "title": "ArticulationSubset", "snippets": [ { "title": "ArticulationSubset", "description": " A utility class for viewing a subset of the joints in a robot Articulation object.\n\nThis class can be helpful in two ways:\n\n1) The order of joints returned by a robot Articulation may not match the order of joints\n expected by a function\n \n2) A function may only care about a subset of the joint states that are returned by a robot\n Articulation.\n\nExample:\n\n Suppose the robot Articulation returns positions [0,1,2] for joints [\"A\",\"B\",\"C\"], and\n suppose that we pass joint_names = [\"B\",\"A\"].\n\n ArticulationSubset.get_joint_positions() -> [1,0]\n ArticulationSubset.map_to_articulation_order([1,0]) -> [0,1,None]\n\nArgs:\n articulation (Articulation):\n An initialized Articulation object representing the simulated robot\n joint_names (List[str]):\n A list of joint names whose order determines the order of the joints returned by\n functions like get_joint_positions()", "snippet": "articulation_subset = ArticulationSubset(articulation=articulation, # omni.isaac.core.articulations.articulation.Articulation\n joint_names=joint_names) # typing.List[str]\n" }, { "title": "apply_action", "description": " Apply the specified control actions to this views joints.\n\n Args:\n joint_positions: Target joint positions for this subset's joints.\n joint_velocities: Target joint velocities for this subset's joints.\n ", "snippet": "articulation_subset.apply_action(joint_positions=None, # typing.Union[<built-in function array>, NoneType]\n joint_velocities=None) # typing.Union[<built-in function array>, NoneType]\n" }, { "title": "get_applied_action", "description": " Retrieves the latest applied action for this subset.\n\n Returns: The ArticulationAction for this subset. Each commanded entry is either None or\n contains one value for each of the subset's joints. The joint_indices is set to this\n subset's joint indices.\n ", "snippet": "applied_action = articulation_subset.get_applied_action()\n" }, { "title": "get_joint_efforts", "description": "Get joint efforts for the joint names that were passed into this articulation view on\n initialization. The indices of the joint efforts returned correspond to the indices of the\n joint names.\n\n Returns:\n np.array: joint efforts \n ", "snippet": "joint_efforts = articulation_subset.get_joint_efforts()\n" }, { "title": "get_joint_positions", "description": "Get joint positions for the joint names that were passed into this articulation view on\n initialization. The indices of the joint positions returned correspond to the indices of\n the joint names.\n\n Returns:\n np.array: joint positions \n ", "snippet": "joint_positions = articulation_subset.get_joint_positions()\n" }, { "title": "get_joint_subset_indices", "description": "Accessor for the joint indices for this subset. These are the indices into the full\n articulation degrees of freedom corresponding to this subset of joints.\n\n Returns:\n np.array: An array of joint indices defining the subset.\n ", "snippet": "joint_subset_indices = articulation_subset.get_joint_subset_indices()\n" }, { "title": "get_joint_velocities", "description": "Get joint velocities for the joint names that were passed into this articulation view on\n initialization. The indices of the joint velocities returned correspond to the indices of\n the joint names.\n\n Returns:\n np.array: joint velocities \n ", "snippet": "joint_velocities = articulation_subset.get_joint_velocities()\n" }, { "title": "get_joints_state", "description": "", "snippet": "joints_state = articulation_subset.get_joints_state()\n" }, { "title": "make_articulation_action", "description": " Make an articulation action for only this subset's joints using the given target\n position and velocity values.\n\n Args:\n joint_positions: Target joint positions for this subset's joints.\n joint_velocities: Target joint velocities for this subset's joints.\n\n Returns: An ArticulationAction object specifying the action for this subset's joints.\n ", "snippet": "articulation_subset.make_articulation_action(joint_positions=joint_positions, # numpy.array\n joint_velocities=joint_velocities) # numpy.array\n" }, { "title": "map_to_articulation_order", "description": "Map a set of joint values to a format consumable by the robot Articulation. \n\n Args:\n joint_values (np.array): a set of joint values corresponding to the joint_names used to initialize this class. \n joint_values may be either one or two dimensional.\n\n If one dimensional with shape (k,): A vector will be returned with length (self.articulation.num_dof) that may\n be consumed by the robot Articulation in an ArticulationAction.\n\n If two dimensional with shape (N, k): A matrix will be returned with shape (N, self.articulation.num_dof) that may be\n converted to N ArticulationActions\n\n Returns:\n np.array: a set of joint values that is padded with None to match the shape and order expected by the robot Articulation. \n ", "snippet": "articulation_subset.map_to_articulation_order(joint_values=joint_values) # numpy.array\n" }, { "title": "set_joint_efforts", "description": " Set the joint efforts for this view.\n\n Args:\n efforts: The effort values, one for each view joint in the order specified on\n construction.\n ", "snippet": "articulation_subset.set_joint_efforts(efforts=efforts) # numpy.array\n" }, { "title": "set_joint_positions", "description": " Set the joint positions for this view.\n\n Args:\n positions: The position values, one for each view joint in the order specified on\n construction.\n ", "snippet": "articulation_subset.set_joint_positions(positions=positions) # numpy.array\n" }, { "title": "set_joint_velocities", "description": " Set the joint velocities for this view.\n\n Args:\n velocities: The velocity values, one for each view joint in the order specified on\n construction.\n ", "snippet": "articulation_subset.set_joint_velocities(velocities=velocities) # numpy.array\n" } ] }, { "title": "ArticulationView", "snippets": [ { "title": "ArticulationView", "description": " Provides high level functions to deal with prims that has root articulation api applied to it (1 or more articulations) \n as well as its attributes/ properties.\n This object wraps all matching articulations found at the regex provided at the prim_paths_expr.\n\n Note: - each prim will have \"xformOp:orient\", \"xformOp:translate\" and \"xformOp:scale\" only post init,\n unless it is a non-root articulation link.\n\n Args:\n prim_paths_expr (str): prim paths regex to encapsulate all prims that match it.\n example: \"/World/Env[1-5]/Franka\" will match /World/Env1/Franka, \n /World/Env2/Franka..etc.\n (a non regex prim path can also be used to encapsulate one rigid prim).\n name (str, optional): shortname to be used as a key by Scene class. \n Note: needs to be unique if the object is added to the Scene. \n Defaults to \"articulation_prim_view\".\n positions (Optional[Union[np.ndarray, torch.Tensor]], optional): default positions in the world frame of the prims. \n shape is (N, 3). Defaults to None, which means left unchanged.\n translations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n default translations in the local frame of the prims\n (with respect to its parent prims). shape is (N, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n default quaternion orientations in the world/ local frame of the prims\n (depends if translation or position is specified).\n quaternion is scalar-first (w, x, y, z). shape is (N, 4).\n scales (Optional[Union[np.ndarray, torch.Tensor]], optional): local scales to be applied to \n the prim's dimensions in the view. shape is (N, 3).\n Defaults to None, which means left unchanged.\n visibilities (Optional[Union[np.ndarray, torch.Tensor]], optional): set to false for an invisible prim in \n the stage while rendering. shape is (N,). \n Defaults to None.\n reset_xform_properties (bool, optional): True if the prims don't have the right set of xform properties \n (i.e: translate, orient and scale) ONLY and in that order.\n Set this parameter to False if the object were cloned using using \n the cloner api in omni.isaac.cloner. Defaults to True.\n enable_dof_force_sensors (bool, optional): enables the solver computed dof force sensors on articulation joints. \n Defaults to False. \n ", "snippet": "articulation_view = ArticulationView(prim_paths_expr=prim_paths_expr, # str\n name=\"articulation_prim_view\", # str\n positions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n translations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n scales=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n visibilities=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n reset_xform_properties=True, # bool\n enable_dof_force_sensors=False) # bool\n" }, { "title": "apply_action", "description": " Applies ArticulationActions which encapsulates joint position targets, velocity targets, efforts and joint indices in one object.\n Can be used instead of the seperate set_joint_position_targets..etc.\n\n Args:\n control_actions (ArticulationActions): actions to be applied for next physics step.\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "articulation_view.apply_action(control_actions=control_actions, # omni.isaac.core.utils.types.ArticulationActions\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "get_angular_velocities", "description": "Gets the angular velocities of prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: angular velocities of the prims in the view. shape is (M, 3).\n ", "snippet": "angular_velocities = articulation_view.get_angular_velocities(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_applied_actions", "description": "Gets current applied actions in an ArticulationActions object.\n\n Args:\n clone (bool, optional): True to return clones of the internal buffers. Otherwise False. Defaults to True.\n\n Returns:\n ArticulationActions: current applied actions (i.e: current position targets and velocity targets)\n ", "snippet": "applied_actions = articulation_view.get_applied_actions(clone=True) # bool\n" }, { "title": "get_applied_joint_efforts", "description": "Gets the joint efforts of articulations in the view. The method will return the efforts set by the set_joint_efforts.\n \n Args:\n efforts (Optional[Union[np.ndarray, torch.Tensor]]): efforts of articulations in the view to be set to in the next frame. \n shape is (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: joint efforts of articulations in the view assigned via set_joint_efforts. shape is (M, K).\n ", "snippet": "applied_joint_efforts = articulation_view.get_applied_joint_efforts(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_armatures", "description": "Gets armatures for articulation in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to query. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n clone (Optional[bool]): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: maximum efforts for articulations in the view. shape (M, K).\n ", "snippet": "armatures = articulation_view.get_armatures(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_articulation_body_count", "description": " Returns:\n int: number of links in the articulation.\n ", "snippet": "articulation_body_count = articulation_view.get_articulation_body_count()\n" }, { "title": "get_body_coms", "description": "Gets rigid body center of mass of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n body_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): body indicies to specify which bodies \n to query. Shape (K,).\n Where K <= num of bodies.\n Defaults to None (i.e: all bodies).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: rigid body center of mass positions and orientations of articulations in the view. \n position shape is (M, K, 3), orientation shape is (M, k, 4).\n ", "snippet": "body_coms = articulation_view.get_body_coms(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n body_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_body_index", "description": "Gets the body index in the articulation given its name.\n\n Args:\n body_name (str): name of the body/link to query.\n\n Returns:\n int: index of the body/link in the articulation buffers.\n ", "snippet": "body_index = articulation_view.get_body_index(body_name=body_name) # str\n" }, { "title": "get_body_inertias", "description": "Gets rigid body inertias of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n body_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): body indicies to specify which bodies \n to query. Shape (K,).\n Where K <= num of bodies.\n Defaults to None (i.e: all bodies).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: rigid body inertias of articulations in the view. \n shape is (M, K, 9).\n ", "snippet": "body_inertias = articulation_view.get_body_inertias(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n body_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_body_inv_inertias", "description": "Gets rigid body inverse inertias of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n body_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): body indicies to specify which bodies \n to query. Shape (K,).\n Where K <= num of bodies.\n Defaults to None (i.e: all bodies).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: rigid body inverse inertias of articulations in the view. \n shape is (M, K, 9).\n ", "snippet": "body_inv_inertias = articulation_view.get_body_inv_inertias(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n body_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_body_inv_masses", "description": "Gets rigid body inverse masses of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n body_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): body indicies to specify which bodies \n to query. Shape (K,).\n Where K <= num of bodies.\n Defaults to None (i.e: all bodies).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: rigid body inverse masses of articulations in the view. \n shape is (M, K).\n ", "snippet": "body_inv_masses = articulation_view.get_body_inv_masses(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n body_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_body_masses", "description": "Gets rigid body masses of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n body_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): body indicies to specify which bodies \n to query. Shape (K,).\n Where K <= num of bodies.\n Defaults to None (i.e: all bodies).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: rigid body masses of articulations in the view. \n shape is (M, K).\n ", "snippet": "body_masses = articulation_view.get_body_masses(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n body_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_coriolis_and_centrifugal_forces", "description": "Gets the coriolis and centrifugal forces of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to query. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Coriolis and centrifugal forces of articulations in the view. \n shape is (M, K).\n ", "snippet": "coriolis_and_centrifugal_forces = articulation_view.get_coriolis_and_centrifugal_forces(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_dof_index", "description": "Gets the dof index in the joint buffers given its name.\n\n Args:\n dof_name (str): name of the joint that corresponds to the degree of freedom to query.\n\n Returns:\n int: index of the degree of freedom in the joint buffers.\n ", "snippet": "dof_index = articulation_view.get_dof_index(dof_name=dof_name) # str\n" }, { "title": "get_dof_limits", "description": " Returns:\n Union[np.ndarray, torch.Tensor]: degrees of freedom position limits. \n shape is (N, num_dof, 2) where index 0 corresponds to the lower limit and index 1 corresponds to the upper limit. \n ", "snippet": "dof_limits = articulation_view.get_dof_limits()\n" }, { "title": "get_dof_types", "description": "Gets the dof types given the dof names.\n\n Args:\n dof_names (List[str], optional): names of the joints that corresponds to the degrees of freedom to query. Defaults to None.\n\n Returns:\n List[str]: types of the joints that corresponds to the degrees of freedom. Types can be invalid, translation or rotation.\n ", "snippet": "dof_types = articulation_view.get_dof_types(dof_names=None) # typing.List[str]\n" }, { "title": "get_effort_modes", "description": " Gets effort modes for articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to query. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n\n Returns:\n List: Returns a List of size (M, K) indicating the effort modes. accelaration or force.\n ", "snippet": "effort_modes = articulation_view.get_effort_modes(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "get_enabled_self_collisions", "description": " Gets the enable self collisions flag\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: true if self collisions enabled. otherwise false. shape (M,)\n ", "snippet": "enabled_self_collisions = articulation_view.get_enabled_self_collisions(indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "get_fixed_tendon_dampings", "description": "Gets the dampings of fixed tendons for articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: fixed tendon dampings of articulations in the view. \n shape is (M, K).\n ", "snippet": "fixed_tendon_dampings = articulation_view.get_fixed_tendon_dampings(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_fixed_tendon_limit_stiffnesses", "description": "Gets the limit stiffness of fixed tendons for articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: fixed tendon stiffnesses of articulations in the view. \n shape is (M, K).\n ", "snippet": "fixed_tendon_limit_stiffnesses = articulation_view.get_fixed_tendon_limit_stiffnesses(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_fixed_tendon_limits", "description": "Gets the limits of fixed tendons for articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: fixed tendon stiffnesses of articulations in the view. \n shape is (M, K, 2).\n ", "snippet": "fixed_tendon_limits = articulation_view.get_fixed_tendon_limits(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_fixed_tendon_offsets", "description": "Gets the offsets of fixed tendons for articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: fixed tendon stiffnesses of articulations in the view. \n shape is (M, K).\n ", "snippet": "fixed_tendon_offsets = articulation_view.get_fixed_tendon_offsets(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_fixed_tendon_rest_lengths", "description": "Gets the rest length of fixed tendons for articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: fixed tendon stiffnesses of articulations in the view. \n shape is (M, K).\n ", "snippet": "fixed_tendon_rest_lengths = articulation_view.get_fixed_tendon_rest_lengths(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_fixed_tendon_stiffnesses", "description": "Gets the stiffness of fixed tendons for articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: fixed tendon stiffnesses of articulations in the view. \n shape is (M, K).\n ", "snippet": "fixed_tendon_stiffnesses = articulation_view.get_fixed_tendon_stiffnesses(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_friction_coefficients", "description": "Gets friction coefficients for articulation in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to query. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n clone (Optional[bool]): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: maximum efforts for articulations in the view. shape (M, K).\n ", "snippet": "friction_coefficients = articulation_view.get_friction_coefficients(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_gains", "description": " Gets stiffness and damping of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to query. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n clone (bool, optional): True to return clones of the internal buffers. Otherwise False. Defaults to True.\n\n Returns:\n Tuple[Union[np.ndarray, torch.Tensor], Union[np.ndarray, torch.Tensor]]: stiffness and damping of\n articulations in the view respectively. shapes are (M, K).\n ", "snippet": "gains = articulation_view.get_gains(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_generalized_gravity_forces", "description": "Gets the generalized gravity forces of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to query. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: generalized gravity forces of articulations in the view. \n shape is (M, K).\n ", "snippet": "generalized_gravity_forces = articulation_view.get_generalized_gravity_forces(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_jacobian_shape", "description": " Returns:\n Union[np.ndarray, torch.Tensor]: shape of jacobian for a single articulation. \n ", "snippet": "jacobian_shape = articulation_view.get_jacobian_shape()\n" }, { "title": "get_jacobians", "description": "Gets the jacobians of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: jacobians of articulations in the view. \n shape is (M, jacobian_shape).\n ", "snippet": "jacobians = articulation_view.get_jacobians(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_joint_positions", "description": "Gets the joint positions of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to query. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: joint positions of articulations in the view. \n shape is (M, K).\n ", "snippet": "joint_positions = articulation_view.get_joint_positions(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_joint_velocities", "description": "Gets the joint velocities of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to query. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: joint velocities of articulations in the view. \n shape is (M, K).\n ", "snippet": "joint_velocities = articulation_view.get_joint_velocities(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_joints_default_state", "description": " Returns:\n JointsState: current joints default state. (i.e: the joint positions and velocities after a reset).\n ", "snippet": "joints_default_state = articulation_view.get_joints_default_state()\n" }, { "title": "get_joints_state", "description": " Returns:\n JointsState: current joint positions and velocities.\n ", "snippet": "joints_state = articulation_view.get_joints_state()\n" }, { "title": "get_linear_velocities", "description": "Gets the linear velocities of prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: linear velocities of the prims in the view. shape is (M, 3).\n ", "snippet": "linear_velocities = articulation_view.get_linear_velocities(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True)\n" }, { "title": "get_local_poses", "description": "Gets prim poses in the view with respect to the local frame (the prim's parent frame).\n \n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: \n first index is positions in the local frame of the prims. shape is (M, 3). \n second index is quaternion orientations in the local frame of the prims.\n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n ", "snippet": "local_poses = articulation_view.get_local_poses(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_mass_matrices", "description": "Gets the mass matrices of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: mass matrices of articulations in the view. \n shape is (M, mass_matrix_shape).\n ", "snippet": "mass_matrices = articulation_view.get_mass_matrices(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_mass_matrix_shape", "description": " Returns:\n Union[np.ndarray, torch.Tensor]: shape of mass matrix for a single articulation. \n ", "snippet": "mass_matrix_shape = articulation_view.get_mass_matrix_shape()\n" }, { "title": "get_max_efforts", "description": "Gets maximum efforts for articulation in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to query. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n clone (Optional[bool]): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: maximum efforts for articulations in the view. shape (M, K).\n ", "snippet": "max_efforts = articulation_view.get_max_efforts(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_sleep_thresholds", "description": "Gets sleep thresholds for articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: current sleep thresholds. shape (M,).\n ", "snippet": "sleep_thresholds = articulation_view.get_sleep_thresholds(indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "get_solver_position_iteration_counts", "description": "Gets the physics solver itertion counts for joint positions.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: number of iterations for the solver. Shape (M,).\n ", "snippet": "solver_position_iteration_counts = articulation_view.get_solver_position_iteration_counts(indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "get_solver_velocity_iteration_counts", "description": " Gets the physics solver itertion counts for joint velocities.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: number of iterations for the solver. Shape (M,).\n ", "snippet": "solver_velocity_iteration_counts = articulation_view.get_solver_velocity_iteration_counts(indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "get_stabilization_thresholds", "description": "Gets the stabilizaion thresholds.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: current stabilization thresholds. Shape (M,).\n ", "snippet": "stabilization_thresholds = articulation_view.get_stabilization_thresholds(indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "get_velocities", "description": "Gets the linear and angular velocities of prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: linear and angular velocities of the prims in the view concatenated. shape is (M, 6).\n ", "snippet": "velocities = articulation_view.get_velocities(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_world_poses", "description": "Gets the poses of the prims in the view with respect to the world's frame.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: \n first index is positions in the world frame of the prims. shape is (M, 3). \n second index is quaternion orientations in the world frame of the prims.\n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n ", "snippet": "world_poses = articulation_view.get_world_poses(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "initialize", "description": "Create a physics simulation view if not passed and creates an articulation view using physX tensor api.\n\n Args:\n physics_sim_view (omni.physics.tensors.SimulationView, optional): current physics simulation view. Defaults to None.\n ", "snippet": "articulation_view.initialize(physics_sim_view=None) # omni.physics.tensors.bindings._physicsTensors.SimulationView\n" }, { "title": "is_physics_handle_valid", "description": " Returns:\n bool: False if .initialize() needs to be called again for the physics handle to be valid. Otherwise True.\n Note: if physics handle is not valid many of the methods that requires physX will return None.\n ", "snippet": "articulation_view.is_physics_handle_valid()\n" }, { "title": "post_reset", "description": "Resets the prims to its default state.\n ", "snippet": "articulation_view.post_reset()\n" }, { "title": "set_angular_velocities", "description": "Sets the angular velocities of the prims in the view. The method does this through the physx API only.\n i.e: It has to be called after initialization.\n Note: This method is not supported for the gpu pipeline. set_velocities method should be used instead.\n\n Args:\n velocities (Optional[Union[np.ndarray, torch.Tensor]]): angular velocities to set the rigid prims to. shape is (M, 3).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "articulation_view.set_angular_velocities(velocities=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_armatures", "description": "Sets armatures for articulation joints in the view.\n\n Args:\n values (Union[np.ndarray, torch.Tensor]): armatures for articulations in the view. shape (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n ", "snippet": "articulation_view.set_armatures(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_body_coms", "description": "Sets body center of mass positions and orientations for articulation bodies in the view.\n\n Args:\n positions (Union[np.ndarray, torch.Tensor]): body center of mass positions for articulations in the view. shape (M, K, 3).\n orientations (Union[np.ndarray, torch.Tensor]): body center of mass orientations for articulations in the view. shape (M, K, 4).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n body_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): body indicies to specify which bodies \n to manipulate. Shape (K,).\n Where K <= num of bodies.\n Defaults to None (i.e: all bodies).\n ", "snippet": "articulation_view.set_body_coms(positions=None, # typing.Union[numpy.ndarray, torch.Tensor]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n body_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_body_inertias", "description": "Sets body inertias for articulation bodies in the view.\n\n Args:\n values (Union[np.ndarray, torch.Tensor]): body inertias for articulations in the view. shape (M, K, 9).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n body_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): body indicies to specify which bodies \n to manipulate. Shape (K,).\n Where K <= num of bodies.\n Defaults to None (i.e: all bodies).\n ", "snippet": "articulation_view.set_body_inertias(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n body_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_body_masses", "description": "Sets body masses for articulation bodies in the view.\n\n Args:\n values (Union[np.ndarray, torch.Tensor]): body masses for articulations in the view. shape (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n body_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): body indicies to specify which bodies \n to manipulate. Shape (K,).\n Where K <= num of bodies.\n Defaults to None (i.e: all bodies).\n ", "snippet": "articulation_view.set_body_masses(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n body_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_effort_modes", "description": " Sets effort modes for articulations in the view.\n\n Args:\n mode (str): effort mode to be applied to prims in the view. force or acceleration.\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n\n Raises:\n Exception: _description_\n ", "snippet": "articulation_view.set_effort_modes(mode=mode, # str\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_enabled_self_collisions", "description": " Sets the enable self collisions flag\n\n Args:\n flags (Union[np.ndarray, torch.Tensor]): true to enable self collision. otherwise false. shape (M,)\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "articulation_view.set_enabled_self_collisions(flags=flags, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_fixed_tendon_properties", "description": "Sets fixed tendon properties for articulations in the view.\n\n Args:\n stiffnesses (Union[np.ndarray, torch.Tensor]): fixed tendon stiffnesses for articulations in the view. shape (M, K).\n dampings (Union[np.ndarray, torch.Tensor]): fixed tendon dampings for articulations in the view. shape (M, K).\n limit_stiffnesses (Union[np.ndarray, torch.Tensor]): fixed tendon limit stiffnesses for articulations in the view. shape (M, K).\n limits (Union[np.ndarray, torch.Tensor]): fixed tendon limits for articulations in the view. shape (M, K, 2).\n rest_lengths (Union[np.ndarray, torch.Tensor]): fixed tendon rest lengths for articulations in the view. shape (M, K).\n offsets (Union[np.ndarray, torch.Tensor]): fixed tendon offsets for articulations in the view. shape (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "articulation_view.set_fixed_tendon_properties(stiffnesses=None, # typing.Union[numpy.ndarray, torch.Tensor]\n dampings=None, # typing.Union[numpy.ndarray, torch.Tensor]\n limit_stiffnesses=None, # typing.Union[numpy.ndarray, torch.Tensor]\n limits=None, # typing.Union[numpy.ndarray, torch.Tensor]\n rest_lengths=None, # typing.Union[numpy.ndarray, torch.Tensor]\n offsets=None, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_friction_coefficients", "description": "Sets friction coefficients for articulation joints in the view.\n\n Args:\n values (Union[np.ndarray, torch.Tensor]): friction coefficients for articulations in the view. shape (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n ", "snippet": "articulation_view.set_friction_coefficients(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_gains", "description": " Sets stiffness and damping of articulations in the view.\n\n Args:\n kps (Optional[Union[np.ndarray, torch.Tensor]], optional): stiffness of the drives. shape is (M, K). Defaults to None.\n kds (Optional[Union[np.ndarray, torch.Tensor]], optional): damping of the drives. shape is (M, K).. Defaults to None.\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n save_to_usd (bool, optional): True to save the gains in the usd. otherwise False.\n ", "snippet": "articulation_view.set_gains(kps=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n kds=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n save_to_usd=False) # bool\n" }, { "title": "set_joint_efforts", "description": "Sets the joint efforts of articulations in the view.\n\n Args:\n efforts (Optional[Union[np.ndarray, torch.Tensor]]): efforts of articulations in the view to be set to in the next frame. \n shape is (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n ", "snippet": "articulation_view.set_joint_efforts(efforts=efforts, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_joint_position_targets", "description": " Sets the joint position targets for the implicit pd controllers.\n\n Args:\n positions (Optional[Union[np.ndarray, torch.Tensor]]): joint position targets for the implicit pd controller. \n shape is (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n ", "snippet": "articulation_view.set_joint_position_targets(positions=positions, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_joint_positions", "description": "Sets the joint positions of articulations in the view.\n\n Args:\n positions (Optional[Union[np.ndarray, torch.Tensor]]): joint positions of articulations in the view to be set to in the next frame. \n shape is (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n ", "snippet": "articulation_view.set_joint_positions(positions=positions, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_joint_velocities", "description": "Sets the joint velocities of articulations in the view.\n\n Args:\n velocities (Optional[Union[np.ndarray, torch.Tensor]]): joint velocities of articulations in the view to be set to in the next frame. \n shape is (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n ", "snippet": "articulation_view.set_joint_velocities(velocities=velocities, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_joint_velocity_targets", "description": " Sets the joint velocity targets for the implicit pd controllers.\n\n Args:\n velocities (Optional[Union[np.ndarray, torch.Tensor]]): joint velocity targets for the implicit pd controller. \n shape is (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n ", "snippet": "articulation_view.set_joint_velocity_targets(velocities=velocities, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_joints_default_state", "description": "Sets the joints default state (joint positions, velocities and efforts) to be applied after each reset.\n\n Args:\n positions (Optional[Union[np.ndarray, torch.Tensor]], optional): default joint positions.\n shape is (N, num of dofs). Defaults to None.\n velocities (Optional[Union[np.ndarray, torch.Tensor]], optional): default joint velocities.\n shape is (N, num of dofs). Defaults to None.\n efforts (Optional[Union[np.ndarray, torch.Tensor]], optional): default joint efforts.\n shape is (N, num of dofs). Defaults to None.\n ", "snippet": "articulation_view.set_joints_default_state(positions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n velocities=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n efforts=None) # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n" }, { "title": "set_linear_velocities", "description": "Sets the linear velocities of the prims in the view. The method does this through the physx API only.\n i.e: It has to be called after initialization.\n Note: This method is not supported for the gpu pipeline. set_velocities method should be used instead.\n\n Args:\n velocities (Optional[Union[np.ndarray, torch.Tensor]]): linear velocities to set the rigid prims to. shape is (M, 3).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "articulation_view.set_linear_velocities(velocities=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_local_poses", "description": "Sets prim poses in the view with respect to the local frame (the prim's parent frame).\n\n Args:\n translations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n translations in the local frame of the prims\n (with respect to its parent prim). shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n quaternion orientations in the local frame of the prims. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "articulation_view.set_local_poses(translations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_max_efforts", "description": "Sets maximum efforts for articulation in the view.\n\n Args:\n values (Union[np.ndarray, torch.Tensor]): maximum efforts for articulations in the view. shape (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n ", "snippet": "articulation_view.set_max_efforts(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_sleep_thresholds", "description": " Sets sleep thresholds for articulations in the view.\n\n Args:\n thresholds (Union[np.ndarray, torch.Tensor]): sleep thresholds to be applied. shape (M,).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "articulation_view.set_sleep_thresholds(thresholds=thresholds, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_solver_position_iteration_counts", "description": " Sets the physics solver itertion counts for joint positions.\n\n Args:\n counts (Union[np.ndarray, torch.Tensor]): number of iterations for the solver. Shape (M,).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "articulation_view.set_solver_position_iteration_counts(counts=counts, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_solver_velocity_iteration_counts", "description": " Sets the physics solver itertion counts for joint velocities.\n\n Args:\n counts (Union[np.ndarray, torch.Tensor]): number of iterations for the solver. Shape (M,).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "articulation_view.set_solver_velocity_iteration_counts(counts=counts, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_stabilization_thresholds", "description": "Sets the stabilizaion thresholds.\n\n Args:\n thresholds (Union[np.ndarray, torch.Tensor]): stabilization thresholds to be applied. Shape (M,).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "articulation_view.set_stabilization_thresholds(thresholds=thresholds, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_velocities", "description": "Sets the linear and angular velocities of the prims in the view at once. The method does this through the physx API only.\n i.e: It has to be called after initialization.\n\n Args:\n velocities (Optional[Union[np.ndarray, torch.Tensor]]): linear and angular velocities respectively to set the rigid prims to. shape is (M, 6).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "articulation_view.set_velocities(velocities=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_world_poses", "description": "Sets poses of prims in the view with respect to the world's frame.\n\n Args:\n positions (Optional[Union[np.ndarray, torch.Tensor]], optional): positions in the world frame of the prim. shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): quaternion orientations in the world frame of the prims. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "articulation_view.set_world_poses(positions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "switch_control_mode", "description": " Switches control mode between velocity, position or effort.\n\n Args:\n mode (str): control mode to switch the articulations specified to. mode can be velocity, position or effort.\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n ", "snippet": "articulation_view.switch_control_mode(mode=mode, # str\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "switch_dof_control_mode", "description": "Switches dof control mode between velocity, position or effort.\n\n Args:\n mode (str): control mode to switch the dof in articulations specified to. mode an be velocity, position or effort.\n dof_index (int): dof index to swith the control mode of.\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "articulation_view.switch_dof_control_mode(mode=mode, # str\n dof_index=dof_index, # int\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "apply_visual_materials", "description": "Used to apply visual material to the prims and optionally its prim descendants.\n\n Args:\n visual_materials (Union[VisualMaterial, List[VisualMaterial]]): visual materials to be applied to the prims. Currently supports\n PreviewSurface, OmniPBR and OmniGlass. If a list is provided then\n its size has to be equal the view's size or indices size. \n If one material is provided it will be applied to all prims in the view.\n weaker_than_descendants (Optional[Union[bool, List[bool]]], optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False. \n If a list of visual materials is provided then a list\n has to be provided with the same size for this arg as well.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Raises:\n Exception: length of visual materials != length of prims indexed\n Exception: length of visual materials != length of weaker descendants bools arg\n ", "snippet": "articulation_view.apply_visual_materials(visual_materials=visual_materials, # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, typing.List[omni.isaac.core.materials.visual_material.VisualMaterial]]\n weaker_than_descendants=None, # typing.Union[bool, typing.List[bool], NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_applied_visual_materials", "description": "\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n List[VisualMaterial]: a list of the current applied visual materials to the prims if its type is currently supported.\n ", "snippet": "applied_visual_materials = articulation_view.get_applied_visual_materials(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimViewState: returns the default state of the prims (positions and orientations) that is used after each reset.\n ", "snippet": "default_state = articulation_view.get_default_state()\n" }, { "title": "get_local_poses", "description": "Gets prim poses in the view with respect to the local's frame (the prim's parent frame).\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: \n first index is translations in the local frame of the prims. shape is (M, 3). \n second index is quaternion orientations in the local frame of the prims.\n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n ", "snippet": "local_poses = articulation_view.get_local_poses(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_local_scales", "description": "Gets prim scales in the view with respect to the local frame (the parent's frame).\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: scales applied to the prim's dimensions in the local frame. shape is (M, 3).\n ", "snippet": "local_scales = articulation_view.get_local_scales(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_visibilities", "description": "Returns the current visibilities of the prims in stage.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Shape (M,) with type bool, where each item holds True \n if the prim is visible in stage. False otherwise.\n ", "snippet": "visibilities = articulation_view.get_visibilities(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_world_poses", "description": " Returns the poses (positions and orientations) of the prims in the view with respect to the world frame.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: first index is positions in the world frame of the prims. shape is (M, 3). \n second index is quaternion orientations in the world frame of the prims.\n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n ", "snippet": "world_poses = articulation_view.get_world_poses(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_world_scales", "description": "Gets prim scales in the view with respect to the world's frame.\n\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: scales applied to the prim's dimensions in the world frame. shape is (M, 3).\n ", "snippet": "world_scales = articulation_view.get_world_scales(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "initialize", "description": "", "snippet": "articulation_view.initialize(physics_sim_view=None) # omni.physics.tensors.bindings._physicsTensors.SimulationView\n" }, { "title": "is_valid", "description": " Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n bool: True if all prim paths specified in the view correspond to a valid prim in stage. False otherwise.\n ", "snippet": "articulation_view.is_valid(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "is_visual_material_applied", "description": " Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n List[bool]: True if there is a visual material applied is applied to the corresponding prim in the view. False otherwise.\n ", "snippet": "articulation_view.is_visual_material_applied(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "post_reset", "description": "Resets the prims to its default state (positions and orientations).\n ", "snippet": "articulation_view.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prims (positions and orientations), that will be used after each reset.\n\n Args:\n positions (Optional[np.ndarray], optional): positions in the world frame of the prim. shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[np.ndarray], optional): quaternion orientations in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "articulation_view.set_default_state(positions=None, # typing.Union[numpy.ndarray, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_local_poses", "description": "Sets prim poses in the view with respect to the local frame (the prim's parent frame).\n\n Args:\n translations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n translations in the local frame of the prims\n (with respect to its parent prim). shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n quaternion orientations in the local frame of the prims. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "articulation_view.set_local_poses(translations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_local_scales", "description": "Sets prim scales in the view with respect to the local frame (the prim's parent frame).\n\n Args:\n scales (Optional[Union[np.ndarray, torch.Tensor]]): scales to be applied to the prim's dimensions in the view. \n shape is (M, 3).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "articulation_view.set_local_scales(scales=scales, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_visibilities", "description": "Sets the visibilities of the prims in stage.\n\n Args:\n visibilities (Union[np.ndarray, torch.Tensor]): flag to set the visibilities of the usd prims in stage. \n Shape (M,). Where M <= size of the encapsulated prims in the view.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "articulation_view.set_visibilities(visibilities=visibilities, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_world_poses", "description": "Sets prim poses in the view with respect to the world's frame.\n\n Args:\n positions (Optional[Union[np.ndarray, torch.Tensor]], optional): positions in the world frame of the prims. shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): quaternion orientations in the world frame of the prims. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "articulation_view.set_world_poses(positions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" } ] } ] }, { "title": "Controllers", "snippets": [ { "title": "ArticulationController", "snippets": [ { "title": "ArticulationController", "description": "PD Controller of all degrees of freedom of an articulation, can apply position targets, velocity targets and efforts.\n\n Checkout the required tutorials at \n https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/overview.html \n ", "snippet": "articulation_controller = ArticulationController()\n" }, { "title": "apply_action", "description": "[summary]\n\n Args:\n control_actions (ArticulationAction): actions to be applied for next physics step.\n indices (Optional[Union[list, np.ndarray]], optional): degree of freedom indices to apply actions to.\n Defaults to all degrees of freedom.\n\n Raises:\n Exception: [description]\n ", "snippet": "articulation_controller.apply_action(control_actions=control_actions) # omni.isaac.core.utils.types.ArticulationAction\n" }, { "title": "get_applied_action", "description": "\n Raises:\n Exception: [description]\n\n Returns:\n ArticulationAction: Gets last applied action.\n ", "snippet": "applied_action = articulation_controller.get_applied_action()\n" }, { "title": "get_effort_modes", "description": "[summary]\n\n Raises:\n Exception: [description]\n NotImplementedError: [description]\n\n Returns:\n np.ndarray: [description]\n ", "snippet": "effort_modes = articulation_controller.get_effort_modes()\n" }, { "title": "get_gains", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: [description]\n ", "snippet": "gains = articulation_controller.get_gains()\n" }, { "title": "get_joint_limits", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: [description]\n ", "snippet": "joint_limits = articulation_controller.get_joint_limits()\n" }, { "title": "get_max_efforts", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n np.ndarray: [description]\n ", "snippet": "max_efforts = articulation_controller.get_max_efforts()\n" }, { "title": "initialize", "description": "[summary]\n\n Args:\n handle ([type]): [description]\n dof_infos ([type]): [description]\n ", "snippet": "articulation_controller.initialize(handle=handle,\n articulation_view=articulation_view)\n" }, { "title": "set_effort_modes", "description": "[summary]\n\n Args:\n mode (str): [description]\n indices (Optional[Union[np.ndarray, list]], optional): [description]. Defaults to None.\n\n Raises:\n Exception: [description]\n Exception: [description]\n ", "snippet": "articulation_controller.set_effort_modes(mode=mode, # str\n joint_indices=None) # typing.Union[numpy.ndarray, list, NoneType]\n" }, { "title": "set_gains", "description": "[summary]\n\n Args:\n kps (Optional[np.ndarray], optional): [description]. Defaults to None.\n kds (Optional[np.ndarray], optional): [description]. Defaults to None.\n\n Raises:\n Exception: [description]\n ", "snippet": "articulation_controller.set_gains(kps=None, # typing.Union[numpy.ndarray, NoneType]\n kds=None, # typing.Union[numpy.ndarray, NoneType]\n save_to_usd=False) # bool\n" }, { "title": "set_max_efforts", "description": "[summary]\n\n Args:\n value (float, optional): [description]. Defaults to None.\n indices (Optional[Union[np.ndarray, list]], optional): [description]. Defaults to None.\n\n Raises:\n Exception: [description]\n ", "snippet": "articulation_controller.set_max_efforts(values=values, # numpy.ndarray\n joint_indices=None) # typing.Union[numpy.ndarray, list, NoneType]\n" }, { "title": "switch_control_mode", "description": "[summary]\n\n Args:\n mode (str): [description]\n\n Raises:\n Exception: [description]\n ", "snippet": "articulation_controller.switch_control_mode(mode=mode) # str\n" }, { "title": "switch_dof_control_mode", "description": "[summary]\n\n Args:\n dof_index (int): [description]\n mode (str): [description]\n\n Raises:\n Exception: [description]\n ", "snippet": "articulation_controller.switch_dof_control_mode(dof_index=dof_index, # int\n mode=mode) # str\n" } ] }, { "title": "BaseController", "snippets": [ { "title": "BaseController", "description": "[summary]\n\n Args:\n name (str): [description]\n ", "snippet": "base_controller = BaseController(name=name) # str\n" }, { "title": "forward", "description": "A controller should take inputs and returns an ArticulationAction to be then passed to the \n ArticulationController.\n\n Args:\n observations (dict): [description]\n\n Raises:\n NotImplementedError: [description]\n\n Returns:\n ArticulationAction: [description]\n ", "snippet": "base_controller.forward()\n" }, { "title": "reset", "description": "Resets state of the controller.\n ", "snippet": "base_controller.reset()\n" } ] }, { "title": "BaseGripperController", "snippets": [ { "title": "BaseGripperController", "description": "[summary]\n\n Args:\n name (str): [description]\n ", "snippet": "base_gripper_controller = BaseGripperController(name=name) # str\n" }, { "title": "close", "description": "[summary]\n\n Args:\n current_joint_positions (np.ndarray): [description]\n\n Raises:\n NotImplementedError: [description]\n\n Returns:\n ArticulationAction: [description]\n ", "snippet": "base_gripper_controller.close(current_joint_positions=current_joint_positions) # numpy.ndarray\n" }, { "title": "forward", "description": "Action has be \"open\" or \"close\"\n\n Args:\n action (str): \"open\" or \"close\"\n current_joint_positions (np.ndarray): [description]\n\n Raises:\n Exception: [description]\n\n Returns:\n ArticulationAction: [description]\n ", "snippet": "base_gripper_controller.forward(action=action, # str\n current_joint_positions=current_joint_positions) # numpy.ndarray\n" }, { "title": "open", "description": "[summary]\n\n Args:\n current_joint_positions (np.ndarray): [description]\n\n Raises:\n NotImplementedError: [description]\n\n Returns:\n ArticulationAction: [description]\n ", "snippet": "base_gripper_controller.open(current_joint_positions=current_joint_positions) # numpy.ndarray\n" }, { "title": "reset", "description": "[summary]\n ", "snippet": "base_gripper_controller.reset()\n" } ] } ] }, { "title": "DataLogger", "snippets": [ { "title": "DataLogger", "description": " This class takes care of collecting data as well as reading already saved data in order to replay it for instance.", "snippet": "data_logger = DataLogger()\n" }, { "title": "add_data", "description": " Adds data to the log\n\n Args:\n data (dict): Dictionary representing the data to be logged at this time index.\n current_time_step (float): time step corresponding to the data collected.\n current_time (float): time in seconds corresponding to the data collected.\n ", "snippet": "data_logger.add_data(data=data, # dict\n current_time_step=current_time_step, # float\n current_time=current_time) # float\n" }, { "title": "add_data_frame_logging_func", "description": "\n Args:\n func (Callable[[list[BaseTask], Scene], None]): function to be called at every step when the logger is started.\n should follow:\n\n def dummy_data_collection_fn(tasks, scene):\n return {\"data 1\": [data]}\n ", "snippet": "data_logger.add_data_frame_logging_func(func=func) # typing.Callable[[typing.List[omni.isaac.core.tasks.base_task.BaseTask], omni.isaac.core.scenes.scene.Scene], typing.Dict]\n" }, { "title": "get_data_frame", "description": "\n Args:\n data_frame_index (int): index of the data frame to retrieve.\n\n Returns:\n DataFrame: Data Frame collected/ retrieved at the specified data frame index.\n ", "snippet": "data_frame = data_logger.get_data_frame(data_frame_index=data_frame_index) # int\n" }, { "title": "get_num_of_data_frames", "description": "\n Returns:\n int: the number of data frames collected/ retrieved in the data logger.\n ", "snippet": "num_of_data_frames = data_logger.get_num_of_data_frames()\n" }, { "title": "is_started", "description": " Returns:\n bool: True if data collection is started/ resumed. False otherwise.\n ", "snippet": "data_logger.is_started()\n" }, { "title": "load", "description": "Loads data from a json file to read back a previous saved data or to resume recording data from another time step.\n\n Args:\n log_path (str): path of the json file to be used to load the data.\n ", "snippet": "data_logger.load(log_path=log_path) # str\n" }, { "title": "pause", "description": "Pauses data collection.\n ", "snippet": "data_logger.pause()\n" }, { "title": "reset", "description": "Clears the data in the logger.\n ", "snippet": "data_logger.reset()\n" }, { "title": "save", "description": " Saves the current data in the logger to a json file\n\n Args:\n log_path (str): path of the json file to be used to save the data.\n ", "snippet": "data_logger.save(log_path=log_path) # str\n" }, { "title": "start", "description": "Resumes/ starts data collection.\n ", "snippet": "data_logger.start()\n" } ] }, { "title": "Materials", "snippets": [ { "title": "OmniGlass", "snippets": [ { "title": "OmniGlass", "description": "[summary]\n\n Args:\n prim_path (str): [description]\n name (str, optional): [description]. Defaults to \"omni_glass\".\n shader (Optional[UsdShade.Shader], optional): [description]. Defaults to None.\n color (Optional[np.ndarray], optional): [description]. Defaults to None.\n ior (Optional[float], optional): [description]. Defaults to None.\n depth (Optional[float], optional): [description]. Defaults to None.\n thin_walled (Optional[bool], optional): [description]. Defaults to None.\n\n Raises:\n Exception: [description]\n ", "snippet": "omni_glass = OmniGlass(prim_path=prim_path, # str\n name=\"omni_glass\", # str\n shader=None, # typing.Union[pxr.UsdShade.Shader, NoneType]\n color=None, # typing.Union[numpy.ndarray, NoneType]\n ior=None, # typing.Union[float, NoneType]\n depth=None, # typing.Union[float, NoneType]\n thin_walled=None) # typing.Union[bool, NoneType]\n" }, { "title": "get_color", "description": "[summary]\n\n Returns:\n np.ndarray: [description]\n ", "snippet": "color = omni_glass.get_color()\n" }, { "title": "get_depth", "description": "", "snippet": "depth = omni_glass.get_depth()\n" }, { "title": "get_ior", "description": "", "snippet": "ior = omni_glass.get_ior()\n" }, { "title": "get_thin_walled", "description": "", "snippet": "thin_walled = omni_glass.get_thin_walled()\n" }, { "title": "set_color", "description": "[summary]\n\n Args:\n color (np.ndarray): [description]\n ", "snippet": "omni_glass.set_color(color=color) # numpy.ndarray\n" }, { "title": "set_depth", "description": "", "snippet": "omni_glass.set_depth(depth=depth) # float\n" }, { "title": "set_ior", "description": "", "snippet": "omni_glass.set_ior(ior=ior) # float\n" }, { "title": "set_thin_walled", "description": "", "snippet": "omni_glass.set_thin_walled(thin_walled=thin_walled) # float\n" } ] }, { "title": "OmniPBR", "snippets": [ { "title": "OmniPBR", "description": "[summary]\n\n Args:\n prim_path (str): [description]\n name (str, optional): [description]. Defaults to \"omni_pbr\".\n shader (Optional[UsdShade.Shader], optional): [description]. Defaults to None.\n texture_path (Optional[str], optional): [description]. Defaults to None.\n texture_scale (Optional[np.ndarray], optional): [description]. Defaults to None.\n color (Optional[np.ndarray], optional): [description]. Defaults to None.\n ", "snippet": "omni_pbr = OmniPBR(prim_path=prim_path, # str\n name=\"omni_pbr\", # str\n shader=None, # typing.Union[pxr.UsdShade.Shader, NoneType]\n texture_path=None, # typing.Union[str, NoneType]\n texture_scale=None, # typing.Union[numpy.ndarray, NoneType]\n color=None) # typing.Union[numpy.ndarray, NoneType]\n" }, { "title": "get_color", "description": "[summary]\n\n Returns:\n np.ndarray: [description]\n ", "snippet": "color = omni_pbr.get_color()\n" }, { "title": "get_metallic_constant", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "metallic_constant = omni_pbr.get_metallic_constant()\n" }, { "title": "get_project_uvw", "description": "[summary]\n\n Returns:\n bool: [description]\n ", "snippet": "project_uvw = omni_pbr.get_project_uvw()\n" }, { "title": "get_reflection_roughness", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "reflection_roughness = omni_pbr.get_reflection_roughness()\n" }, { "title": "get_texture", "description": "[summary]\n\n Returns:\n str: [description]\n ", "snippet": "texture = omni_pbr.get_texture()\n" }, { "title": "get_texture_scale", "description": "[summary]\n\n Returns:\n np.ndarray: [description]\n ", "snippet": "texture_scale = omni_pbr.get_texture_scale()\n" }, { "title": "set_color", "description": "[summary]\n\n Args:\n color (np.ndarray): [description]\n ", "snippet": "omni_pbr.set_color(color=color) # numpy.ndarray\n" }, { "title": "set_metallic_constant", "description": "[summary]\n\n Args:\n amount (float): [description]\n ", "snippet": "omni_pbr.set_metallic_constant(amount=amount) # float\n" }, { "title": "set_project_uvw", "description": "[summary]\n\n Args:\n flag (bool): [description]\n ", "snippet": "omni_pbr.set_project_uvw(flag=flag) # bool\n" }, { "title": "set_reflection_roughness", "description": "[summary]\n\n Args:\n amount (float): [description]\n ", "snippet": "omni_pbr.set_reflection_roughness(amount=amount) # float\n" }, { "title": "set_texture", "description": "[summary]\n\n Args:\n path (str): [description]\n ", "snippet": "omni_pbr.set_texture(path=path) # str\n" }, { "title": "set_texture_scale", "description": "[summary]\n\n Args:\n x (float): [description]\n y (float): [description]\n ", "snippet": "omni_pbr.set_texture_scale(x=x, # float\n y=y) # float\n" } ] }, { "title": "ParticleMaterial", "snippets": [ { "title": "ParticleMaterial", "description": "A wrapper around position-based-dynamics (PBD) material for particles used to\nsimulate fluids, cloth and inflatables.\n\nNote:\n Currently, only a single material per particle system is supported which applies\n to all objects that are associated with the system.", "snippet": "particle_material = ParticleMaterial(prim_path=prim_path, # str\n name=\"particle_material\", # typing.Union[str, NoneType]\n friction=None, # typing.Union[float, NoneType]\n particle_friction_scale=None, # typing.Union[float, NoneType]\n damping=None, # typing.Union[float, NoneType]\n viscosity=None, # typing.Union[float, NoneType]\n vorticity_confinement=None, # typing.Union[float, NoneType]\n surface_tension=None, # typing.Union[float, NoneType]\n cohesion=None, # typing.Union[float, NoneType]\n adhesion=None, # typing.Union[float, NoneType]\n particle_adhesion_scale=None, # typing.Union[float, NoneType]\n adhesion_offset_scale=None, # typing.Union[float, NoneType]\n gravity_scale=None, # typing.Union[float, NoneType]\n lift=None, # typing.Union[float, NoneType]\n drag=None) # typing.Union[float, NoneType]\n" }, { "title": "get_adhesion", "description": " Returns:\n float: The adhesion for interaction between particles (solid or fluid), and rigids or deformables.\n ", "snippet": "adhesion = particle_material.get_adhesion()\n" }, { "title": "get_adhesion_offset_scale", "description": " Returns:\n float: The adhesion offset scale.\n ", "snippet": "adhesion_offset_scale = particle_material.get_adhesion_offset_scale()\n" }, { "title": "get_cohesion", "description": " Returns:\n float: The cohesion for interaction between fluid particles.\n ", "snippet": "cohesion = particle_material.get_cohesion()\n" }, { "title": "get_damping", "description": " Returns:\n float: The global velocity damping coefficient.\n ", "snippet": "damping = particle_material.get_damping()\n" }, { "title": "get_drag", "description": " Returns:\n float: The drag coefficient, basic aerodynamic drag model coefficient.\n ", "snippet": "drag = particle_material.get_drag()\n" }, { "title": "get_friction", "description": " Returns:\n float: The friction coefficient.\n ", "snippet": "friction = particle_material.get_friction()\n" }, { "title": "get_gravity_scale", "description": " Returns:\n float: The gravitational acceleration scaling factor.\n ", "snippet": "gravity_scale = particle_material.get_gravity_scale()\n" }, { "title": "get_lift", "description": " Returns:\n float: The lift coefficient, basic aerodynamic lift model coefficient.\n ", "snippet": "lift = particle_material.get_lift()\n" }, { "title": "get_particle_adhesion_scale", "description": " Returns:\n float: The particle adhesion scale.\n ", "snippet": "particle_adhesion_scale = particle_material.get_particle_adhesion_scale()\n" }, { "title": "get_particle_friction_scale", "description": " Returns:\n float: The particle friction scale.\n ", "snippet": "particle_friction_scale = particle_material.get_particle_friction_scale()\n" }, { "title": "get_surface_tension", "description": " Returns:\n float: The surface tension for fluid particles.\n ", "snippet": "surface_tension = particle_material.get_surface_tension()\n" }, { "title": "get_viscosity", "description": " Returns:\n float: The viscosity.\n ", "snippet": "viscosity = particle_material.get_viscosity()\n" }, { "title": "get_vorticity_confinement", "description": " Returns:\n float: The vorticity confinement for fluid particles.\n ", "snippet": "vorticity_confinement = particle_material.get_vorticity_confinement()\n" }, { "title": "initialize", "description": "", "snippet": "particle_material.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "particle_material.is_valid()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state.\n ", "snippet": "particle_material.post_reset()\n" }, { "title": "set_adhesion", "description": "Sets the adhesion for interaction between particles (solid or fluid), and rigid or deformable objects.\n\n Note:\n Adhesion also applies to solid-solid particle interactions, but is multiplied with the\n particle adhesion scale.\n\n Args:\n value (float): The adhesion.\n Range: [0, inf), Units: dimensionless\n\n ", "snippet": "particle_material.set_adhesion(value=value) # float\n" }, { "title": "set_adhesion_offset_scale", "description": "Sets the adhesion offset scale.\n\n It defines the offset at which adhesion ceases to take effect. For interactions between\n particles (fluid or solid), and rigids or deformables, the adhesion offset is defined\n relative to the rest offset. For solid particle-particle interactions, the adhesion\n offset is defined relative to the solid rest offset.\n\n Args:\n value (float): The adhesion offset scale.\n Range: [0, inf), Units: dimensionless\n ", "snippet": "particle_material.set_adhesion_offset_scale(value=value) # float\n" }, { "title": "set_cohesion", "description": "Sets the cohesion for interaction between fluid particles.\n\n Args:\n value (float): The cohesion.\n Range: [0, inf), Units: dimensionless\n\n ", "snippet": "particle_material.set_cohesion(value=value) # float\n" }, { "title": "set_damping", "description": "Sets the global velocity damping coefficient.\n\n Args:\n value (float): The damping coefficient.\n Range: [0, inf), Units: dimensionless\n ", "snippet": "particle_material.set_damping(value=value) # float\n" }, { "title": "set_drag", "description": "Sets the drag coefficient, i.e. basic aerodynamic drag model coefficient.\n\n It is useful for cloth and inflatable particle objects.\n\n Args:\n value (float): The drag coefficient.\n Range: [0, inf), Units: dimensionless\n ", "snippet": "particle_material.set_drag(value=value) # float\n" }, { "title": "set_friction", "description": "Sets the friction coefficient.\n\n The friction takes effect in all interactions between particles and rigids or deformables.\n For solid particle-particle interactions it is multiplied by the particle friction scale.\n\n Args:\n value (float): The friction coefficient.\n Range: [0, inf), Units: dimensionless\n ", "snippet": "particle_material.set_friction(value=value) # float\n" }, { "title": "set_gravity_scale", "description": "Sets the gravitational acceleration scaling factor.\n\n It can be used to approximate lighter-than-air inflatable.\n For example (-1.0 would invert gravity).\n\n Args:\n value (float): The gravity scale.\n Range: (-inf , inf), Units: dimensionless\n ", "snippet": "particle_material.set_gravity_scale(value=value) # float\n" }, { "title": "set_lift", "description": "Sets the lift coefficient, i.e. basic aerodynamic lift model coefficient.\n\n It is useful for cloth and inflatable particle objects.\n\n Args:\n value (float): The lift coefficient.\n Range: [0, inf), Units: dimensionless\n ", "snippet": "particle_material.set_lift(value=value) # float\n" }, { "title": "set_particle_adhesion_scale", "description": "Sets the particle adhesion scale.\n\n This coefficient scales the adhesion for solid particle-particle interaction.\n\n Args:\n value (float): The adhesion scale.\n Range: [0, inf), Units: dimensionless\n ", "snippet": "particle_material.set_particle_adhesion_scale(value=value) # float\n" }, { "title": "set_particle_friction_scale", "description": "Sets the particle friction scale.\n\n The coefficient that scales friction for solid particle-particle interaction.\n\n Args:\n value (float): The particle friction scale.\n Range: [0, inf), Units: dimensionless\n ", "snippet": "particle_material.set_particle_friction_scale(value=value) # float\n" }, { "title": "set_surface_tension", "description": "Sets the surface tension for fluid particles.\n\n Args:\n value (float): The surface tension.\n Range: [0, inf), Units: 1 / (distance * distance * distance)\n ", "snippet": "particle_material.set_surface_tension(value=value) # float\n" }, { "title": "set_viscosity", "description": "Sets the viscosity for fluid particles.\n\n Args:\n value (float): The viscosity.\n Range: [0, inf), Units: dimensionless\n ", "snippet": "particle_material.set_viscosity(value=value) # float\n" }, { "title": "set_vorticity_confinement", "description": "Sets the vorticity confinement for fluid particles.\n\n This helps prevent energy loss due to numerical solver by adding vortex-like\n accelerations to the particles.\n\n Args:\n value (float): The vorticity confinement.\n Range: [0, inf), Units: dimensionless\n ", "snippet": "particle_material.set_vorticity_confinement(value=value) # float\n" } ] }, { "title": "ParticleMaterialView", "snippets": [ { "title": "ParticleMaterialView", "description": "The view class to deal with particleMaterial prims.\n Provides high level functions to deal with particle material (1 or more particle materials) \n as well as its attributes/ properties. This object wraps all matching materials found at the regex provided at the prim_paths_expr.\n This object wraps all matching materials Prims found at the regex provided at the prim_paths_expr.", "snippet": "particle_material_view = ParticleMaterialView(prim_paths_expr=prim_paths_expr, # str\n name=\"particle_material_view\", # str\n frictions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n particle_friction_scales=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n dampings=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n viscosities=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n vorticity_confinements=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n surface_tensions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n cohesions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n adhesions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n particle_adhesion_scales=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n adhesion_offset_scales=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n gravity_scales=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n lifts=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n drags=None) # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n" }, { "title": "get_adhesion_offset_scales", "description": "Gets the adhesion offset scale of materials indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: adhesion offset scale tensor with shape (M, )\n ", "snippet": "adhesion_offset_scales = particle_material_view.get_adhesion_offset_scales(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_adhesions", "description": "Gets the adhesion of materials indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: adhesion tensor with shape (M, )\n ", "snippet": "adhesions = particle_material_view.get_adhesions(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_cohesions", "description": "Gets the cohesion of materials indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: cohesion tensor with shape (M, )\n ", "snippet": "cohesions = particle_material_view.get_cohesions(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_dampings", "description": "Gets the dampings of materials indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: dampings tensor with shape (M, )\n ", "snippet": "dampings = particle_material_view.get_dampings(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_drags", "description": "Gets the drags of materials indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: drag tensor with shape (M, )\n ", "snippet": "drags = particle_material_view.get_drags(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_frictions", "description": "Gets the friction of materials indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: friction tensor with shape (M, )\n ", "snippet": "frictions = particle_material_view.get_frictions(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_gravity_scales", "description": "Gets the gravity scale of materials indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: gravity scale tensor with shape (M, )\n ", "snippet": "gravity_scales = particle_material_view.get_gravity_scales(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_lifts", "description": "Gets the lifts of materials indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: lift tensor with shape (M, )\n ", "snippet": "lifts = particle_material_view.get_lifts(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_particle_adhesion_scales", "description": "Gets the adhesion scale of materials indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: adhesion scale tensor with shape (M, )\n ", "snippet": "particle_adhesion_scales = particle_material_view.get_particle_adhesion_scales(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_particle_friction_scales", "description": "Gets the particle friction scale of materials indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: particle friction scale tensor with shape (M, )\n ", "snippet": "particle_friction_scales = particle_material_view.get_particle_friction_scales(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_surface_tensions", "description": "Gets the surface tension of materials indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: surface tension tensor with shape (M, )\n ", "snippet": "surface_tensions = particle_material_view.get_surface_tensions(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_viscosities", "description": "Gets the viscosity of materials indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: viscosity tensor with shape (M, )\n ", "snippet": "viscosities = particle_material_view.get_viscosities(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_vorticity_confinements", "description": "Gets the vorticity confinement of materials indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: vorticity confinement tensor with shape (M, )\n ", "snippet": "vorticity_confinements = particle_material_view.get_vorticity_confinements(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "initialize", "description": "Create a physics simulation view if not passed and creates a rigid body view in physX.\n\n Args:\n physics_sim_view (omni.physics.tensors.SimulationView, optional): current physics simulation view. Defaults to None.\n ", "snippet": "particle_material_view.initialize(physics_sim_view=None) # omni.physics.tensors.bindings._physicsTensors.SimulationView\n" }, { "title": "is_physics_handle_valid", "description": " Returns:\n bool: True if the physics handle of the view is valid (i.e physics is initialized for the view). Otherwise False.\n ", "snippet": "particle_material_view.is_physics_handle_valid()\n" }, { "title": "is_valid", "description": " Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n bool: True if all prim paths specified in the view correspond to a valid prim in stage. False otherwise.\n ", "snippet": "particle_material_view.is_valid(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "post_reset", "description": "Resets the particles to their initial states.\n ", "snippet": "particle_material_view.post_reset()\n" }, { "title": "set_adhesion_offset_scales", "description": "Sets the adhesion offset scale for the material prims indicated by the indices.\n\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]], optional): material adhesion offset scale tensor with the shape (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "particle_material_view.set_adhesion_offset_scales(values=values, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_adhesions", "description": "Sets the particle adhesion for the material prims indicated by the indices.\n\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]], optional): material particle adhesion scale tensor with the shape (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "particle_material_view.set_adhesions(values=values, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_cohesions", "description": "Sets the particle cohesion for the material prims indicated by the indices.\n\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]], optional): material particle cohesion scale tensor with the shape (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "particle_material_view.set_cohesions(values=values, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_dampings", "description": "Sets the dampings for the material prims indicated by the indices.\n\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]], optional): material damping tensor with the shape (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "particle_material_view.set_dampings(values=values, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_drags", "description": "Sets the drags for the material prims indicated by the indices.\n\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]], optional): material drag tensor with the shape (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "particle_material_view.set_drags(values=values, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_frictions", "description": "Sets the friction for the material prims indicated by the indices.\n\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]], optional): material friction tensor with the shape (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "particle_material_view.set_frictions(values=values, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_gravity_scales", "description": "Sets the gravity scale for the material prims indicated by the indices.\n\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]], optional): material gravity scale tensor with the shape (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "particle_material_view.set_gravity_scales(values=values, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_lifts", "description": "Sets the lifts for the material prims indicated by the indices.\n\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]], optional): material lift tensor with the shape (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "particle_material_view.set_lifts(values=values, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_particle_adhesion_scales", "description": "Sets the particle adhesion for the material prims indicated by the indices.\n\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]], optional): material particle adhesion scale tensor with the shape (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "particle_material_view.set_particle_adhesion_scales(values=values, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_particle_friction_scales", "description": "Sets the particle friction scale for the material prims indicated by the indices.\n\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]], optional): material particle friction scale tensor with the shape (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "particle_material_view.set_particle_friction_scales(values=values, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_surface_tensions", "description": "Sets the particle surface tension for the material prims indicated by the indices.\n\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]], optional): material particle surface tension scale tensor with the shape (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "particle_material_view.set_surface_tensions(values=values, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_viscosities", "description": "Sets the particle viscosity for the material prims indicated by the indices.\n\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]], optional): material particle viscosity scale tensor with the shape (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "particle_material_view.set_viscosities(values=values, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_vorticity_confinements", "description": "Sets the vorticity confinement for the material prims indicated by the indices.\n\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]], optional): material particle vorticity confinement scale tensor with the shape (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which material prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "particle_material_view.set_vorticity_confinements(values=values, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" } ] }, { "title": "PhysicsMaterial", "snippets": [ { "title": "PhysicsMaterial", "description": "[summary]\n\n Args:\n prim_path (str): [description]\n name (str, optional): [description]. Defaults to \"physics_material\".\n static_friction (Optional[float], optional): [description]. Defaults to None.\n dynamic_friction (Optional[float], optional): [description]. Defaults to None.\n restitution (Optional[float], optional): [description]. Defaults to None.\n ", "snippet": "physics_material = PhysicsMaterial(prim_path=prim_path, # str\n name=\"physics_material\", # str\n static_friction=None, # typing.Union[float, NoneType]\n dynamic_friction=None, # typing.Union[float, NoneType]\n restitution=None) # typing.Union[float, NoneType]\n" }, { "title": "get_dynamic_friction", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "dynamic_friction = physics_material.get_dynamic_friction()\n" }, { "title": "get_restitution", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "restitution = physics_material.get_restitution()\n" }, { "title": "get_static_friction", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "static_friction = physics_material.get_static_friction()\n" }, { "title": "set_dynamic_friction", "description": "[summary]\n\n Args:\n friction (float): [description]\n ", "snippet": "physics_material.set_dynamic_friction(friction=friction) # float\n" }, { "title": "set_restitution", "description": "[summary]\n\n Args:\n restitution (float): [description]\n ", "snippet": "physics_material.set_restitution(restitution=restitution) # float\n" }, { "title": "set_static_friction", "description": "[summary]\n\n Args:\n friction (float): [description]\n ", "snippet": "physics_material.set_static_friction(friction=friction) # float\n" } ] }, { "title": "PreviewSurface", "snippets": [ { "title": "PreviewSurface", "description": "[summary]\n\n Args:\n prim_path (str): [description]\n name (str, optional): [description]. Defaults to \"preview_surface\".\n shader (Optional[UsdShade.Shader], optional): [description]. Defaults to None.\n color (Optional[np.ndarray], optional): [description]. Defaults to None.\n roughness (Optional[float], optional): [description]. Defaults to None.\n metallic (Optional[float], optional): [description]. Defaults to None.\n ", "snippet": "preview_surface = PreviewSurface(prim_path=prim_path, # str\n name=\"preview_surface\", # str\n shader=None, # typing.Union[pxr.UsdShade.Shader, NoneType]\n color=None, # typing.Union[numpy.ndarray, NoneType]\n roughness=None, # typing.Union[float, NoneType]\n metallic=None) # typing.Union[float, NoneType]\n" }, { "title": "get_color", "description": "[summary]\n\n Returns:\n np.ndarray: [description]\n ", "snippet": "color = preview_surface.get_color()\n" }, { "title": "get_metallic", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "metallic = preview_surface.get_metallic()\n" }, { "title": "get_roughness", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "roughness = preview_surface.get_roughness()\n" }, { "title": "set_color", "description": "[summary]\n\n Args:\n color (np.ndarray): [description]\n ", "snippet": "preview_surface.set_color(color=color) # numpy.ndarray\n" }, { "title": "set_metallic", "description": "[summary]\n\n Args:\n metallic (float): [description]\n ", "snippet": "preview_surface.set_metallic(metallic=metallic) # float\n" }, { "title": "set_roughness", "description": "[summary]\n\n Args:\n roughness (float): [description]\n ", "snippet": "preview_surface.set_roughness(roughness=roughness) # float\n" } ] }, { "title": "VisualMaterial", "snippets": [ { "title": "VisualMaterial", "description": "[summary]\n\n Args:\n name (str): [description]\n prim_path (str): [description]\n prim (Usd.Prim): [description]\n shaders_list (list[UsdShade.Shader]): [description]\n material (UsdShade.Material): [description]\n ", "snippet": "visual_material = VisualMaterial(name=name, # str\n prim_path=prim_path, # str\n prim=prim, # pxr.Usd.Prim\n shaders_list=shaders_list, # typing.List[pxr.UsdShade.Shader]\n material=material) # pxr.UsdShade.Material\n" } ] } ] }, { "title": "Objects", "snippets": [ { "title": "DynamicCapsule", "snippets": [ { "title": "DynamicCapsule", "description": "_summary_\n\n Args:\n prim_path (str): _description_\n name (str, optional): _description_. Defaults to \"dynamic_capsule\".\n position (Optional[np.ndarray], optional): _description_. Defaults to None.\n translation (Optional[np.ndarray], optional): _description_. Defaults to None.\n orientation (Optional[np.ndarray], optional): _description_. Defaults to None.\n scale (Optional[np.ndarray], optional): _description_. Defaults to None.\n visible (Optional[bool], optional): _description_. Defaults to None.\n color (Optional[np.ndarray], optional): _description_. Defaults to None.\n radius (Optional[np.ndarray], optional): _description_. Defaults to None.\n height (Optional[np.ndarray], optional): _description_. Defaults to None.\n visual_material (Optional[VisualMaterial], optional): _description_. Defaults to None.\n physics_material (Optional[PhysicsMaterial], optional): _description_. Defaults to None.\n mass (Optional[float], optional): _description_. Defaults to None.\n density (Optional[float], optional): _description_. Defaults to None.\n linear_velocity (Optional[Sequence[float]], optional): _description_. Defaults to None.\n angular_velocity (Optional[Sequence[float]], optional): _description_. Defaults to None.\n ", "snippet": "dynamic_capsule = DynamicCapsule(prim_path=prim_path, # str\n name=\"dynamic_capsule\", # str\n position=None, # typing.Union[numpy.ndarray, NoneType]\n translation=None, # typing.Union[numpy.ndarray, NoneType]\n orientation=None, # typing.Union[numpy.ndarray, NoneType]\n scale=None, # typing.Union[numpy.ndarray, NoneType]\n visible=None, # typing.Union[bool, NoneType]\n color=None, # typing.Union[numpy.ndarray, NoneType]\n radius=None, # typing.Union[numpy.ndarray, NoneType]\n height=None, # typing.Union[numpy.ndarray, NoneType]\n visual_material=None, # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, NoneType]\n physics_material=None, # typing.Union[omni.isaac.core.materials.physics_material.PhysicsMaterial, NoneType]\n mass=None, # typing.Union[float, NoneType]\n density=None, # typing.Union[float, NoneType]\n linear_velocity=None, # typing.Union[typing.Sequence[float], NoneType]\n angular_velocity=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "disable_rigid_body_physics", "description": " disable rigid body physics (enabled by default):\n Object will not be moved by external forces such as gravity and collisions\n ", "snippet": "dynamic_capsule.disable_rigid_body_physics()\n" }, { "title": "enable_rigid_body_physics", "description": " enable rigid body physics (enabled by default):\n Object will be moved by external forces such as gravity and collisions\n ", "snippet": "dynamic_capsule.enable_rigid_body_physics()\n" }, { "title": "get_angular_velocity", "description": " Returns:\n np.ndarray: current angular velocity of the the rigid prim. Shape (3,).\n ", "snippet": "angular_velocity = dynamic_capsule.get_angular_velocity()\n" }, { "title": "get_current_dynamic_state", "description": " \n Returns:\n DynamicState: the dynamic state of the rigid body including position, orientation, linear_velocity and angular_velocity.\n ", "snippet": "current_dynamic_state = dynamic_capsule.get_current_dynamic_state()\n" }, { "title": "get_default_state", "description": " Returns:\n DynamicState: returns the default state of the prim (position, orientation, linear_velocity and \n angular_velocity) that is used after each reset.\n ", "snippet": "default_state = dynamic_capsule.get_default_state()\n" }, { "title": "get_density", "description": " Returns:\n float: density of the rigid body.\n ", "snippet": "density = dynamic_capsule.get_density()\n" }, { "title": "get_linear_velocity", "description": " Returns:\n np.ndarray: current linear velocity of the the rigid prim. Shape (3,).\n ", "snippet": "linear_velocity = dynamic_capsule.get_linear_velocity()\n" }, { "title": "get_mass", "description": " Returns:\n float: mass of the rigid body in kg.\n ", "snippet": "mass = dynamic_capsule.get_mass()\n" }, { "title": "get_sleep_threshold", "description": " Returns:\n float: Mass-normalized kinetic energy threshold below which \n an actor may go to sleep. Range: [0, inf)\n Defaults: 0.00005 * tolerancesSpeed* tolerancesSpeed\n Units: distance^2 / second^2.\n ", "snippet": "sleep_threshold = dynamic_capsule.get_sleep_threshold()\n" }, { "title": "set_angular_velocity", "description": "Sets the angular velocity of the prim in stage.\n Args:\n velocity (np.ndarray): angular velocity to set the rigid prim to. Shape (3,).\n ", "snippet": "dynamic_capsule.set_angular_velocity(velocity=velocity) # numpy.ndarray\n" }, { "title": "set_default_state", "description": " Sets the default state of the prim, that will be used after each reset. \n \n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n linear_velocity (np.ndarray): linear velocity to set the rigid prim to. Shape (3,).\n angular_velocity (np.ndarray): angular velocity to set the rigid prim to. Shape (3,).\n ", "snippet": "dynamic_capsule.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None, # typing.Union[typing.Sequence[float], NoneType]\n linear_velocity=None, # typing.Union[numpy.ndarray, NoneType]\n angular_velocity=None) # typing.Union[numpy.ndarray, NoneType]\n" }, { "title": "set_density", "description": " Args:\n mass (float): density of the rigid body.\n ", "snippet": "dynamic_capsule.set_density(density=density) # float\n" }, { "title": "set_linear_velocity", "description": "Sets the linear velocity of the prim in stage.\n Args:\n velocity (np.ndarray): linear velocity to set the rigid prim to. Shape (3,).\n ", "snippet": "dynamic_capsule.set_linear_velocity(velocity=velocity) # numpy.ndarray\n" }, { "title": "set_mass", "description": " Args:\n mass (float): mass of the rigid body in kg.\n ", "snippet": "dynamic_capsule.set_mass(mass=mass) # float\n" }, { "title": "set_sleep_threshold", "description": " Args:\n threshold (float): Mass-normalized kinetic energy threshold below which \n an actor may go to sleep. Range: [0, inf)\n Defaults: 0.00005 * tolerancesSpeed* tolerancesSpeed\n Units: distance^2 / second^2.\n ", "snippet": "dynamic_capsule.set_sleep_threshold(threshold=threshold) # float\n" }, { "title": "get_height", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "height = dynamic_capsule.get_height()\n" }, { "title": "get_radius", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "radius = dynamic_capsule.get_radius()\n" }, { "title": "set_height", "description": "[summary]\n\n Args:\n height (float): [description]\n ", "snippet": "dynamic_capsule.set_height(height=height) # float\n" }, { "title": "set_radius", "description": "[summary]\n\n Args:\n radius (float): [description]\n ", "snippet": "dynamic_capsule.set_radius(radius=radius) # float\n" }, { "title": "apply_physics_material", "description": "Used to apply physics material to the held prim and optionally its descendants.\n\n Args:\n physics_material (PhysicsMaterial): physics material to be applied to the held prim. This where you want to\n define friction, restitution..etc. Note: if a physics material is not\n defined, the defaults will be used from PhysX.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants\n materials, otherwise False. Defaults to False.\n ", "snippet": "dynamic_capsule.apply_physics_material(physics_material=physics_material, # omni.isaac.core.materials.physics_material.PhysicsMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_physics_material", "description": "Returns the current applied physics material in case it was applied using apply_physics_material or not.\n\n Returns:\n PhysicsMaterial: the current applied physics material.\n ", "snippet": "applied_physics_material = dynamic_capsule.get_applied_physics_material()\n" }, { "title": "get_collision_approximation", "description": " Returns:\n str: approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "collision_approximation = dynamic_capsule.get_collision_approximation()\n" }, { "title": "get_collision_enabled", "description": " Returns:\n ", "snippet": "collision_enabled = dynamic_capsule.get_collision_enabled()\n" }, { "title": "get_contact_force_matrix", "description": " If the object is initialized with filter_paths_expr list, this method returns the contact forces between the prims \n in the view and the filter prims. i.e., a matrix of dimension (self._contact_view.num_filters, 3) \n where num_filters is the determined according to the filter_paths_expr parameter.\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (self._geometry_prim_view._contact_view.num_filters, 3).\n ", "snippet": "contact_force_matrix = dynamic_capsule.get_contact_force_matrix(dt=1.0) # float\n" }, { "title": "get_contact_offset", "description": " Returns:\n float: contact offset of the collision shape.\n ", "snippet": "contact_offset = dynamic_capsule.get_contact_offset()\n" }, { "title": "get_min_torsional_patch_radius", "description": " Returns:\n float: minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "min_torsional_patch_radius = dynamic_capsule.get_min_torsional_patch_radius()\n" }, { "title": "get_net_contact_forces", "description": " If contact forces of the prims in the view are tracked, this method returns the net contact forces on prims. \n i.e., a matrix of dimension (1, 3)\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (3).\n\n ", "snippet": "net_contact_forces = dynamic_capsule.get_net_contact_forces(dt=1.0) # float\n" }, { "title": "get_rest_offset", "description": " Returns:\n float: rest offset of the collision shape.\n ", "snippet": "rest_offset = dynamic_capsule.get_rest_offset()\n" }, { "title": "get_torsional_patch_radius", "description": " Returns:\n float: radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "torsional_patch_radius = dynamic_capsule.get_torsional_patch_radius()\n" }, { "title": "set_collision_approximation", "description": "\n Args:\n approximation_type (str): approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "dynamic_capsule.set_collision_approximation(approximation_type=approximation_type) # str\n" }, { "title": "set_collision_enabled", "description": "\n Args:\n ", "snippet": "dynamic_capsule.set_collision_enabled(enabled=enabled) # bool\n" }, { "title": "set_contact_offset", "description": " Args:\n offset (float): Contact offset of a collision shape. Allowed range [maximum(0, rest_offset), 0].\n Default value is -inf, means default is picked by simulation based on the shape extent.\n ", "snippet": "dynamic_capsule.set_contact_offset(offset=offset) # float\n" }, { "title": "set_min_torsional_patch_radius", "description": " Args:\n radius (float): minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "dynamic_capsule.set_min_torsional_patch_radius(radius=radius) # float\n" }, { "title": "set_rest_offset", "description": " Args:\n offset (float): Rest offset of a collision shape. Allowed range [-max_float, contact_offset.\n Default value is -inf, means default is picked by simulatiion. For rigid bodies its zero.\n ", "snippet": "dynamic_capsule.set_rest_offset(offset=offset) # float\n" }, { "title": "set_torsional_patch_radius", "description": " Args:\n radius (float): radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "dynamic_capsule.set_torsional_patch_radius(radius=radius) # float\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "dynamic_capsule.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = dynamic_capsule.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = dynamic_capsule.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = dynamic_capsule.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = dynamic_capsule.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = dynamic_capsule.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = dynamic_capsule.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = dynamic_capsule.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "dynamic_capsule.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "dynamic_capsule.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "dynamic_capsule.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "dynamic_capsule.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "dynamic_capsule.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "dynamic_capsule.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "dynamic_capsule.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "dynamic_capsule.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "dynamic_capsule.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "DynamicCone", "snippets": [ { "title": "DynamicCone", "description": "_summary_\n\n Args:\n prim_path (str): _description_\n name (str, optional): _description_. Defaults to \"dynamic_cone\".\n position (Optional[np.ndarray], optional): _description_. Defaults to None.\n translation (Optional[np.ndarray], optional): _description_. Defaults to None.\n orientation (Optional[np.ndarray], optional): _description_. Defaults to None.\n scale (Optional[np.ndarray], optional): _description_. Defaults to None.\n visible (Optional[bool], optional): _description_. Defaults to None.\n color (Optional[np.ndarray], optional): _description_. Defaults to None.\n radius (Optional[np.ndarray], optional): _description_. Defaults to None.\n height (Optional[np.ndarray], optional): _description_. Defaults to None.\n visual_material (Optional[VisualMaterial], optional): _description_. Defaults to None.\n physics_material (Optional[PhysicsMaterial], optional): _description_. Defaults to None.\n mass (Optional[float], optional): _description_. Defaults to None.\n density (Optional[float], optional): _description_. Defaults to None.\n linear_velocity (Optional[Sequence[float]], optional): _description_. Defaults to None.\n angular_velocity (Optional[Sequence[float]], optional): _description_. Defaults to None.\n ", "snippet": "dynamic_cone = DynamicCone(prim_path=prim_path, # str\n name=\"dynamic_cone\", # str\n position=None, # typing.Union[numpy.ndarray, NoneType]\n translation=None, # typing.Union[numpy.ndarray, NoneType]\n orientation=None, # typing.Union[numpy.ndarray, NoneType]\n scale=None, # typing.Union[numpy.ndarray, NoneType]\n visible=None, # typing.Union[bool, NoneType]\n color=None, # typing.Union[numpy.ndarray, NoneType]\n radius=None, # typing.Union[numpy.ndarray, NoneType]\n height=None, # typing.Union[numpy.ndarray, NoneType]\n visual_material=None, # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, NoneType]\n physics_material=None, # typing.Union[omni.isaac.core.materials.physics_material.PhysicsMaterial, NoneType]\n mass=None, # typing.Union[float, NoneType]\n density=None, # typing.Union[float, NoneType]\n linear_velocity=None, # typing.Union[typing.Sequence[float], NoneType]\n angular_velocity=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "disable_rigid_body_physics", "description": " disable rigid body physics (enabled by default):\n Object will not be moved by external forces such as gravity and collisions\n ", "snippet": "dynamic_cone.disable_rigid_body_physics()\n" }, { "title": "enable_rigid_body_physics", "description": " enable rigid body physics (enabled by default):\n Object will be moved by external forces such as gravity and collisions\n ", "snippet": "dynamic_cone.enable_rigid_body_physics()\n" }, { "title": "get_angular_velocity", "description": " Returns:\n np.ndarray: current angular velocity of the the rigid prim. Shape (3,).\n ", "snippet": "angular_velocity = dynamic_cone.get_angular_velocity()\n" }, { "title": "get_current_dynamic_state", "description": " \n Returns:\n DynamicState: the dynamic state of the rigid body including position, orientation, linear_velocity and angular_velocity.\n ", "snippet": "current_dynamic_state = dynamic_cone.get_current_dynamic_state()\n" }, { "title": "get_default_state", "description": " Returns:\n DynamicState: returns the default state of the prim (position, orientation, linear_velocity and \n angular_velocity) that is used after each reset.\n ", "snippet": "default_state = dynamic_cone.get_default_state()\n" }, { "title": "get_density", "description": " Returns:\n float: density of the rigid body.\n ", "snippet": "density = dynamic_cone.get_density()\n" }, { "title": "get_linear_velocity", "description": " Returns:\n np.ndarray: current linear velocity of the the rigid prim. Shape (3,).\n ", "snippet": "linear_velocity = dynamic_cone.get_linear_velocity()\n" }, { "title": "get_mass", "description": " Returns:\n float: mass of the rigid body in kg.\n ", "snippet": "mass = dynamic_cone.get_mass()\n" }, { "title": "get_sleep_threshold", "description": " Returns:\n float: Mass-normalized kinetic energy threshold below which \n an actor may go to sleep. Range: [0, inf)\n Defaults: 0.00005 * tolerancesSpeed* tolerancesSpeed\n Units: distance^2 / second^2.\n ", "snippet": "sleep_threshold = dynamic_cone.get_sleep_threshold()\n" }, { "title": "set_angular_velocity", "description": "Sets the angular velocity of the prim in stage.\n Args:\n velocity (np.ndarray): angular velocity to set the rigid prim to. Shape (3,).\n ", "snippet": "dynamic_cone.set_angular_velocity(velocity=velocity) # numpy.ndarray\n" }, { "title": "set_default_state", "description": " Sets the default state of the prim, that will be used after each reset. \n \n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n linear_velocity (np.ndarray): linear velocity to set the rigid prim to. Shape (3,).\n angular_velocity (np.ndarray): angular velocity to set the rigid prim to. Shape (3,).\n ", "snippet": "dynamic_cone.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None, # typing.Union[typing.Sequence[float], NoneType]\n linear_velocity=None, # typing.Union[numpy.ndarray, NoneType]\n angular_velocity=None) # typing.Union[numpy.ndarray, NoneType]\n" }, { "title": "set_density", "description": " Args:\n mass (float): density of the rigid body.\n ", "snippet": "dynamic_cone.set_density(density=density) # float\n" }, { "title": "set_linear_velocity", "description": "Sets the linear velocity of the prim in stage.\n Args:\n velocity (np.ndarray): linear velocity to set the rigid prim to. Shape (3,).\n ", "snippet": "dynamic_cone.set_linear_velocity(velocity=velocity) # numpy.ndarray\n" }, { "title": "set_mass", "description": " Args:\n mass (float): mass of the rigid body in kg.\n ", "snippet": "dynamic_cone.set_mass(mass=mass) # float\n" }, { "title": "set_sleep_threshold", "description": " Args:\n threshold (float): Mass-normalized kinetic energy threshold below which \n an actor may go to sleep. Range: [0, inf)\n Defaults: 0.00005 * tolerancesSpeed* tolerancesSpeed\n Units: distance^2 / second^2.\n ", "snippet": "dynamic_cone.set_sleep_threshold(threshold=threshold) # float\n" }, { "title": "get_height", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "height = dynamic_cone.get_height()\n" }, { "title": "get_radius", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "radius = dynamic_cone.get_radius()\n" }, { "title": "set_height", "description": "[summary]\n\n Args:\n height (float): [description]\n ", "snippet": "dynamic_cone.set_height(height=height) # float\n" }, { "title": "set_radius", "description": "[summary]\n\n Args:\n radius (float): [description]\n ", "snippet": "dynamic_cone.set_radius(radius=radius) # float\n" }, { "title": "apply_physics_material", "description": "Used to apply physics material to the held prim and optionally its descendants.\n\n Args:\n physics_material (PhysicsMaterial): physics material to be applied to the held prim. This where you want to\n define friction, restitution..etc. Note: if a physics material is not\n defined, the defaults will be used from PhysX.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants\n materials, otherwise False. Defaults to False.\n ", "snippet": "dynamic_cone.apply_physics_material(physics_material=physics_material, # omni.isaac.core.materials.physics_material.PhysicsMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_physics_material", "description": "Returns the current applied physics material in case it was applied using apply_physics_material or not.\n\n Returns:\n PhysicsMaterial: the current applied physics material.\n ", "snippet": "applied_physics_material = dynamic_cone.get_applied_physics_material()\n" }, { "title": "get_collision_approximation", "description": " Returns:\n str: approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "collision_approximation = dynamic_cone.get_collision_approximation()\n" }, { "title": "get_collision_enabled", "description": " Returns:\n ", "snippet": "collision_enabled = dynamic_cone.get_collision_enabled()\n" }, { "title": "get_contact_force_matrix", "description": " If the object is initialized with filter_paths_expr list, this method returns the contact forces between the prims \n in the view and the filter prims. i.e., a matrix of dimension (self._contact_view.num_filters, 3) \n where num_filters is the determined according to the filter_paths_expr parameter.\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (self._geometry_prim_view._contact_view.num_filters, 3).\n ", "snippet": "contact_force_matrix = dynamic_cone.get_contact_force_matrix(dt=1.0) # float\n" }, { "title": "get_contact_offset", "description": " Returns:\n float: contact offset of the collision shape.\n ", "snippet": "contact_offset = dynamic_cone.get_contact_offset()\n" }, { "title": "get_min_torsional_patch_radius", "description": " Returns:\n float: minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "min_torsional_patch_radius = dynamic_cone.get_min_torsional_patch_radius()\n" }, { "title": "get_net_contact_forces", "description": " If contact forces of the prims in the view are tracked, this method returns the net contact forces on prims. \n i.e., a matrix of dimension (1, 3)\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (3).\n\n ", "snippet": "net_contact_forces = dynamic_cone.get_net_contact_forces(dt=1.0) # float\n" }, { "title": "get_rest_offset", "description": " Returns:\n float: rest offset of the collision shape.\n ", "snippet": "rest_offset = dynamic_cone.get_rest_offset()\n" }, { "title": "get_torsional_patch_radius", "description": " Returns:\n float: radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "torsional_patch_radius = dynamic_cone.get_torsional_patch_radius()\n" }, { "title": "set_collision_approximation", "description": "\n Args:\n approximation_type (str): approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "dynamic_cone.set_collision_approximation(approximation_type=approximation_type) # str\n" }, { "title": "set_collision_enabled", "description": "\n Args:\n ", "snippet": "dynamic_cone.set_collision_enabled(enabled=enabled) # bool\n" }, { "title": "set_contact_offset", "description": " Args:\n offset (float): Contact offset of a collision shape. Allowed range [maximum(0, rest_offset), 0].\n Default value is -inf, means default is picked by simulation based on the shape extent.\n ", "snippet": "dynamic_cone.set_contact_offset(offset=offset) # float\n" }, { "title": "set_min_torsional_patch_radius", "description": " Args:\n radius (float): minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "dynamic_cone.set_min_torsional_patch_radius(radius=radius) # float\n" }, { "title": "set_rest_offset", "description": " Args:\n offset (float): Rest offset of a collision shape. Allowed range [-max_float, contact_offset.\n Default value is -inf, means default is picked by simulatiion. For rigid bodies its zero.\n ", "snippet": "dynamic_cone.set_rest_offset(offset=offset) # float\n" }, { "title": "set_torsional_patch_radius", "description": " Args:\n radius (float): radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "dynamic_cone.set_torsional_patch_radius(radius=radius) # float\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "dynamic_cone.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = dynamic_cone.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = dynamic_cone.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = dynamic_cone.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = dynamic_cone.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = dynamic_cone.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = dynamic_cone.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = dynamic_cone.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "dynamic_cone.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "dynamic_cone.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "dynamic_cone.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "dynamic_cone.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "dynamic_cone.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "dynamic_cone.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "dynamic_cone.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "dynamic_cone.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "dynamic_cone.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "DynamicCuboid", "snippets": [ { "title": "DynamicCuboid", "description": "_summary_\n\n Args:\n prim_path (str): _description_\n name (str, optional): _description_. Defaults to \"dynamic_cube\".\n position (Optional[np.ndarray], optional): _description_. Defaults to None.\n translation (Optional[np.ndarray], optional): _description_. Defaults to None.\n orientation (Optional[np.ndarray], optional): _description_. Defaults to None.\n scale (Optional[np.ndarray], optional): _description_. Defaults to None.\n visible (Optional[bool], optional): _description_. Defaults to None.\n color (Optional[np.ndarray], optional): _description_. Defaults to None.\n size (Optional[float], optional): _description_. Defaults to None.\n visual_material (Optional[VisualMaterial], optional): _description_. Defaults to None.\n physics_material (Optional[PhysicsMaterial], optional): _description_. Defaults to None.\n mass (Optional[float], optional): _description_. Defaults to None.\n density (Optional[float], optional): _description_. Defaults to None.\n linear_velocity (Optional[Sequence[float]], optional): _description_. Defaults to None.\n angular_velocity (Optional[Sequence[float]], optional): _description_. Defaults to None.\n ", "snippet": "dynamic_cuboid = DynamicCuboid(prim_path=prim_path, # str\n name=\"dynamic_cube\", # str\n position=None, # typing.Union[numpy.ndarray, NoneType]\n translation=None, # typing.Union[numpy.ndarray, NoneType]\n orientation=None, # typing.Union[numpy.ndarray, NoneType]\n scale=None, # typing.Union[numpy.ndarray, NoneType]\n visible=None, # typing.Union[bool, NoneType]\n color=None, # typing.Union[numpy.ndarray, NoneType]\n size=None, # typing.Union[float, NoneType]\n visual_material=None, # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, NoneType]\n physics_material=None, # typing.Union[omni.isaac.core.materials.physics_material.PhysicsMaterial, NoneType]\n mass=None, # typing.Union[float, NoneType]\n density=None, # typing.Union[float, NoneType]\n linear_velocity=None, # typing.Union[typing.Sequence[float], NoneType]\n angular_velocity=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "disable_rigid_body_physics", "description": " disable rigid body physics (enabled by default):\n Object will not be moved by external forces such as gravity and collisions\n ", "snippet": "dynamic_cuboid.disable_rigid_body_physics()\n" }, { "title": "enable_rigid_body_physics", "description": " enable rigid body physics (enabled by default):\n Object will be moved by external forces such as gravity and collisions\n ", "snippet": "dynamic_cuboid.enable_rigid_body_physics()\n" }, { "title": "get_angular_velocity", "description": " Returns:\n np.ndarray: current angular velocity of the the rigid prim. Shape (3,).\n ", "snippet": "angular_velocity = dynamic_cuboid.get_angular_velocity()\n" }, { "title": "get_current_dynamic_state", "description": " \n Returns:\n DynamicState: the dynamic state of the rigid body including position, orientation, linear_velocity and angular_velocity.\n ", "snippet": "current_dynamic_state = dynamic_cuboid.get_current_dynamic_state()\n" }, { "title": "get_default_state", "description": " Returns:\n DynamicState: returns the default state of the prim (position, orientation, linear_velocity and \n angular_velocity) that is used after each reset.\n ", "snippet": "default_state = dynamic_cuboid.get_default_state()\n" }, { "title": "get_density", "description": " Returns:\n float: density of the rigid body.\n ", "snippet": "density = dynamic_cuboid.get_density()\n" }, { "title": "get_linear_velocity", "description": " Returns:\n np.ndarray: current linear velocity of the the rigid prim. Shape (3,).\n ", "snippet": "linear_velocity = dynamic_cuboid.get_linear_velocity()\n" }, { "title": "get_mass", "description": " Returns:\n float: mass of the rigid body in kg.\n ", "snippet": "mass = dynamic_cuboid.get_mass()\n" }, { "title": "get_sleep_threshold", "description": " Returns:\n float: Mass-normalized kinetic energy threshold below which \n an actor may go to sleep. Range: [0, inf)\n Defaults: 0.00005 * tolerancesSpeed* tolerancesSpeed\n Units: distance^2 / second^2.\n ", "snippet": "sleep_threshold = dynamic_cuboid.get_sleep_threshold()\n" }, { "title": "set_angular_velocity", "description": "Sets the angular velocity of the prim in stage.\n Args:\n velocity (np.ndarray): angular velocity to set the rigid prim to. Shape (3,).\n ", "snippet": "dynamic_cuboid.set_angular_velocity(velocity=velocity) # numpy.ndarray\n" }, { "title": "set_default_state", "description": " Sets the default state of the prim, that will be used after each reset. \n \n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n linear_velocity (np.ndarray): linear velocity to set the rigid prim to. Shape (3,).\n angular_velocity (np.ndarray): angular velocity to set the rigid prim to. Shape (3,).\n ", "snippet": "dynamic_cuboid.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None, # typing.Union[typing.Sequence[float], NoneType]\n linear_velocity=None, # typing.Union[numpy.ndarray, NoneType]\n angular_velocity=None) # typing.Union[numpy.ndarray, NoneType]\n" }, { "title": "set_density", "description": " Args:\n mass (float): density of the rigid body.\n ", "snippet": "dynamic_cuboid.set_density(density=density) # float\n" }, { "title": "set_linear_velocity", "description": "Sets the linear velocity of the prim in stage.\n Args:\n velocity (np.ndarray): linear velocity to set the rigid prim to. Shape (3,).\n ", "snippet": "dynamic_cuboid.set_linear_velocity(velocity=velocity) # numpy.ndarray\n" }, { "title": "set_mass", "description": " Args:\n mass (float): mass of the rigid body in kg.\n ", "snippet": "dynamic_cuboid.set_mass(mass=mass) # float\n" }, { "title": "set_sleep_threshold", "description": " Args:\n threshold (float): Mass-normalized kinetic energy threshold below which \n an actor may go to sleep. Range: [0, inf)\n Defaults: 0.00005 * tolerancesSpeed* tolerancesSpeed\n Units: distance^2 / second^2.\n ", "snippet": "dynamic_cuboid.set_sleep_threshold(threshold=threshold) # float\n" }, { "title": "get_size", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "size = dynamic_cuboid.get_size()\n" }, { "title": "set_size", "description": "[summary]\n\n Args:\n size (float): [description]\n ", "snippet": "dynamic_cuboid.set_size(size=size) # float\n" }, { "title": "apply_physics_material", "description": "Used to apply physics material to the held prim and optionally its descendants.\n\n Args:\n physics_material (PhysicsMaterial): physics material to be applied to the held prim. This where you want to\n define friction, restitution..etc. Note: if a physics material is not\n defined, the defaults will be used from PhysX.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants\n materials, otherwise False. Defaults to False.\n ", "snippet": "dynamic_cuboid.apply_physics_material(physics_material=physics_material, # omni.isaac.core.materials.physics_material.PhysicsMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_physics_material", "description": "Returns the current applied physics material in case it was applied using apply_physics_material or not.\n\n Returns:\n PhysicsMaterial: the current applied physics material.\n ", "snippet": "applied_physics_material = dynamic_cuboid.get_applied_physics_material()\n" }, { "title": "get_collision_approximation", "description": " Returns:\n str: approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "collision_approximation = dynamic_cuboid.get_collision_approximation()\n" }, { "title": "get_collision_enabled", "description": " Returns:\n ", "snippet": "collision_enabled = dynamic_cuboid.get_collision_enabled()\n" }, { "title": "get_contact_force_matrix", "description": " If the object is initialized with filter_paths_expr list, this method returns the contact forces between the prims \n in the view and the filter prims. i.e., a matrix of dimension (self._contact_view.num_filters, 3) \n where num_filters is the determined according to the filter_paths_expr parameter.\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (self._geometry_prim_view._contact_view.num_filters, 3).\n ", "snippet": "contact_force_matrix = dynamic_cuboid.get_contact_force_matrix(dt=1.0) # float\n" }, { "title": "get_contact_offset", "description": " Returns:\n float: contact offset of the collision shape.\n ", "snippet": "contact_offset = dynamic_cuboid.get_contact_offset()\n" }, { "title": "get_min_torsional_patch_radius", "description": " Returns:\n float: minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "min_torsional_patch_radius = dynamic_cuboid.get_min_torsional_patch_radius()\n" }, { "title": "get_net_contact_forces", "description": " If contact forces of the prims in the view are tracked, this method returns the net contact forces on prims. \n i.e., a matrix of dimension (1, 3)\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (3).\n\n ", "snippet": "net_contact_forces = dynamic_cuboid.get_net_contact_forces(dt=1.0) # float\n" }, { "title": "get_rest_offset", "description": " Returns:\n float: rest offset of the collision shape.\n ", "snippet": "rest_offset = dynamic_cuboid.get_rest_offset()\n" }, { "title": "get_torsional_patch_radius", "description": " Returns:\n float: radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "torsional_patch_radius = dynamic_cuboid.get_torsional_patch_radius()\n" }, { "title": "set_collision_approximation", "description": "\n Args:\n approximation_type (str): approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "dynamic_cuboid.set_collision_approximation(approximation_type=approximation_type) # str\n" }, { "title": "set_collision_enabled", "description": "\n Args:\n ", "snippet": "dynamic_cuboid.set_collision_enabled(enabled=enabled) # bool\n" }, { "title": "set_contact_offset", "description": " Args:\n offset (float): Contact offset of a collision shape. Allowed range [maximum(0, rest_offset), 0].\n Default value is -inf, means default is picked by simulation based on the shape extent.\n ", "snippet": "dynamic_cuboid.set_contact_offset(offset=offset) # float\n" }, { "title": "set_min_torsional_patch_radius", "description": " Args:\n radius (float): minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "dynamic_cuboid.set_min_torsional_patch_radius(radius=radius) # float\n" }, { "title": "set_rest_offset", "description": " Args:\n offset (float): Rest offset of a collision shape. Allowed range [-max_float, contact_offset.\n Default value is -inf, means default is picked by simulatiion. For rigid bodies its zero.\n ", "snippet": "dynamic_cuboid.set_rest_offset(offset=offset) # float\n" }, { "title": "set_torsional_patch_radius", "description": " Args:\n radius (float): radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "dynamic_cuboid.set_torsional_patch_radius(radius=radius) # float\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "dynamic_cuboid.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = dynamic_cuboid.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = dynamic_cuboid.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = dynamic_cuboid.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = dynamic_cuboid.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = dynamic_cuboid.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = dynamic_cuboid.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = dynamic_cuboid.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "dynamic_cuboid.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "dynamic_cuboid.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "dynamic_cuboid.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "dynamic_cuboid.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "dynamic_cuboid.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "dynamic_cuboid.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "dynamic_cuboid.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "dynamic_cuboid.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "dynamic_cuboid.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "DynamicCylinder", "snippets": [ { "title": "DynamicCylinder", "description": "_summary_\n\n Args:\n prim_path (str): _description_\n name (str, optional): _description_. Defaults to \"dynamic_cylinder\".\n position (Optional[np.ndarray], optional): _description_. Defaults to None.\n translation (Optional[np.ndarray], optional): _description_. Defaults to None.\n orientation (Optional[np.ndarray], optional): _description_. Defaults to None.\n scale (Optional[np.ndarray], optional): _description_. Defaults to None.\n visible (Optional[bool], optional): _description_. Defaults to None.\n color (Optional[np.ndarray], optional): _description_. Defaults to None.\n radius (Optional[np.ndarray], optional): _description_. Defaults to None.\n height (Optional[np.ndarray], optional): _description_. Defaults to None.\n visual_material (Optional[VisualMaterial], optional): _description_. Defaults to None.\n physics_material (Optional[PhysicsMaterial], optional): _description_. Defaults to None.\n mass (Optional[float], optional): _description_. Defaults to None.\n density (Optional[float], optional): _description_. Defaults to None.\n linear_velocity (Optional[Sequence[float]], optional): _description_. Defaults to None.\n angular_velocity (Optional[Sequence[float]], optional): _description_. Defaults to None.\n ", "snippet": "dynamic_cylinder = DynamicCylinder(prim_path=prim_path, # str\n name=\"dynamic_cylinder\", # str\n position=None, # typing.Union[numpy.ndarray, NoneType]\n translation=None, # typing.Union[numpy.ndarray, NoneType]\n orientation=None, # typing.Union[numpy.ndarray, NoneType]\n scale=None, # typing.Union[numpy.ndarray, NoneType]\n visible=None, # typing.Union[bool, NoneType]\n color=None, # typing.Union[numpy.ndarray, NoneType]\n radius=None, # typing.Union[numpy.ndarray, NoneType]\n height=None, # typing.Union[numpy.ndarray, NoneType]\n visual_material=None, # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, NoneType]\n physics_material=None, # typing.Union[omni.isaac.core.materials.physics_material.PhysicsMaterial, NoneType]\n mass=None, # typing.Union[float, NoneType]\n density=None, # typing.Union[float, NoneType]\n linear_velocity=None, # typing.Union[typing.Sequence[float], NoneType]\n angular_velocity=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "disable_rigid_body_physics", "description": " disable rigid body physics (enabled by default):\n Object will not be moved by external forces such as gravity and collisions\n ", "snippet": "dynamic_cylinder.disable_rigid_body_physics()\n" }, { "title": "enable_rigid_body_physics", "description": " enable rigid body physics (enabled by default):\n Object will be moved by external forces such as gravity and collisions\n ", "snippet": "dynamic_cylinder.enable_rigid_body_physics()\n" }, { "title": "get_angular_velocity", "description": " Returns:\n np.ndarray: current angular velocity of the the rigid prim. Shape (3,).\n ", "snippet": "angular_velocity = dynamic_cylinder.get_angular_velocity()\n" }, { "title": "get_current_dynamic_state", "description": " \n Returns:\n DynamicState: the dynamic state of the rigid body including position, orientation, linear_velocity and angular_velocity.\n ", "snippet": "current_dynamic_state = dynamic_cylinder.get_current_dynamic_state()\n" }, { "title": "get_default_state", "description": " Returns:\n DynamicState: returns the default state of the prim (position, orientation, linear_velocity and \n angular_velocity) that is used after each reset.\n ", "snippet": "default_state = dynamic_cylinder.get_default_state()\n" }, { "title": "get_density", "description": " Returns:\n float: density of the rigid body.\n ", "snippet": "density = dynamic_cylinder.get_density()\n" }, { "title": "get_linear_velocity", "description": " Returns:\n np.ndarray: current linear velocity of the the rigid prim. Shape (3,).\n ", "snippet": "linear_velocity = dynamic_cylinder.get_linear_velocity()\n" }, { "title": "get_mass", "description": " Returns:\n float: mass of the rigid body in kg.\n ", "snippet": "mass = dynamic_cylinder.get_mass()\n" }, { "title": "get_sleep_threshold", "description": " Returns:\n float: Mass-normalized kinetic energy threshold below which \n an actor may go to sleep. Range: [0, inf)\n Defaults: 0.00005 * tolerancesSpeed* tolerancesSpeed\n Units: distance^2 / second^2.\n ", "snippet": "sleep_threshold = dynamic_cylinder.get_sleep_threshold()\n" }, { "title": "set_angular_velocity", "description": "Sets the angular velocity of the prim in stage.\n Args:\n velocity (np.ndarray): angular velocity to set the rigid prim to. Shape (3,).\n ", "snippet": "dynamic_cylinder.set_angular_velocity(velocity=velocity) # numpy.ndarray\n" }, { "title": "set_default_state", "description": " Sets the default state of the prim, that will be used after each reset. \n \n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n linear_velocity (np.ndarray): linear velocity to set the rigid prim to. Shape (3,).\n angular_velocity (np.ndarray): angular velocity to set the rigid prim to. Shape (3,).\n ", "snippet": "dynamic_cylinder.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None, # typing.Union[typing.Sequence[float], NoneType]\n linear_velocity=None, # typing.Union[numpy.ndarray, NoneType]\n angular_velocity=None) # typing.Union[numpy.ndarray, NoneType]\n" }, { "title": "set_density", "description": " Args:\n mass (float): density of the rigid body.\n ", "snippet": "dynamic_cylinder.set_density(density=density) # float\n" }, { "title": "set_linear_velocity", "description": "Sets the linear velocity of the prim in stage.\n Args:\n velocity (np.ndarray): linear velocity to set the rigid prim to. Shape (3,).\n ", "snippet": "dynamic_cylinder.set_linear_velocity(velocity=velocity) # numpy.ndarray\n" }, { "title": "set_mass", "description": " Args:\n mass (float): mass of the rigid body in kg.\n ", "snippet": "dynamic_cylinder.set_mass(mass=mass) # float\n" }, { "title": "set_sleep_threshold", "description": " Args:\n threshold (float): Mass-normalized kinetic energy threshold below which \n an actor may go to sleep. Range: [0, inf)\n Defaults: 0.00005 * tolerancesSpeed* tolerancesSpeed\n Units: distance^2 / second^2.\n ", "snippet": "dynamic_cylinder.set_sleep_threshold(threshold=threshold) # float\n" }, { "title": "get_height", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "height = dynamic_cylinder.get_height()\n" }, { "title": "get_radius", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "radius = dynamic_cylinder.get_radius()\n" }, { "title": "set_height", "description": "[summary]\n\n Args:\n height (float): [description]\n ", "snippet": "dynamic_cylinder.set_height(height=height) # float\n" }, { "title": "set_radius", "description": "[summary]\n\n Args:\n radius (float): [description]\n ", "snippet": "dynamic_cylinder.set_radius(radius=radius) # float\n" }, { "title": "apply_physics_material", "description": "Used to apply physics material to the held prim and optionally its descendants.\n\n Args:\n physics_material (PhysicsMaterial): physics material to be applied to the held prim. This where you want to\n define friction, restitution..etc. Note: if a physics material is not\n defined, the defaults will be used from PhysX.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants\n materials, otherwise False. Defaults to False.\n ", "snippet": "dynamic_cylinder.apply_physics_material(physics_material=physics_material, # omni.isaac.core.materials.physics_material.PhysicsMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_physics_material", "description": "Returns the current applied physics material in case it was applied using apply_physics_material or not.\n\n Returns:\n PhysicsMaterial: the current applied physics material.\n ", "snippet": "applied_physics_material = dynamic_cylinder.get_applied_physics_material()\n" }, { "title": "get_collision_approximation", "description": " Returns:\n str: approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "collision_approximation = dynamic_cylinder.get_collision_approximation()\n" }, { "title": "get_collision_enabled", "description": " Returns:\n ", "snippet": "collision_enabled = dynamic_cylinder.get_collision_enabled()\n" }, { "title": "get_contact_force_matrix", "description": " If the object is initialized with filter_paths_expr list, this method returns the contact forces between the prims \n in the view and the filter prims. i.e., a matrix of dimension (self._contact_view.num_filters, 3) \n where num_filters is the determined according to the filter_paths_expr parameter.\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (self._geometry_prim_view._contact_view.num_filters, 3).\n ", "snippet": "contact_force_matrix = dynamic_cylinder.get_contact_force_matrix(dt=1.0) # float\n" }, { "title": "get_contact_offset", "description": " Returns:\n float: contact offset of the collision shape.\n ", "snippet": "contact_offset = dynamic_cylinder.get_contact_offset()\n" }, { "title": "get_min_torsional_patch_radius", "description": " Returns:\n float: minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "min_torsional_patch_radius = dynamic_cylinder.get_min_torsional_patch_radius()\n" }, { "title": "get_net_contact_forces", "description": " If contact forces of the prims in the view are tracked, this method returns the net contact forces on prims. \n i.e., a matrix of dimension (1, 3)\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (3).\n\n ", "snippet": "net_contact_forces = dynamic_cylinder.get_net_contact_forces(dt=1.0) # float\n" }, { "title": "get_rest_offset", "description": " Returns:\n float: rest offset of the collision shape.\n ", "snippet": "rest_offset = dynamic_cylinder.get_rest_offset()\n" }, { "title": "get_torsional_patch_radius", "description": " Returns:\n float: radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "torsional_patch_radius = dynamic_cylinder.get_torsional_patch_radius()\n" }, { "title": "set_collision_approximation", "description": "\n Args:\n approximation_type (str): approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "dynamic_cylinder.set_collision_approximation(approximation_type=approximation_type) # str\n" }, { "title": "set_collision_enabled", "description": "\n Args:\n ", "snippet": "dynamic_cylinder.set_collision_enabled(enabled=enabled) # bool\n" }, { "title": "set_contact_offset", "description": " Args:\n offset (float): Contact offset of a collision shape. Allowed range [maximum(0, rest_offset), 0].\n Default value is -inf, means default is picked by simulation based on the shape extent.\n ", "snippet": "dynamic_cylinder.set_contact_offset(offset=offset) # float\n" }, { "title": "set_min_torsional_patch_radius", "description": " Args:\n radius (float): minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "dynamic_cylinder.set_min_torsional_patch_radius(radius=radius) # float\n" }, { "title": "set_rest_offset", "description": " Args:\n offset (float): Rest offset of a collision shape. Allowed range [-max_float, contact_offset.\n Default value is -inf, means default is picked by simulatiion. For rigid bodies its zero.\n ", "snippet": "dynamic_cylinder.set_rest_offset(offset=offset) # float\n" }, { "title": "set_torsional_patch_radius", "description": " Args:\n radius (float): radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "dynamic_cylinder.set_torsional_patch_radius(radius=radius) # float\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "dynamic_cylinder.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = dynamic_cylinder.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = dynamic_cylinder.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = dynamic_cylinder.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = dynamic_cylinder.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = dynamic_cylinder.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = dynamic_cylinder.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = dynamic_cylinder.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "dynamic_cylinder.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "dynamic_cylinder.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "dynamic_cylinder.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "dynamic_cylinder.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "dynamic_cylinder.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "dynamic_cylinder.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "dynamic_cylinder.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "dynamic_cylinder.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "dynamic_cylinder.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "DynamicSphere", "snippets": [ { "title": "DynamicSphere", "description": "_summary_\n\n Args:\n prim_path (str): _description_\n name (str, optional): _description_. Defaults to \"dynamic_sphere\".\n position (Optional[np.ndarray], optional): _description_. Defaults to None.\n translation (Optional[np.ndarray], optional): _description_. Defaults to None.\n orientation (Optional[np.ndarray], optional): _description_. Defaults to None.\n scale (Optional[np.ndarray], optional): _description_. Defaults to None.\n visible (Optional[bool], optional): _description_. Defaults to None.\n color (Optional[np.ndarray], optional): _description_. Defaults to None.\n radius (Optional[np.ndarray], optional): _description_. Defaults to None.\n visual_material (Optional[VisualMaterial], optional): _description_. Defaults to None.\n physics_material (Optional[PhysicsMaterial], optional): _description_. Defaults to None.\n mass (Optional[float], optional): _description_. Defaults to None.\n density (Optional[float], optional): _description_. Defaults to None.\n linear_velocity (Optional[Sequence[float]], optional): _description_. Defaults to None.\n angular_velocity (Optional[Sequence[float]], optional): _description_. Defaults to None.\n ", "snippet": "dynamic_sphere = DynamicSphere(prim_path=prim_path, # str\n name=\"dynamic_sphere\", # str\n position=None, # typing.Union[numpy.ndarray, NoneType]\n translation=None, # typing.Union[numpy.ndarray, NoneType]\n orientation=None, # typing.Union[numpy.ndarray, NoneType]\n scale=None, # typing.Union[numpy.ndarray, NoneType]\n visible=None, # typing.Union[bool, NoneType]\n color=None, # typing.Union[numpy.ndarray, NoneType]\n radius=None, # typing.Union[numpy.ndarray, NoneType]\n visual_material=None, # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, NoneType]\n physics_material=None, # typing.Union[omni.isaac.core.materials.physics_material.PhysicsMaterial, NoneType]\n mass=None, # typing.Union[float, NoneType]\n density=None, # typing.Union[float, NoneType]\n linear_velocity=None, # typing.Union[typing.Sequence[float], NoneType]\n angular_velocity=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "disable_rigid_body_physics", "description": " disable rigid body physics (enabled by default):\n Object will not be moved by external forces such as gravity and collisions\n ", "snippet": "dynamic_sphere.disable_rigid_body_physics()\n" }, { "title": "enable_rigid_body_physics", "description": " enable rigid body physics (enabled by default):\n Object will be moved by external forces such as gravity and collisions\n ", "snippet": "dynamic_sphere.enable_rigid_body_physics()\n" }, { "title": "get_angular_velocity", "description": " Returns:\n np.ndarray: current angular velocity of the the rigid prim. Shape (3,).\n ", "snippet": "angular_velocity = dynamic_sphere.get_angular_velocity()\n" }, { "title": "get_current_dynamic_state", "description": " \n Returns:\n DynamicState: the dynamic state of the rigid body including position, orientation, linear_velocity and angular_velocity.\n ", "snippet": "current_dynamic_state = dynamic_sphere.get_current_dynamic_state()\n" }, { "title": "get_default_state", "description": " Returns:\n DynamicState: returns the default state of the prim (position, orientation, linear_velocity and \n angular_velocity) that is used after each reset.\n ", "snippet": "default_state = dynamic_sphere.get_default_state()\n" }, { "title": "get_density", "description": " Returns:\n float: density of the rigid body.\n ", "snippet": "density = dynamic_sphere.get_density()\n" }, { "title": "get_linear_velocity", "description": " Returns:\n np.ndarray: current linear velocity of the the rigid prim. Shape (3,).\n ", "snippet": "linear_velocity = dynamic_sphere.get_linear_velocity()\n" }, { "title": "get_mass", "description": " Returns:\n float: mass of the rigid body in kg.\n ", "snippet": "mass = dynamic_sphere.get_mass()\n" }, { "title": "get_sleep_threshold", "description": " Returns:\n float: Mass-normalized kinetic energy threshold below which \n an actor may go to sleep. Range: [0, inf)\n Defaults: 0.00005 * tolerancesSpeed* tolerancesSpeed\n Units: distance^2 / second^2.\n ", "snippet": "sleep_threshold = dynamic_sphere.get_sleep_threshold()\n" }, { "title": "set_angular_velocity", "description": "Sets the angular velocity of the prim in stage.\n Args:\n velocity (np.ndarray): angular velocity to set the rigid prim to. Shape (3,).\n ", "snippet": "dynamic_sphere.set_angular_velocity(velocity=velocity) # numpy.ndarray\n" }, { "title": "set_default_state", "description": " Sets the default state of the prim, that will be used after each reset. \n \n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n linear_velocity (np.ndarray): linear velocity to set the rigid prim to. Shape (3,).\n angular_velocity (np.ndarray): angular velocity to set the rigid prim to. Shape (3,).\n ", "snippet": "dynamic_sphere.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None, # typing.Union[typing.Sequence[float], NoneType]\n linear_velocity=None, # typing.Union[numpy.ndarray, NoneType]\n angular_velocity=None) # typing.Union[numpy.ndarray, NoneType]\n" }, { "title": "set_density", "description": " Args:\n mass (float): density of the rigid body.\n ", "snippet": "dynamic_sphere.set_density(density=density) # float\n" }, { "title": "set_linear_velocity", "description": "Sets the linear velocity of the prim in stage.\n Args:\n velocity (np.ndarray): linear velocity to set the rigid prim to. Shape (3,).\n ", "snippet": "dynamic_sphere.set_linear_velocity(velocity=velocity) # numpy.ndarray\n" }, { "title": "set_mass", "description": " Args:\n mass (float): mass of the rigid body in kg.\n ", "snippet": "dynamic_sphere.set_mass(mass=mass) # float\n" }, { "title": "set_sleep_threshold", "description": " Args:\n threshold (float): Mass-normalized kinetic energy threshold below which \n an actor may go to sleep. Range: [0, inf)\n Defaults: 0.00005 * tolerancesSpeed* tolerancesSpeed\n Units: distance^2 / second^2.\n ", "snippet": "dynamic_sphere.set_sleep_threshold(threshold=threshold) # float\n" }, { "title": "get_radius", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "radius = dynamic_sphere.get_radius()\n" }, { "title": "set_radius", "description": "[summary]\n\n Args:\n radius (float): [description]\n ", "snippet": "dynamic_sphere.set_radius(radius=radius) # float\n" }, { "title": "apply_physics_material", "description": "Used to apply physics material to the held prim and optionally its descendants.\n\n Args:\n physics_material (PhysicsMaterial): physics material to be applied to the held prim. This where you want to\n define friction, restitution..etc. Note: if a physics material is not\n defined, the defaults will be used from PhysX.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants\n materials, otherwise False. Defaults to False.\n ", "snippet": "dynamic_sphere.apply_physics_material(physics_material=physics_material, # omni.isaac.core.materials.physics_material.PhysicsMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_physics_material", "description": "Returns the current applied physics material in case it was applied using apply_physics_material or not.\n\n Returns:\n PhysicsMaterial: the current applied physics material.\n ", "snippet": "applied_physics_material = dynamic_sphere.get_applied_physics_material()\n" }, { "title": "get_collision_approximation", "description": " Returns:\n str: approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "collision_approximation = dynamic_sphere.get_collision_approximation()\n" }, { "title": "get_collision_enabled", "description": " Returns:\n ", "snippet": "collision_enabled = dynamic_sphere.get_collision_enabled()\n" }, { "title": "get_contact_force_matrix", "description": " If the object is initialized with filter_paths_expr list, this method returns the contact forces between the prims \n in the view and the filter prims. i.e., a matrix of dimension (self._contact_view.num_filters, 3) \n where num_filters is the determined according to the filter_paths_expr parameter.\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (self._geometry_prim_view._contact_view.num_filters, 3).\n ", "snippet": "contact_force_matrix = dynamic_sphere.get_contact_force_matrix(dt=1.0) # float\n" }, { "title": "get_contact_offset", "description": " Returns:\n float: contact offset of the collision shape.\n ", "snippet": "contact_offset = dynamic_sphere.get_contact_offset()\n" }, { "title": "get_min_torsional_patch_radius", "description": " Returns:\n float: minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "min_torsional_patch_radius = dynamic_sphere.get_min_torsional_patch_radius()\n" }, { "title": "get_net_contact_forces", "description": " If contact forces of the prims in the view are tracked, this method returns the net contact forces on prims. \n i.e., a matrix of dimension (1, 3)\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (3).\n\n ", "snippet": "net_contact_forces = dynamic_sphere.get_net_contact_forces(dt=1.0) # float\n" }, { "title": "get_rest_offset", "description": " Returns:\n float: rest offset of the collision shape.\n ", "snippet": "rest_offset = dynamic_sphere.get_rest_offset()\n" }, { "title": "get_torsional_patch_radius", "description": " Returns:\n float: radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "torsional_patch_radius = dynamic_sphere.get_torsional_patch_radius()\n" }, { "title": "set_collision_approximation", "description": "\n Args:\n approximation_type (str): approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "dynamic_sphere.set_collision_approximation(approximation_type=approximation_type) # str\n" }, { "title": "set_collision_enabled", "description": "\n Args:\n ", "snippet": "dynamic_sphere.set_collision_enabled(enabled=enabled) # bool\n" }, { "title": "set_contact_offset", "description": " Args:\n offset (float): Contact offset of a collision shape. Allowed range [maximum(0, rest_offset), 0].\n Default value is -inf, means default is picked by simulation based on the shape extent.\n ", "snippet": "dynamic_sphere.set_contact_offset(offset=offset) # float\n" }, { "title": "set_min_torsional_patch_radius", "description": " Args:\n radius (float): minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "dynamic_sphere.set_min_torsional_patch_radius(radius=radius) # float\n" }, { "title": "set_rest_offset", "description": " Args:\n offset (float): Rest offset of a collision shape. Allowed range [-max_float, contact_offset.\n Default value is -inf, means default is picked by simulatiion. For rigid bodies its zero.\n ", "snippet": "dynamic_sphere.set_rest_offset(offset=offset) # float\n" }, { "title": "set_torsional_patch_radius", "description": " Args:\n radius (float): radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "dynamic_sphere.set_torsional_patch_radius(radius=radius) # float\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "dynamic_sphere.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = dynamic_sphere.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = dynamic_sphere.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = dynamic_sphere.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = dynamic_sphere.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = dynamic_sphere.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = dynamic_sphere.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = dynamic_sphere.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "dynamic_sphere.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "dynamic_sphere.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "dynamic_sphere.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "dynamic_sphere.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "dynamic_sphere.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "dynamic_sphere.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "dynamic_sphere.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "dynamic_sphere.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "dynamic_sphere.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "FixedCapsule", "snippets": [ { "title": "FixedCapsule", "description": "_summary_\n\n Args:\n prim_path (str): _description_\n name (str, optional): _description_. Defaults to \"fixed_capsule\".\n position (Optional[np.ndarray], optional): _description_. Defaults to None.\n translation (Optional[np.ndarray], optional): _description_. Defaults to None.\n orientation (Optional[np.ndarray], optional): _description_. Defaults to None.\n scale (Optional[np.ndarray], optional): _description_. Defaults to None.\n visible (Optional[bool], optional): _description_. Defaults to None.\n color (Optional[np.ndarray], optional): _description_. Defaults to None.\n radius (Optional[np.ndarray], optional): _description_. Defaults to None.\n height (Optional[float], optional): _description_. Defaults to None.\n visual_material (Optional[VisualMaterial], optional): _description_. Defaults to None.\n physics_material (Optional[PhysicsMaterial], optional): _description_. Defaults to None.\n ", "snippet": "fixed_capsule = FixedCapsule(prim_path=prim_path, # str\n name=\"fixed_capsule\", # str\n position=None, # typing.Union[numpy.ndarray, NoneType]\n translation=None, # typing.Union[numpy.ndarray, NoneType]\n orientation=None, # typing.Union[numpy.ndarray, NoneType]\n scale=None, # typing.Union[numpy.ndarray, NoneType]\n visible=None, # typing.Union[bool, NoneType]\n color=None, # typing.Union[numpy.ndarray, NoneType]\n radius=None, # typing.Union[numpy.ndarray, NoneType]\n height=None, # typing.Union[float, NoneType]\n visual_material=None, # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, NoneType]\n physics_material=None) # typing.Union[omni.isaac.core.materials.physics_material.PhysicsMaterial, NoneType]\n" }, { "title": "get_height", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "height = fixed_capsule.get_height()\n" }, { "title": "get_radius", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "radius = fixed_capsule.get_radius()\n" }, { "title": "set_height", "description": "[summary]\n\n Args:\n height (float): [description]\n ", "snippet": "fixed_capsule.set_height(height=height) # float\n" }, { "title": "set_radius", "description": "[summary]\n\n Args:\n radius (float): [description]\n ", "snippet": "fixed_capsule.set_radius(radius=radius) # float\n" }, { "title": "apply_physics_material", "description": "Used to apply physics material to the held prim and optionally its descendants.\n\n Args:\n physics_material (PhysicsMaterial): physics material to be applied to the held prim. This where you want to\n define friction, restitution..etc. Note: if a physics material is not\n defined, the defaults will be used from PhysX.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants\n materials, otherwise False. Defaults to False.\n ", "snippet": "fixed_capsule.apply_physics_material(physics_material=physics_material, # omni.isaac.core.materials.physics_material.PhysicsMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_physics_material", "description": "Returns the current applied physics material in case it was applied using apply_physics_material or not.\n\n Returns:\n PhysicsMaterial: the current applied physics material.\n ", "snippet": "applied_physics_material = fixed_capsule.get_applied_physics_material()\n" }, { "title": "get_collision_approximation", "description": " Returns:\n str: approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "collision_approximation = fixed_capsule.get_collision_approximation()\n" }, { "title": "get_collision_enabled", "description": " Returns:\n ", "snippet": "collision_enabled = fixed_capsule.get_collision_enabled()\n" }, { "title": "get_contact_force_matrix", "description": " If the object is initialized with filter_paths_expr list, this method returns the contact forces between the prims \n in the view and the filter prims. i.e., a matrix of dimension (self._contact_view.num_filters, 3) \n where num_filters is the determined according to the filter_paths_expr parameter.\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (self._geometry_prim_view._contact_view.num_filters, 3).\n ", "snippet": "contact_force_matrix = fixed_capsule.get_contact_force_matrix(dt=1.0) # float\n" }, { "title": "get_contact_offset", "description": " Returns:\n float: contact offset of the collision shape.\n ", "snippet": "contact_offset = fixed_capsule.get_contact_offset()\n" }, { "title": "get_min_torsional_patch_radius", "description": " Returns:\n float: minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "min_torsional_patch_radius = fixed_capsule.get_min_torsional_patch_radius()\n" }, { "title": "get_net_contact_forces", "description": " If contact forces of the prims in the view are tracked, this method returns the net contact forces on prims. \n i.e., a matrix of dimension (1, 3)\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (3).\n\n ", "snippet": "net_contact_forces = fixed_capsule.get_net_contact_forces(dt=1.0) # float\n" }, { "title": "get_rest_offset", "description": " Returns:\n float: rest offset of the collision shape.\n ", "snippet": "rest_offset = fixed_capsule.get_rest_offset()\n" }, { "title": "get_torsional_patch_radius", "description": " Returns:\n float: radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "torsional_patch_radius = fixed_capsule.get_torsional_patch_radius()\n" }, { "title": "set_collision_approximation", "description": "\n Args:\n approximation_type (str): approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "fixed_capsule.set_collision_approximation(approximation_type=approximation_type) # str\n" }, { "title": "set_collision_enabled", "description": "\n Args:\n ", "snippet": "fixed_capsule.set_collision_enabled(enabled=enabled) # bool\n" }, { "title": "set_contact_offset", "description": " Args:\n offset (float): Contact offset of a collision shape. Allowed range [maximum(0, rest_offset), 0].\n Default value is -inf, means default is picked by simulation based on the shape extent.\n ", "snippet": "fixed_capsule.set_contact_offset(offset=offset) # float\n" }, { "title": "set_min_torsional_patch_radius", "description": " Args:\n radius (float): minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "fixed_capsule.set_min_torsional_patch_radius(radius=radius) # float\n" }, { "title": "set_rest_offset", "description": " Args:\n offset (float): Rest offset of a collision shape. Allowed range [-max_float, contact_offset.\n Default value is -inf, means default is picked by simulatiion. For rigid bodies its zero.\n ", "snippet": "fixed_capsule.set_rest_offset(offset=offset) # float\n" }, { "title": "set_torsional_patch_radius", "description": " Args:\n radius (float): radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "fixed_capsule.set_torsional_patch_radius(radius=radius) # float\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "fixed_capsule.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = fixed_capsule.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = fixed_capsule.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = fixed_capsule.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = fixed_capsule.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = fixed_capsule.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = fixed_capsule.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = fixed_capsule.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "fixed_capsule.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "fixed_capsule.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "fixed_capsule.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "fixed_capsule.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "fixed_capsule.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "fixed_capsule.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "fixed_capsule.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "fixed_capsule.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "fixed_capsule.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "FixedCone", "snippets": [ { "title": "FixedCone", "description": "_summary_\n\n Args:\n prim_path (str): _description_\n name (str, optional): _description_. Defaults to \"fixed_cone\".\n position (Optional[np.ndarray], optional): _description_. Defaults to None.\n translation (Optional[np.ndarray], optional): _description_. Defaults to None.\n orientation (Optional[np.ndarray], optional): _description_. Defaults to None.\n scale (Optional[np.ndarray], optional): _description_. Defaults to None.\n visible (Optional[bool], optional): _description_. Defaults to None.\n color (Optional[np.ndarray], optional): _description_. Defaults to None.\n radius (Optional[np.ndarray], optional): _description_. Defaults to None.\n height (Optional[float], optional): _description_. Defaults to None.\n visual_material (Optional[VisualMaterial], optional): _description_. Defaults to None.\n physics_material (Optional[PhysicsMaterial], optional): _description_. Defaults to None.\n ", "snippet": "fixed_cone = FixedCone(prim_path=prim_path, # str\n name=\"fixed_cone\", # str\n position=None, # typing.Union[numpy.ndarray, NoneType]\n translation=None, # typing.Union[numpy.ndarray, NoneType]\n orientation=None, # typing.Union[numpy.ndarray, NoneType]\n scale=None, # typing.Union[numpy.ndarray, NoneType]\n visible=None, # typing.Union[bool, NoneType]\n color=None, # typing.Union[numpy.ndarray, NoneType]\n radius=None, # typing.Union[numpy.ndarray, NoneType]\n height=None, # typing.Union[float, NoneType]\n visual_material=None, # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, NoneType]\n physics_material=None) # typing.Union[omni.isaac.core.materials.physics_material.PhysicsMaterial, NoneType]\n" }, { "title": "get_height", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "height = fixed_cone.get_height()\n" }, { "title": "get_radius", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "radius = fixed_cone.get_radius()\n" }, { "title": "set_height", "description": "[summary]\n\n Args:\n height (float): [description]\n ", "snippet": "fixed_cone.set_height(height=height) # float\n" }, { "title": "set_radius", "description": "[summary]\n\n Args:\n radius (float): [description]\n ", "snippet": "fixed_cone.set_radius(radius=radius) # float\n" }, { "title": "apply_physics_material", "description": "Used to apply physics material to the held prim and optionally its descendants.\n\n Args:\n physics_material (PhysicsMaterial): physics material to be applied to the held prim. This where you want to\n define friction, restitution..etc. Note: if a physics material is not\n defined, the defaults will be used from PhysX.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants\n materials, otherwise False. Defaults to False.\n ", "snippet": "fixed_cone.apply_physics_material(physics_material=physics_material, # omni.isaac.core.materials.physics_material.PhysicsMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_physics_material", "description": "Returns the current applied physics material in case it was applied using apply_physics_material or not.\n\n Returns:\n PhysicsMaterial: the current applied physics material.\n ", "snippet": "applied_physics_material = fixed_cone.get_applied_physics_material()\n" }, { "title": "get_collision_approximation", "description": " Returns:\n str: approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "collision_approximation = fixed_cone.get_collision_approximation()\n" }, { "title": "get_collision_enabled", "description": " Returns:\n ", "snippet": "collision_enabled = fixed_cone.get_collision_enabled()\n" }, { "title": "get_contact_force_matrix", "description": " If the object is initialized with filter_paths_expr list, this method returns the contact forces between the prims \n in the view and the filter prims. i.e., a matrix of dimension (self._contact_view.num_filters, 3) \n where num_filters is the determined according to the filter_paths_expr parameter.\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (self._geometry_prim_view._contact_view.num_filters, 3).\n ", "snippet": "contact_force_matrix = fixed_cone.get_contact_force_matrix(dt=1.0) # float\n" }, { "title": "get_contact_offset", "description": " Returns:\n float: contact offset of the collision shape.\n ", "snippet": "contact_offset = fixed_cone.get_contact_offset()\n" }, { "title": "get_min_torsional_patch_radius", "description": " Returns:\n float: minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "min_torsional_patch_radius = fixed_cone.get_min_torsional_patch_radius()\n" }, { "title": "get_net_contact_forces", "description": " If contact forces of the prims in the view are tracked, this method returns the net contact forces on prims. \n i.e., a matrix of dimension (1, 3)\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (3).\n\n ", "snippet": "net_contact_forces = fixed_cone.get_net_contact_forces(dt=1.0) # float\n" }, { "title": "get_rest_offset", "description": " Returns:\n float: rest offset of the collision shape.\n ", "snippet": "rest_offset = fixed_cone.get_rest_offset()\n" }, { "title": "get_torsional_patch_radius", "description": " Returns:\n float: radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "torsional_patch_radius = fixed_cone.get_torsional_patch_radius()\n" }, { "title": "set_collision_approximation", "description": "\n Args:\n approximation_type (str): approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "fixed_cone.set_collision_approximation(approximation_type=approximation_type) # str\n" }, { "title": "set_collision_enabled", "description": "\n Args:\n ", "snippet": "fixed_cone.set_collision_enabled(enabled=enabled) # bool\n" }, { "title": "set_contact_offset", "description": " Args:\n offset (float): Contact offset of a collision shape. Allowed range [maximum(0, rest_offset), 0].\n Default value is -inf, means default is picked by simulation based on the shape extent.\n ", "snippet": "fixed_cone.set_contact_offset(offset=offset) # float\n" }, { "title": "set_min_torsional_patch_radius", "description": " Args:\n radius (float): minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "fixed_cone.set_min_torsional_patch_radius(radius=radius) # float\n" }, { "title": "set_rest_offset", "description": " Args:\n offset (float): Rest offset of a collision shape. Allowed range [-max_float, contact_offset.\n Default value is -inf, means default is picked by simulatiion. For rigid bodies its zero.\n ", "snippet": "fixed_cone.set_rest_offset(offset=offset) # float\n" }, { "title": "set_torsional_patch_radius", "description": " Args:\n radius (float): radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "fixed_cone.set_torsional_patch_radius(radius=radius) # float\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "fixed_cone.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = fixed_cone.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = fixed_cone.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = fixed_cone.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = fixed_cone.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = fixed_cone.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = fixed_cone.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = fixed_cone.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "fixed_cone.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "fixed_cone.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "fixed_cone.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "fixed_cone.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "fixed_cone.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "fixed_cone.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "fixed_cone.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "fixed_cone.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "fixed_cone.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "FixedCuboid", "snippets": [ { "title": "FixedCuboid", "description": "_summary_\n\n Args:\n prim_path (str): _description_\n name (str, optional): _description_. Defaults to \"fixed_cube\".\n position (Optional[np.ndarray], optional): _description_. Defaults to None.\n translation (Optional[np.ndarray], optional): _description_. Defaults to None.\n orientation (Optional[np.ndarray], optional): _description_. Defaults to None.\n scale (Optional[np.ndarray], optional): _description_. Defaults to None.\n visible (Optional[bool], optional): _description_. Defaults to None.\n color (Optional[np.ndarray], optional): _description_. Defaults to None.\n size (Optional[float], optional): _description_. Defaults to None.\n visual_material (Optional[VisualMaterial], optional): _description_. Defaults to None.\n physics_material (Optional[PhysicsMaterial], optional): _description_. Defaults to None.\n ", "snippet": "fixed_cuboid = FixedCuboid(prim_path=prim_path, # str\n name=\"fixed_cube\", # str\n position=None, # typing.Union[numpy.ndarray, NoneType]\n translation=None, # typing.Union[numpy.ndarray, NoneType]\n orientation=None, # typing.Union[numpy.ndarray, NoneType]\n scale=None, # typing.Union[numpy.ndarray, NoneType]\n visible=None, # typing.Union[bool, NoneType]\n color=None, # typing.Union[numpy.ndarray, NoneType]\n size=None, # typing.Union[float, NoneType]\n visual_material=None, # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, NoneType]\n physics_material=None) # typing.Union[omni.isaac.core.materials.physics_material.PhysicsMaterial, NoneType]\n" }, { "title": "get_size", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "size = fixed_cuboid.get_size()\n" }, { "title": "set_size", "description": "[summary]\n\n Args:\n size (float): [description]\n ", "snippet": "fixed_cuboid.set_size(size=size) # float\n" }, { "title": "apply_physics_material", "description": "Used to apply physics material to the held prim and optionally its descendants.\n\n Args:\n physics_material (PhysicsMaterial): physics material to be applied to the held prim. This where you want to\n define friction, restitution..etc. Note: if a physics material is not\n defined, the defaults will be used from PhysX.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants\n materials, otherwise False. Defaults to False.\n ", "snippet": "fixed_cuboid.apply_physics_material(physics_material=physics_material, # omni.isaac.core.materials.physics_material.PhysicsMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_physics_material", "description": "Returns the current applied physics material in case it was applied using apply_physics_material or not.\n\n Returns:\n PhysicsMaterial: the current applied physics material.\n ", "snippet": "applied_physics_material = fixed_cuboid.get_applied_physics_material()\n" }, { "title": "get_collision_approximation", "description": " Returns:\n str: approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "collision_approximation = fixed_cuboid.get_collision_approximation()\n" }, { "title": "get_collision_enabled", "description": " Returns:\n ", "snippet": "collision_enabled = fixed_cuboid.get_collision_enabled()\n" }, { "title": "get_contact_force_matrix", "description": " If the object is initialized with filter_paths_expr list, this method returns the contact forces between the prims \n in the view and the filter prims. i.e., a matrix of dimension (self._contact_view.num_filters, 3) \n where num_filters is the determined according to the filter_paths_expr parameter.\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (self._geometry_prim_view._contact_view.num_filters, 3).\n ", "snippet": "contact_force_matrix = fixed_cuboid.get_contact_force_matrix(dt=1.0) # float\n" }, { "title": "get_contact_offset", "description": " Returns:\n float: contact offset of the collision shape.\n ", "snippet": "contact_offset = fixed_cuboid.get_contact_offset()\n" }, { "title": "get_min_torsional_patch_radius", "description": " Returns:\n float: minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "min_torsional_patch_radius = fixed_cuboid.get_min_torsional_patch_radius()\n" }, { "title": "get_net_contact_forces", "description": " If contact forces of the prims in the view are tracked, this method returns the net contact forces on prims. \n i.e., a matrix of dimension (1, 3)\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (3).\n\n ", "snippet": "net_contact_forces = fixed_cuboid.get_net_contact_forces(dt=1.0) # float\n" }, { "title": "get_rest_offset", "description": " Returns:\n float: rest offset of the collision shape.\n ", "snippet": "rest_offset = fixed_cuboid.get_rest_offset()\n" }, { "title": "get_torsional_patch_radius", "description": " Returns:\n float: radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "torsional_patch_radius = fixed_cuboid.get_torsional_patch_radius()\n" }, { "title": "set_collision_approximation", "description": "\n Args:\n approximation_type (str): approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "fixed_cuboid.set_collision_approximation(approximation_type=approximation_type) # str\n" }, { "title": "set_collision_enabled", "description": "\n Args:\n ", "snippet": "fixed_cuboid.set_collision_enabled(enabled=enabled) # bool\n" }, { "title": "set_contact_offset", "description": " Args:\n offset (float): Contact offset of a collision shape. Allowed range [maximum(0, rest_offset), 0].\n Default value is -inf, means default is picked by simulation based on the shape extent.\n ", "snippet": "fixed_cuboid.set_contact_offset(offset=offset) # float\n" }, { "title": "set_min_torsional_patch_radius", "description": " Args:\n radius (float): minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "fixed_cuboid.set_min_torsional_patch_radius(radius=radius) # float\n" }, { "title": "set_rest_offset", "description": " Args:\n offset (float): Rest offset of a collision shape. Allowed range [-max_float, contact_offset.\n Default value is -inf, means default is picked by simulatiion. For rigid bodies its zero.\n ", "snippet": "fixed_cuboid.set_rest_offset(offset=offset) # float\n" }, { "title": "set_torsional_patch_radius", "description": " Args:\n radius (float): radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "fixed_cuboid.set_torsional_patch_radius(radius=radius) # float\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "fixed_cuboid.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = fixed_cuboid.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = fixed_cuboid.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = fixed_cuboid.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = fixed_cuboid.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = fixed_cuboid.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = fixed_cuboid.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = fixed_cuboid.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "fixed_cuboid.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "fixed_cuboid.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "fixed_cuboid.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "fixed_cuboid.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "fixed_cuboid.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "fixed_cuboid.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "fixed_cuboid.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "fixed_cuboid.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "fixed_cuboid.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "FixedCylinder", "snippets": [ { "title": "FixedCylinder", "description": "_summary_\n\n Args:\n prim_path (str): _description_\n name (str, optional): _description_. Defaults to \"fixed_cylinder\".\n position (Optional[np.ndarray], optional): _description_. Defaults to None.\n translation (Optional[np.ndarray], optional): _description_. Defaults to None.\n orientation (Optional[np.ndarray], optional): _description_. Defaults to None.\n scale (Optional[np.ndarray], optional): _description_. Defaults to None.\n visible (Optional[bool], optional): _description_. Defaults to None.\n color (Optional[np.ndarray], optional): _description_. Defaults to None.\n radius (Optional[np.ndarray], optional): _description_. Defaults to None.\n height (Optional[float], optional): _description_. Defaults to None.\n visual_material (Optional[VisualMaterial], optional): _description_. Defaults to None.\n physics_material (Optional[PhysicsMaterial], optional): _description_. Defaults to None.\n ", "snippet": "fixed_cylinder = FixedCylinder(prim_path=prim_path, # str\n name=\"fixed_cylinder\", # str\n position=None, # typing.Union[numpy.ndarray, NoneType]\n translation=None, # typing.Union[numpy.ndarray, NoneType]\n orientation=None, # typing.Union[numpy.ndarray, NoneType]\n scale=None, # typing.Union[numpy.ndarray, NoneType]\n visible=None, # typing.Union[bool, NoneType]\n color=None, # typing.Union[numpy.ndarray, NoneType]\n radius=None, # typing.Union[numpy.ndarray, NoneType]\n height=None, # typing.Union[float, NoneType]\n visual_material=None, # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, NoneType]\n physics_material=None) # typing.Union[omni.isaac.core.materials.physics_material.PhysicsMaterial, NoneType]\n" }, { "title": "get_height", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "height = fixed_cylinder.get_height()\n" }, { "title": "get_radius", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "radius = fixed_cylinder.get_radius()\n" }, { "title": "set_height", "description": "[summary]\n\n Args:\n height (float): [description]\n ", "snippet": "fixed_cylinder.set_height(height=height) # float\n" }, { "title": "set_radius", "description": "[summary]\n\n Args:\n radius (float): [description]\n ", "snippet": "fixed_cylinder.set_radius(radius=radius) # float\n" }, { "title": "apply_physics_material", "description": "Used to apply physics material to the held prim and optionally its descendants.\n\n Args:\n physics_material (PhysicsMaterial): physics material to be applied to the held prim. This where you want to\n define friction, restitution..etc. Note: if a physics material is not\n defined, the defaults will be used from PhysX.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants\n materials, otherwise False. Defaults to False.\n ", "snippet": "fixed_cylinder.apply_physics_material(physics_material=physics_material, # omni.isaac.core.materials.physics_material.PhysicsMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_physics_material", "description": "Returns the current applied physics material in case it was applied using apply_physics_material or not.\n\n Returns:\n PhysicsMaterial: the current applied physics material.\n ", "snippet": "applied_physics_material = fixed_cylinder.get_applied_physics_material()\n" }, { "title": "get_collision_approximation", "description": " Returns:\n str: approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "collision_approximation = fixed_cylinder.get_collision_approximation()\n" }, { "title": "get_collision_enabled", "description": " Returns:\n ", "snippet": "collision_enabled = fixed_cylinder.get_collision_enabled()\n" }, { "title": "get_contact_force_matrix", "description": " If the object is initialized with filter_paths_expr list, this method returns the contact forces between the prims \n in the view and the filter prims. i.e., a matrix of dimension (self._contact_view.num_filters, 3) \n where num_filters is the determined according to the filter_paths_expr parameter.\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (self._geometry_prim_view._contact_view.num_filters, 3).\n ", "snippet": "contact_force_matrix = fixed_cylinder.get_contact_force_matrix(dt=1.0) # float\n" }, { "title": "get_contact_offset", "description": " Returns:\n float: contact offset of the collision shape.\n ", "snippet": "contact_offset = fixed_cylinder.get_contact_offset()\n" }, { "title": "get_min_torsional_patch_radius", "description": " Returns:\n float: minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "min_torsional_patch_radius = fixed_cylinder.get_min_torsional_patch_radius()\n" }, { "title": "get_net_contact_forces", "description": " If contact forces of the prims in the view are tracked, this method returns the net contact forces on prims. \n i.e., a matrix of dimension (1, 3)\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (3).\n\n ", "snippet": "net_contact_forces = fixed_cylinder.get_net_contact_forces(dt=1.0) # float\n" }, { "title": "get_rest_offset", "description": " Returns:\n float: rest offset of the collision shape.\n ", "snippet": "rest_offset = fixed_cylinder.get_rest_offset()\n" }, { "title": "get_torsional_patch_radius", "description": " Returns:\n float: radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "torsional_patch_radius = fixed_cylinder.get_torsional_patch_radius()\n" }, { "title": "set_collision_approximation", "description": "\n Args:\n approximation_type (str): approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "fixed_cylinder.set_collision_approximation(approximation_type=approximation_type) # str\n" }, { "title": "set_collision_enabled", "description": "\n Args:\n ", "snippet": "fixed_cylinder.set_collision_enabled(enabled=enabled) # bool\n" }, { "title": "set_contact_offset", "description": " Args:\n offset (float): Contact offset of a collision shape. Allowed range [maximum(0, rest_offset), 0].\n Default value is -inf, means default is picked by simulation based on the shape extent.\n ", "snippet": "fixed_cylinder.set_contact_offset(offset=offset) # float\n" }, { "title": "set_min_torsional_patch_radius", "description": " Args:\n radius (float): minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "fixed_cylinder.set_min_torsional_patch_radius(radius=radius) # float\n" }, { "title": "set_rest_offset", "description": " Args:\n offset (float): Rest offset of a collision shape. Allowed range [-max_float, contact_offset.\n Default value is -inf, means default is picked by simulatiion. For rigid bodies its zero.\n ", "snippet": "fixed_cylinder.set_rest_offset(offset=offset) # float\n" }, { "title": "set_torsional_patch_radius", "description": " Args:\n radius (float): radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "fixed_cylinder.set_torsional_patch_radius(radius=radius) # float\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "fixed_cylinder.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = fixed_cylinder.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = fixed_cylinder.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = fixed_cylinder.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = fixed_cylinder.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = fixed_cylinder.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = fixed_cylinder.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = fixed_cylinder.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "fixed_cylinder.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "fixed_cylinder.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "fixed_cylinder.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "fixed_cylinder.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "fixed_cylinder.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "fixed_cylinder.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "fixed_cylinder.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "fixed_cylinder.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "fixed_cylinder.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "FixedSphere", "snippets": [ { "title": "FixedSphere", "description": "_summary_\n\n Args:\n prim_path (str): _description_\n name (str, optional): _description_. Defaults to \"fixed_sphere\".\n position (Optional[np.ndarray], optional): _description_. Defaults to None.\n translation (Optional[np.ndarray], optional): _description_. Defaults to None.\n orientation (Optional[np.ndarray], optional): _description_. Defaults to None.\n scale (Optional[np.ndarray], optional): _description_. Defaults to None.\n visible (Optional[bool], optional): _description_. Defaults to None.\n color (Optional[np.ndarray], optional): _description_. Defaults to None.\n radius (Optional[np.ndarray], optional): _description_. Defaults to None.\n visual_material (Optional[VisualMaterial], optional): _description_. Defaults to None.\n physics_material (Optional[PhysicsMaterial], optional): _description_. Defaults to None.\n ", "snippet": "fixed_sphere = FixedSphere(prim_path=prim_path, # str\n name=\"fixed_sphere\", # str\n position=None, # typing.Union[numpy.ndarray, NoneType]\n translation=None, # typing.Union[numpy.ndarray, NoneType]\n orientation=None, # typing.Union[numpy.ndarray, NoneType]\n scale=None, # typing.Union[numpy.ndarray, NoneType]\n visible=None, # typing.Union[bool, NoneType]\n color=None, # typing.Union[numpy.ndarray, NoneType]\n radius=None, # typing.Union[numpy.ndarray, NoneType]\n visual_material=None, # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, NoneType]\n physics_material=None) # typing.Union[omni.isaac.core.materials.physics_material.PhysicsMaterial, NoneType]\n" }, { "title": "get_radius", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "radius = fixed_sphere.get_radius()\n" }, { "title": "set_radius", "description": "[summary]\n\n Args:\n radius (float): [description]\n ", "snippet": "fixed_sphere.set_radius(radius=radius) # float\n" }, { "title": "apply_physics_material", "description": "Used to apply physics material to the held prim and optionally its descendants.\n\n Args:\n physics_material (PhysicsMaterial): physics material to be applied to the held prim. This where you want to\n define friction, restitution..etc. Note: if a physics material is not\n defined, the defaults will be used from PhysX.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants\n materials, otherwise False. Defaults to False.\n ", "snippet": "fixed_sphere.apply_physics_material(physics_material=physics_material, # omni.isaac.core.materials.physics_material.PhysicsMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_physics_material", "description": "Returns the current applied physics material in case it was applied using apply_physics_material or not.\n\n Returns:\n PhysicsMaterial: the current applied physics material.\n ", "snippet": "applied_physics_material = fixed_sphere.get_applied_physics_material()\n" }, { "title": "get_collision_approximation", "description": " Returns:\n str: approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "collision_approximation = fixed_sphere.get_collision_approximation()\n" }, { "title": "get_collision_enabled", "description": " Returns:\n ", "snippet": "collision_enabled = fixed_sphere.get_collision_enabled()\n" }, { "title": "get_contact_force_matrix", "description": " If the object is initialized with filter_paths_expr list, this method returns the contact forces between the prims \n in the view and the filter prims. i.e., a matrix of dimension (self._contact_view.num_filters, 3) \n where num_filters is the determined according to the filter_paths_expr parameter.\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (self._geometry_prim_view._contact_view.num_filters, 3).\n ", "snippet": "contact_force_matrix = fixed_sphere.get_contact_force_matrix(dt=1.0) # float\n" }, { "title": "get_contact_offset", "description": " Returns:\n float: contact offset of the collision shape.\n ", "snippet": "contact_offset = fixed_sphere.get_contact_offset()\n" }, { "title": "get_min_torsional_patch_radius", "description": " Returns:\n float: minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "min_torsional_patch_radius = fixed_sphere.get_min_torsional_patch_radius()\n" }, { "title": "get_net_contact_forces", "description": " If contact forces of the prims in the view are tracked, this method returns the net contact forces on prims. \n i.e., a matrix of dimension (1, 3)\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (3).\n\n ", "snippet": "net_contact_forces = fixed_sphere.get_net_contact_forces(dt=1.0) # float\n" }, { "title": "get_rest_offset", "description": " Returns:\n float: rest offset of the collision shape.\n ", "snippet": "rest_offset = fixed_sphere.get_rest_offset()\n" }, { "title": "get_torsional_patch_radius", "description": " Returns:\n float: radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "torsional_patch_radius = fixed_sphere.get_torsional_patch_radius()\n" }, { "title": "set_collision_approximation", "description": "\n Args:\n approximation_type (str): approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "fixed_sphere.set_collision_approximation(approximation_type=approximation_type) # str\n" }, { "title": "set_collision_enabled", "description": "\n Args:\n ", "snippet": "fixed_sphere.set_collision_enabled(enabled=enabled) # bool\n" }, { "title": "set_contact_offset", "description": " Args:\n offset (float): Contact offset of a collision shape. Allowed range [maximum(0, rest_offset), 0].\n Default value is -inf, means default is picked by simulation based on the shape extent.\n ", "snippet": "fixed_sphere.set_contact_offset(offset=offset) # float\n" }, { "title": "set_min_torsional_patch_radius", "description": " Args:\n radius (float): minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "fixed_sphere.set_min_torsional_patch_radius(radius=radius) # float\n" }, { "title": "set_rest_offset", "description": " Args:\n offset (float): Rest offset of a collision shape. Allowed range [-max_float, contact_offset.\n Default value is -inf, means default is picked by simulatiion. For rigid bodies its zero.\n ", "snippet": "fixed_sphere.set_rest_offset(offset=offset) # float\n" }, { "title": "set_torsional_patch_radius", "description": " Args:\n radius (float): radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "fixed_sphere.set_torsional_patch_radius(radius=radius) # float\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "fixed_sphere.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = fixed_sphere.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = fixed_sphere.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = fixed_sphere.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = fixed_sphere.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = fixed_sphere.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = fixed_sphere.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = fixed_sphere.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "fixed_sphere.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "fixed_sphere.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "fixed_sphere.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "fixed_sphere.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "fixed_sphere.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "fixed_sphere.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "fixed_sphere.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "fixed_sphere.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "fixed_sphere.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "GroundPlane", "snippets": [ { "title": "GroundPlane", "description": "[summary]\n\n Args:\n prim_path (str): [description]\n name (str, optional): [description]. Defaults to \"ground_plane\".\n size (Optional[float], optional): [description]. Defaults to 5000.0.\n z_position (float, optional): [description]. Defaults to 0.\n scale (Optional[np.ndarray], optional): [description]. Defaults to None.\n visible (bool, optional): [description]. Defaults to True.\n color (Optional[np.ndarray], optional): [description]. Defaults to None.\n physics_material_path (Optional[PhysicsMaterial], optional): [description]. Defaults to None.\n visual_material (Optional[VisualMaterial], optional): [description]. Defaults to None.\n static_friction (float, optional): [description]. Defaults to 0.5.\n dynamic_friction (float, optional): [description]. Defaults to 0.5.\n restitution (float, optional): [description]. Defaults to 0.8.\n ", "snippet": "ground_plane = GroundPlane(prim_path=prim_path, # str\n name=\"ground_plane\", # str\n size=None, # typing.Union[float, NoneType]\n z_position=None, # typing.Union[float, NoneType]\n scale=None, # typing.Union[numpy.ndarray, NoneType]\n visible=None, # typing.Union[bool, NoneType]\n color=None, # typing.Union[numpy.ndarray, NoneType]\n physics_material=None, # typing.Union[omni.isaac.core.materials.physics_material.PhysicsMaterial, NoneType]\n visual_material=None) # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, NoneType]\n" }, { "title": "apply_physics_material", "description": "Used to apply physics material to the held prim and optionally its descendants.\n\n Args:\n physics_material (PhysicsMaterial): physics material to be applied to the held prim. This where you want to\n define friction, restitution..etc. Note: if a physics material is not\n defined, the defaults will be used from PhysX.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants\n materials, otherwise False. Defaults to False.\n ", "snippet": "ground_plane.apply_physics_material(physics_material=physics_material, # omni.isaac.core.materials.physics_material.PhysicsMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_physics_material", "description": "Returns the current applied physics material in case it was applied using apply_physics_material or not.\n\n Returns:\n PhysicsMaterial: the current applied physics material.\n ", "snippet": "applied_physics_material = ground_plane.get_applied_physics_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = ground_plane.get_default_state()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = ground_plane.get_world_pose()\n" }, { "title": "initialize", "description": "", "snippet": "ground_plane.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "ground_plane.is_valid()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "ground_plane.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "ground_plane.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "ground_plane.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "VisualCapsule", "snippets": [ { "title": "VisualCapsule", "description": "_summary_\n\n Args:\n prim_path (str): _description_\n name (str, optional): _description_. Defaults to \"visual_capsule\".\n position (Optional[Sequence[float]], optional): _description_. Defaults to None.\n translation (Optional[Sequence[float]], optional): _description_. Defaults to None.\n orientation (Optional[Sequence[float]], optional): _description_. Defaults to None.\n scale (Optional[Sequence[float]], optional): _description_. Defaults to None.\n visible (Optional[bool], optional): _description_. Defaults to None.\n color (Optional[np.ndarray], optional): _description_. Defaults to None.\n radius (Optional[float], optional): _description_. Defaults to None.\n height (Optional[float], optional): _description_. Defaults to None.\n visual_material (Optional[VisualMaterial], optional): _description_. Defaults to None.\n\n Raises:\n Exception: _description_", "snippet": "visual_capsule = VisualCapsule(prim_path=prim_path, # str\n name=\"visual_capsule\", # str\n position=None, # typing.Union[typing.Sequence[float], NoneType]\n translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None, # typing.Union[typing.Sequence[float], NoneType]\n scale=None, # typing.Union[typing.Sequence[float], NoneType]\n visible=None, # typing.Union[bool, NoneType]\n color=None, # typing.Union[numpy.ndarray, NoneType]\n radius=None, # typing.Union[float, NoneType]\n height=None, # typing.Union[float, NoneType]\n visual_material=None) # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, NoneType]\n" }, { "title": "get_height", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "height = visual_capsule.get_height()\n" }, { "title": "get_radius", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "radius = visual_capsule.get_radius()\n" }, { "title": "set_height", "description": "[summary]\n\n Args:\n height (float): [description]\n ", "snippet": "visual_capsule.set_height(height=height) # float\n" }, { "title": "set_radius", "description": "[summary]\n\n Args:\n radius (float): [description]\n ", "snippet": "visual_capsule.set_radius(radius=radius) # float\n" }, { "title": "apply_physics_material", "description": "Used to apply physics material to the held prim and optionally its descendants.\n\n Args:\n physics_material (PhysicsMaterial): physics material to be applied to the held prim. This where you want to\n define friction, restitution..etc. Note: if a physics material is not\n defined, the defaults will be used from PhysX.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants\n materials, otherwise False. Defaults to False.\n ", "snippet": "visual_capsule.apply_physics_material(physics_material=physics_material, # omni.isaac.core.materials.physics_material.PhysicsMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_physics_material", "description": "Returns the current applied physics material in case it was applied using apply_physics_material or not.\n\n Returns:\n PhysicsMaterial: the current applied physics material.\n ", "snippet": "applied_physics_material = visual_capsule.get_applied_physics_material()\n" }, { "title": "get_collision_approximation", "description": " Returns:\n str: approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "collision_approximation = visual_capsule.get_collision_approximation()\n" }, { "title": "get_collision_enabled", "description": " Returns:\n ", "snippet": "collision_enabled = visual_capsule.get_collision_enabled()\n" }, { "title": "get_contact_force_matrix", "description": " If the object is initialized with filter_paths_expr list, this method returns the contact forces between the prims \n in the view and the filter prims. i.e., a matrix of dimension (self._contact_view.num_filters, 3) \n where num_filters is the determined according to the filter_paths_expr parameter.\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (self._geometry_prim_view._contact_view.num_filters, 3).\n ", "snippet": "contact_force_matrix = visual_capsule.get_contact_force_matrix(dt=1.0) # float\n" }, { "title": "get_contact_offset", "description": " Returns:\n float: contact offset of the collision shape.\n ", "snippet": "contact_offset = visual_capsule.get_contact_offset()\n" }, { "title": "get_min_torsional_patch_radius", "description": " Returns:\n float: minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "min_torsional_patch_radius = visual_capsule.get_min_torsional_patch_radius()\n" }, { "title": "get_net_contact_forces", "description": " If contact forces of the prims in the view are tracked, this method returns the net contact forces on prims. \n i.e., a matrix of dimension (1, 3)\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (3).\n\n ", "snippet": "net_contact_forces = visual_capsule.get_net_contact_forces(dt=1.0) # float\n" }, { "title": "get_rest_offset", "description": " Returns:\n float: rest offset of the collision shape.\n ", "snippet": "rest_offset = visual_capsule.get_rest_offset()\n" }, { "title": "get_torsional_patch_radius", "description": " Returns:\n float: radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "torsional_patch_radius = visual_capsule.get_torsional_patch_radius()\n" }, { "title": "set_collision_approximation", "description": "\n Args:\n approximation_type (str): approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "visual_capsule.set_collision_approximation(approximation_type=approximation_type) # str\n" }, { "title": "set_collision_enabled", "description": "\n Args:\n ", "snippet": "visual_capsule.set_collision_enabled(enabled=enabled) # bool\n" }, { "title": "set_contact_offset", "description": " Args:\n offset (float): Contact offset of a collision shape. Allowed range [maximum(0, rest_offset), 0].\n Default value is -inf, means default is picked by simulation based on the shape extent.\n ", "snippet": "visual_capsule.set_contact_offset(offset=offset) # float\n" }, { "title": "set_min_torsional_patch_radius", "description": " Args:\n radius (float): minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "visual_capsule.set_min_torsional_patch_radius(radius=radius) # float\n" }, { "title": "set_rest_offset", "description": " Args:\n offset (float): Rest offset of a collision shape. Allowed range [-max_float, contact_offset.\n Default value is -inf, means default is picked by simulatiion. For rigid bodies its zero.\n ", "snippet": "visual_capsule.set_rest_offset(offset=offset) # float\n" }, { "title": "set_torsional_patch_radius", "description": " Args:\n radius (float): radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "visual_capsule.set_torsional_patch_radius(radius=radius) # float\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "visual_capsule.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = visual_capsule.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = visual_capsule.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = visual_capsule.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = visual_capsule.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = visual_capsule.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = visual_capsule.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = visual_capsule.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "visual_capsule.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "visual_capsule.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "visual_capsule.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "visual_capsule.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "visual_capsule.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "visual_capsule.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "visual_capsule.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "visual_capsule.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "visual_capsule.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "VisualCone", "snippets": [ { "title": "VisualCone", "description": "_summary_\n\n Args:\n prim_path (str): _description_\n name (str, optional): _description_. Defaults to \"visual_cone\".\n position (Optional[Sequence[float]], optional): _description_. Defaults to None.\n translation (Optional[Sequence[float]], optional): _description_. Defaults to None.\n orientation (Optional[Sequence[float]], optional): _description_. Defaults to None.\n scale (Optional[Sequence[float]], optional): _description_. Defaults to None.\n visible (Optional[bool], optional): _description_. Defaults to None.\n color (Optional[np.ndarray], optional): _description_. Defaults to None.\n radius (Optional[float], optional): _description_. Defaults to None.\n height (Optional[float], optional): _description_. Defaults to None.\n visual_material (Optional[VisualMaterial], optional): _description_. Defaults to None.\n\n Raises:\n Exception: _description_\n ", "snippet": "visual_cone = VisualCone(prim_path=prim_path, # str\n name=\"visual_cone\", # str\n position=None, # typing.Union[typing.Sequence[float], NoneType]\n translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None, # typing.Union[typing.Sequence[float], NoneType]\n scale=None, # typing.Union[typing.Sequence[float], NoneType]\n visible=None, # typing.Union[bool, NoneType]\n color=None, # typing.Union[numpy.ndarray, NoneType]\n radius=None, # typing.Union[float, NoneType]\n height=None, # typing.Union[float, NoneType]\n visual_material=None) # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, NoneType]\n" }, { "title": "get_height", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "height = visual_cone.get_height()\n" }, { "title": "get_radius", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "radius = visual_cone.get_radius()\n" }, { "title": "set_height", "description": "[summary]\n\n Args:\n height (float): [description]\n ", "snippet": "visual_cone.set_height(height=height) # float\n" }, { "title": "set_radius", "description": "[summary]\n\n Args:\n radius (float): [description]\n ", "snippet": "visual_cone.set_radius(radius=radius) # float\n" }, { "title": "apply_physics_material", "description": "Used to apply physics material to the held prim and optionally its descendants.\n\n Args:\n physics_material (PhysicsMaterial): physics material to be applied to the held prim. This where you want to\n define friction, restitution..etc. Note: if a physics material is not\n defined, the defaults will be used from PhysX.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants\n materials, otherwise False. Defaults to False.\n ", "snippet": "visual_cone.apply_physics_material(physics_material=physics_material, # omni.isaac.core.materials.physics_material.PhysicsMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_physics_material", "description": "Returns the current applied physics material in case it was applied using apply_physics_material or not.\n\n Returns:\n PhysicsMaterial: the current applied physics material.\n ", "snippet": "applied_physics_material = visual_cone.get_applied_physics_material()\n" }, { "title": "get_collision_approximation", "description": " Returns:\n str: approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "collision_approximation = visual_cone.get_collision_approximation()\n" }, { "title": "get_collision_enabled", "description": " Returns:\n ", "snippet": "collision_enabled = visual_cone.get_collision_enabled()\n" }, { "title": "get_contact_force_matrix", "description": " If the object is initialized with filter_paths_expr list, this method returns the contact forces between the prims \n in the view and the filter prims. i.e., a matrix of dimension (self._contact_view.num_filters, 3) \n where num_filters is the determined according to the filter_paths_expr parameter.\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (self._geometry_prim_view._contact_view.num_filters, 3).\n ", "snippet": "contact_force_matrix = visual_cone.get_contact_force_matrix(dt=1.0) # float\n" }, { "title": "get_contact_offset", "description": " Returns:\n float: contact offset of the collision shape.\n ", "snippet": "contact_offset = visual_cone.get_contact_offset()\n" }, { "title": "get_min_torsional_patch_radius", "description": " Returns:\n float: minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "min_torsional_patch_radius = visual_cone.get_min_torsional_patch_radius()\n" }, { "title": "get_net_contact_forces", "description": " If contact forces of the prims in the view are tracked, this method returns the net contact forces on prims. \n i.e., a matrix of dimension (1, 3)\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (3).\n\n ", "snippet": "net_contact_forces = visual_cone.get_net_contact_forces(dt=1.0) # float\n" }, { "title": "get_rest_offset", "description": " Returns:\n float: rest offset of the collision shape.\n ", "snippet": "rest_offset = visual_cone.get_rest_offset()\n" }, { "title": "get_torsional_patch_radius", "description": " Returns:\n float: radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "torsional_patch_radius = visual_cone.get_torsional_patch_radius()\n" }, { "title": "set_collision_approximation", "description": "\n Args:\n approximation_type (str): approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "visual_cone.set_collision_approximation(approximation_type=approximation_type) # str\n" }, { "title": "set_collision_enabled", "description": "\n Args:\n ", "snippet": "visual_cone.set_collision_enabled(enabled=enabled) # bool\n" }, { "title": "set_contact_offset", "description": " Args:\n offset (float): Contact offset of a collision shape. Allowed range [maximum(0, rest_offset), 0].\n Default value is -inf, means default is picked by simulation based on the shape extent.\n ", "snippet": "visual_cone.set_contact_offset(offset=offset) # float\n" }, { "title": "set_min_torsional_patch_radius", "description": " Args:\n radius (float): minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "visual_cone.set_min_torsional_patch_radius(radius=radius) # float\n" }, { "title": "set_rest_offset", "description": " Args:\n offset (float): Rest offset of a collision shape. Allowed range [-max_float, contact_offset.\n Default value is -inf, means default is picked by simulatiion. For rigid bodies its zero.\n ", "snippet": "visual_cone.set_rest_offset(offset=offset) # float\n" }, { "title": "set_torsional_patch_radius", "description": " Args:\n radius (float): radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "visual_cone.set_torsional_patch_radius(radius=radius) # float\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "visual_cone.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = visual_cone.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = visual_cone.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = visual_cone.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = visual_cone.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = visual_cone.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = visual_cone.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = visual_cone.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "visual_cone.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "visual_cone.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "visual_cone.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "visual_cone.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "visual_cone.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "visual_cone.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "visual_cone.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "visual_cone.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "visual_cone.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "VisualCuboid", "snippets": [ { "title": "VisualCuboid", "description": "_summary_\n\nArgs:\n prim_path (str): _description_\n name (str, optional): _description_. Defaults to \"visual_cube\".\n position (Optional[Sequence[float]], optional): _description_. Defaults to None.\n translation (Optional[Sequence[float]], optional): _description_. Defaults to None.\n orientation (Optional[Sequence[float]], optional): _description_. Defaults to None.\n scale (Optional[Sequence[float]], optional): _description_. Defaults to None.\n visible (Optional[bool], optional): _description_. Defaults to None.\n color (Optional[np.ndarray], optional): _description_. Defaults to None.\n size (Optional[float], optional): _description_. Defaults to None.\n visual_material (Optional[VisualMaterial], optional): _description_. Defaults to None.\n\nRaises:\n Exception: _description_", "snippet": "visual_cuboid = VisualCuboid(prim_path=prim_path, # str\n name=\"visual_cube\", # str\n position=None, # typing.Union[typing.Sequence[float], NoneType]\n translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None, # typing.Union[typing.Sequence[float], NoneType]\n scale=None, # typing.Union[typing.Sequence[float], NoneType]\n visible=None, # typing.Union[bool, NoneType]\n color=None, # typing.Union[numpy.ndarray, NoneType]\n size=None, # typing.Union[float, NoneType]\n visual_material=None) # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, NoneType]\n" }, { "title": "get_size", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "size = visual_cuboid.get_size()\n" }, { "title": "set_size", "description": "[summary]\n\n Args:\n size (float): [description]\n ", "snippet": "visual_cuboid.set_size(size=size) # float\n" }, { "title": "apply_physics_material", "description": "Used to apply physics material to the held prim and optionally its descendants.\n\n Args:\n physics_material (PhysicsMaterial): physics material to be applied to the held prim. This where you want to\n define friction, restitution..etc. Note: if a physics material is not\n defined, the defaults will be used from PhysX.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants\n materials, otherwise False. Defaults to False.\n ", "snippet": "visual_cuboid.apply_physics_material(physics_material=physics_material, # omni.isaac.core.materials.physics_material.PhysicsMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_physics_material", "description": "Returns the current applied physics material in case it was applied using apply_physics_material or not.\n\n Returns:\n PhysicsMaterial: the current applied physics material.\n ", "snippet": "applied_physics_material = visual_cuboid.get_applied_physics_material()\n" }, { "title": "get_collision_approximation", "description": " Returns:\n str: approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "collision_approximation = visual_cuboid.get_collision_approximation()\n" }, { "title": "get_collision_enabled", "description": " Returns:\n ", "snippet": "collision_enabled = visual_cuboid.get_collision_enabled()\n" }, { "title": "get_contact_force_matrix", "description": " If the object is initialized with filter_paths_expr list, this method returns the contact forces between the prims \n in the view and the filter prims. i.e., a matrix of dimension (self._contact_view.num_filters, 3) \n where num_filters is the determined according to the filter_paths_expr parameter.\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (self._geometry_prim_view._contact_view.num_filters, 3).\n ", "snippet": "contact_force_matrix = visual_cuboid.get_contact_force_matrix(dt=1.0) # float\n" }, { "title": "get_contact_offset", "description": " Returns:\n float: contact offset of the collision shape.\n ", "snippet": "contact_offset = visual_cuboid.get_contact_offset()\n" }, { "title": "get_min_torsional_patch_radius", "description": " Returns:\n float: minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "min_torsional_patch_radius = visual_cuboid.get_min_torsional_patch_radius()\n" }, { "title": "get_net_contact_forces", "description": " If contact forces of the prims in the view are tracked, this method returns the net contact forces on prims. \n i.e., a matrix of dimension (1, 3)\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (3).\n\n ", "snippet": "net_contact_forces = visual_cuboid.get_net_contact_forces(dt=1.0) # float\n" }, { "title": "get_rest_offset", "description": " Returns:\n float: rest offset of the collision shape.\n ", "snippet": "rest_offset = visual_cuboid.get_rest_offset()\n" }, { "title": "get_torsional_patch_radius", "description": " Returns:\n float: radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "torsional_patch_radius = visual_cuboid.get_torsional_patch_radius()\n" }, { "title": "set_collision_approximation", "description": "\n Args:\n approximation_type (str): approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "visual_cuboid.set_collision_approximation(approximation_type=approximation_type) # str\n" }, { "title": "set_collision_enabled", "description": "\n Args:\n ", "snippet": "visual_cuboid.set_collision_enabled(enabled=enabled) # bool\n" }, { "title": "set_contact_offset", "description": " Args:\n offset (float): Contact offset of a collision shape. Allowed range [maximum(0, rest_offset), 0].\n Default value is -inf, means default is picked by simulation based on the shape extent.\n ", "snippet": "visual_cuboid.set_contact_offset(offset=offset) # float\n" }, { "title": "set_min_torsional_patch_radius", "description": " Args:\n radius (float): minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "visual_cuboid.set_min_torsional_patch_radius(radius=radius) # float\n" }, { "title": "set_rest_offset", "description": " Args:\n offset (float): Rest offset of a collision shape. Allowed range [-max_float, contact_offset.\n Default value is -inf, means default is picked by simulatiion. For rigid bodies its zero.\n ", "snippet": "visual_cuboid.set_rest_offset(offset=offset) # float\n" }, { "title": "set_torsional_patch_radius", "description": " Args:\n radius (float): radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "visual_cuboid.set_torsional_patch_radius(radius=radius) # float\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "visual_cuboid.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = visual_cuboid.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = visual_cuboid.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = visual_cuboid.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = visual_cuboid.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = visual_cuboid.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = visual_cuboid.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = visual_cuboid.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "visual_cuboid.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "visual_cuboid.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "visual_cuboid.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "visual_cuboid.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "visual_cuboid.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "visual_cuboid.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "visual_cuboid.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "visual_cuboid.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "visual_cuboid.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "VisualCylinder", "snippets": [ { "title": "VisualCylinder", "description": "_summary_\n\n Args:\n prim_path (str): _description_\n name (str, optional): _description_. Defaults to \"visual_cylinder\".\n position (Optional[Sequence[float]], optional): _description_. Defaults to None.\n translation (Optional[Sequence[float]], optional): _description_. Defaults to None.\n orientation (Optional[Sequence[float]], optional): _description_. Defaults to None.\n scale (Optional[Sequence[float]], optional): _description_. Defaults to None.\n visible (Optional[bool], optional): _description_. Defaults to None.\n color (Optional[np.ndarray], optional): _description_. Defaults to None.\n radius (Optional[float], optional): _description_. Defaults to None.\n height (Optional[float], optional): _description_. Defaults to None.\n visual_material (Optional[VisualMaterial], optional): _description_. Defaults to None.\n\n Raises:\n Exception: _description_\n ", "snippet": "visual_cylinder = VisualCylinder(prim_path=prim_path, # str\n name=\"visual_cylinder\", # str\n position=None, # typing.Union[typing.Sequence[float], NoneType]\n translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None, # typing.Union[typing.Sequence[float], NoneType]\n scale=None, # typing.Union[typing.Sequence[float], NoneType]\n visible=None, # typing.Union[bool, NoneType]\n color=None, # typing.Union[numpy.ndarray, NoneType]\n radius=None, # typing.Union[float, NoneType]\n height=None, # typing.Union[float, NoneType]\n visual_material=None) # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, NoneType]\n" }, { "title": "get_height", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "height = visual_cylinder.get_height()\n" }, { "title": "get_radius", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "radius = visual_cylinder.get_radius()\n" }, { "title": "set_height", "description": "[summary]\n\n Args:\n height (float): [description]\n ", "snippet": "visual_cylinder.set_height(height=height) # float\n" }, { "title": "set_radius", "description": "[summary]\n\n Args:\n radius (float): [description]\n ", "snippet": "visual_cylinder.set_radius(radius=radius) # float\n" }, { "title": "apply_physics_material", "description": "Used to apply physics material to the held prim and optionally its descendants.\n\n Args:\n physics_material (PhysicsMaterial): physics material to be applied to the held prim. This where you want to\n define friction, restitution..etc. Note: if a physics material is not\n defined, the defaults will be used from PhysX.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants\n materials, otherwise False. Defaults to False.\n ", "snippet": "visual_cylinder.apply_physics_material(physics_material=physics_material, # omni.isaac.core.materials.physics_material.PhysicsMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_physics_material", "description": "Returns the current applied physics material in case it was applied using apply_physics_material or not.\n\n Returns:\n PhysicsMaterial: the current applied physics material.\n ", "snippet": "applied_physics_material = visual_cylinder.get_applied_physics_material()\n" }, { "title": "get_collision_approximation", "description": " Returns:\n str: approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "collision_approximation = visual_cylinder.get_collision_approximation()\n" }, { "title": "get_collision_enabled", "description": " Returns:\n ", "snippet": "collision_enabled = visual_cylinder.get_collision_enabled()\n" }, { "title": "get_contact_force_matrix", "description": " If the object is initialized with filter_paths_expr list, this method returns the contact forces between the prims \n in the view and the filter prims. i.e., a matrix of dimension (self._contact_view.num_filters, 3) \n where num_filters is the determined according to the filter_paths_expr parameter.\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (self._geometry_prim_view._contact_view.num_filters, 3).\n ", "snippet": "contact_force_matrix = visual_cylinder.get_contact_force_matrix(dt=1.0) # float\n" }, { "title": "get_contact_offset", "description": " Returns:\n float: contact offset of the collision shape.\n ", "snippet": "contact_offset = visual_cylinder.get_contact_offset()\n" }, { "title": "get_min_torsional_patch_radius", "description": " Returns:\n float: minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "min_torsional_patch_radius = visual_cylinder.get_min_torsional_patch_radius()\n" }, { "title": "get_net_contact_forces", "description": " If contact forces of the prims in the view are tracked, this method returns the net contact forces on prims. \n i.e., a matrix of dimension (1, 3)\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (3).\n\n ", "snippet": "net_contact_forces = visual_cylinder.get_net_contact_forces(dt=1.0) # float\n" }, { "title": "get_rest_offset", "description": " Returns:\n float: rest offset of the collision shape.\n ", "snippet": "rest_offset = visual_cylinder.get_rest_offset()\n" }, { "title": "get_torsional_patch_radius", "description": " Returns:\n float: radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "torsional_patch_radius = visual_cylinder.get_torsional_patch_radius()\n" }, { "title": "set_collision_approximation", "description": "\n Args:\n approximation_type (str): approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "visual_cylinder.set_collision_approximation(approximation_type=approximation_type) # str\n" }, { "title": "set_collision_enabled", "description": "\n Args:\n ", "snippet": "visual_cylinder.set_collision_enabled(enabled=enabled) # bool\n" }, { "title": "set_contact_offset", "description": " Args:\n offset (float): Contact offset of a collision shape. Allowed range [maximum(0, rest_offset), 0].\n Default value is -inf, means default is picked by simulation based on the shape extent.\n ", "snippet": "visual_cylinder.set_contact_offset(offset=offset) # float\n" }, { "title": "set_min_torsional_patch_radius", "description": " Args:\n radius (float): minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "visual_cylinder.set_min_torsional_patch_radius(radius=radius) # float\n" }, { "title": "set_rest_offset", "description": " Args:\n offset (float): Rest offset of a collision shape. Allowed range [-max_float, contact_offset.\n Default value is -inf, means default is picked by simulatiion. For rigid bodies its zero.\n ", "snippet": "visual_cylinder.set_rest_offset(offset=offset) # float\n" }, { "title": "set_torsional_patch_radius", "description": " Args:\n radius (float): radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "visual_cylinder.set_torsional_patch_radius(radius=radius) # float\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "visual_cylinder.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = visual_cylinder.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = visual_cylinder.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = visual_cylinder.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = visual_cylinder.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = visual_cylinder.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = visual_cylinder.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = visual_cylinder.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "visual_cylinder.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "visual_cylinder.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "visual_cylinder.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "visual_cylinder.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "visual_cylinder.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "visual_cylinder.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "visual_cylinder.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "visual_cylinder.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "visual_cylinder.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "VisualSphere", "snippets": [ { "title": "VisualSphere", "description": "_summary_\n\n Args:\n prim_path (str): _description_\n name (str, optional): _description_. Defaults to \"visual_sphere\".\n position (Optional[Sequence[float]], optional): _description_. Defaults to None.\n translation (Optional[Sequence[float]], optional): _description_. Defaults to None.\n orientation (Optional[Sequence[float]], optional): _description_. Defaults to None.\n scale (Optional[Sequence[float]], optional): _description_. Defaults to None.\n visible (Optional[bool], optional): _description_. Defaults to True.\n color (Optional[np.ndarray], optional): _description_. Defaults to None.\n radius (Optional[float], optional): _description_. Defaults to None.\n visual_material (Optional[VisualMaterial], optional): _description_. Defaults to None.\n\n Raises:\n Exception: _description_\n ", "snippet": "visual_sphere = VisualSphere(prim_path=prim_path, # str\n name=\"visual_sphere\", # str\n position=None, # typing.Union[typing.Sequence[float], NoneType]\n translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None, # typing.Union[typing.Sequence[float], NoneType]\n scale=None, # typing.Union[typing.Sequence[float], NoneType]\n visible=True, # typing.Union[bool, NoneType]\n color=None, # typing.Union[numpy.ndarray, NoneType]\n radius=None, # typing.Union[float, NoneType]\n visual_material=None) # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, NoneType]\n" }, { "title": "get_radius", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "radius = visual_sphere.get_radius()\n" }, { "title": "set_radius", "description": "[summary]\n\n Args:\n radius (float): [description]\n ", "snippet": "visual_sphere.set_radius(radius=radius) # float\n" }, { "title": "apply_physics_material", "description": "Used to apply physics material to the held prim and optionally its descendants.\n\n Args:\n physics_material (PhysicsMaterial): physics material to be applied to the held prim. This where you want to\n define friction, restitution..etc. Note: if a physics material is not\n defined, the defaults will be used from PhysX.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants\n materials, otherwise False. Defaults to False.\n ", "snippet": "visual_sphere.apply_physics_material(physics_material=physics_material, # omni.isaac.core.materials.physics_material.PhysicsMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_physics_material", "description": "Returns the current applied physics material in case it was applied using apply_physics_material or not.\n\n Returns:\n PhysicsMaterial: the current applied physics material.\n ", "snippet": "applied_physics_material = visual_sphere.get_applied_physics_material()\n" }, { "title": "get_collision_approximation", "description": " Returns:\n str: approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "collision_approximation = visual_sphere.get_collision_approximation()\n" }, { "title": "get_collision_enabled", "description": " Returns:\n ", "snippet": "collision_enabled = visual_sphere.get_collision_enabled()\n" }, { "title": "get_contact_force_matrix", "description": " If the object is initialized with filter_paths_expr list, this method returns the contact forces between the prims \n in the view and the filter prims. i.e., a matrix of dimension (self._contact_view.num_filters, 3) \n where num_filters is the determined according to the filter_paths_expr parameter.\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (self._geometry_prim_view._contact_view.num_filters, 3).\n ", "snippet": "contact_force_matrix = visual_sphere.get_contact_force_matrix(dt=1.0) # float\n" }, { "title": "get_contact_offset", "description": " Returns:\n float: contact offset of the collision shape.\n ", "snippet": "contact_offset = visual_sphere.get_contact_offset()\n" }, { "title": "get_min_torsional_patch_radius", "description": " Returns:\n float: minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "min_torsional_patch_radius = visual_sphere.get_min_torsional_patch_radius()\n" }, { "title": "get_net_contact_forces", "description": " If contact forces of the prims in the view are tracked, this method returns the net contact forces on prims. \n i.e., a matrix of dimension (1, 3)\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (3).\n\n ", "snippet": "net_contact_forces = visual_sphere.get_net_contact_forces(dt=1.0) # float\n" }, { "title": "get_rest_offset", "description": " Returns:\n float: rest offset of the collision shape.\n ", "snippet": "rest_offset = visual_sphere.get_rest_offset()\n" }, { "title": "get_torsional_patch_radius", "description": " Returns:\n float: radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "torsional_patch_radius = visual_sphere.get_torsional_patch_radius()\n" }, { "title": "set_collision_approximation", "description": "\n Args:\n approximation_type (str): approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "visual_sphere.set_collision_approximation(approximation_type=approximation_type) # str\n" }, { "title": "set_collision_enabled", "description": "\n Args:\n ", "snippet": "visual_sphere.set_collision_enabled(enabled=enabled) # bool\n" }, { "title": "set_contact_offset", "description": " Args:\n offset (float): Contact offset of a collision shape. Allowed range [maximum(0, rest_offset), 0].\n Default value is -inf, means default is picked by simulation based on the shape extent.\n ", "snippet": "visual_sphere.set_contact_offset(offset=offset) # float\n" }, { "title": "set_min_torsional_patch_radius", "description": " Args:\n radius (float): minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "visual_sphere.set_min_torsional_patch_radius(radius=radius) # float\n" }, { "title": "set_rest_offset", "description": " Args:\n offset (float): Rest offset of a collision shape. Allowed range [-max_float, contact_offset.\n Default value is -inf, means default is picked by simulatiion. For rigid bodies its zero.\n ", "snippet": "visual_sphere.set_rest_offset(offset=offset) # float\n" }, { "title": "set_torsional_patch_radius", "description": " Args:\n radius (float): radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "visual_sphere.set_torsional_patch_radius(radius=radius) # float\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "visual_sphere.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = visual_sphere.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = visual_sphere.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = visual_sphere.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = visual_sphere.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = visual_sphere.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = visual_sphere.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = visual_sphere.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "visual_sphere.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "visual_sphere.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "visual_sphere.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "visual_sphere.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "visual_sphere.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "visual_sphere.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "visual_sphere.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "visual_sphere.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "visual_sphere.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] } ] }, { "title": "PhysicsContext", "snippets": [ { "title": "PhysicsContext", "description": "Provides high level functions to deal with a physics scene and its settings. This will create a \n a PhysicsScene prim at the specified prim path in case there is no PhysicsScene present in the current\n stage. \n If there is a PhysicsScene present, it will discard the prim_path specified and sets the\n default settings on the current PhysicsScene found.\n\n Args:\n physics_dt (float, optional): specifies the physics_dt of the simulation. Defaults to 1.0 / 60.0.\n prim_path (Optional[str], optional): specifies the prim path to create a PhysicsScene at, \n only in the case where no PhysicsScene already defined. \n Defaults to \"/physicsScene\".\n set_defaults (bool, optional): set to True to use the defaults physics parameters\n [physics_dt = 1.0/ 60.0,\n gravity = -9.81 m / s\n ccd_enabled,\n stabilization_enabled,\n gpu dynamics turned off,\n broadcast type is MBP,\n solver type is TGS]. Defaults to True.\n backend (str, optional): specifies the backend to be used (numpy or torch). Defaults to numpy.\n device (Optional[str], optional): specifies the device to be used if running on the gpu with torch backend.\n\n Raises:\n Exception: If prim_path is not absolute.\n Exception: if prim_path already exists and its type is not a PhysicsScene.\n ", "snippet": "physics_context = PhysicsContext(physics_dt=None, # typing.Union[float, NoneType]\n prim_path=\"/physicsScene\", # str\n sim_params=None, # dict\n set_defaults=True, # bool\n backend=\"numpy\", # str\n device=None) # typing.Union[str, NoneType]\n" }, { "title": "enable_ccd", "description": "Enables a second broad phase after integration that makes it possible to prevent objects from tunneling\n through each other.\n\n Args:\n flag (bool): enables or diables ccd on the PhysicsScene\n\n Raises:\n Exception: If the prim path registered in context doesn't correspond to a valid prim path currently.\n ", "snippet": "physics_context.enable_ccd(flag=flag) # bool\n" }, { "title": "enable_flatcache", "description": "", "snippet": "physics_context.enable_flatcache(enable=enable)\n" }, { "title": "enable_gpu_dynamics", "description": "Enables gpu dynamics pipeline, required for deformables for instance.\n\n Args:\n flag (bool): enables or diables gpu dynamics on the PhysicsScene\n\n Raises:\n Exception: If the prim path registered in context doesn't correspond to a valid prim path currently.\n ", "snippet": "physics_context.enable_gpu_dynamics(flag=flag) # bool\n" }, { "title": "enable_stablization", "description": "Enables additional stabilization pass in the solver.\n\n Args:\n flag (bool): enables or diables stabilization on the PhysicsScene\n\n Raises:\n Exception: If the prim path registered in context doesn't correspond to a valid prim path currently.\n ", "snippet": "physics_context.enable_stablization(flag=flag) # bool\n" }, { "title": "get_bounce_threshold", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n float: [description]\n ", "snippet": "bounce_threshold = physics_context.get_bounce_threshold()\n" }, { "title": "get_broadphase_type", "description": "Gets current broadcast phase algorithm type.\n\n Raises:\n Exception: If the prim path registered in context doesn't correspond to a valid prim path currently.\n\n Returns:\n str: Broadcast phase algorithm used.\n ", "snippet": "broadphase_type = physics_context.get_broadphase_type()\n" }, { "title": "get_current_physics_scene_prim", "description": "Used to return the PhysicsScene prim in stage by traversing the stage.\n\n Returns:\n Optional[Usd.Prim]: returns a PhysicsScene prim if found in current stage. Otherwise, None.\n ", "snippet": "current_physics_scene_prim = physics_context.get_current_physics_scene_prim()\n" }, { "title": "get_enable_scene_query_support", "description": " Retrieves the Enable Scene Query Support attribute in Physx Scene\n\n Raises:\n Exception: [description]\n\n Returns:\n bool: enable scene query support attribute\n ", "snippet": "enable_scene_query_support = physics_context.get_enable_scene_query_support()\n" }, { "title": "get_friction_correlation_distance", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n float: [description]\n ", "snippet": "friction_correlation_distance = physics_context.get_friction_correlation_distance()\n" }, { "title": "get_friction_offset_threshold", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n float: [description]\n ", "snippet": "friction_offset_threshold = physics_context.get_friction_offset_threshold()\n" }, { "title": "get_gpu_found_lost_aggregate_pairs_capacity", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n int: [description]\n ", "snippet": "gpu_found_lost_aggregate_pairs_capacity = physics_context.get_gpu_found_lost_aggregate_pairs_capacity()\n" }, { "title": "get_gpu_found_lost_pairs_capacity", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n int: [description]\n ", "snippet": "gpu_found_lost_pairs_capacity = physics_context.get_gpu_found_lost_pairs_capacity()\n" }, { "title": "get_gpu_heap_capacity", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n int: [description]\n ", "snippet": "gpu_heap_capacity = physics_context.get_gpu_heap_capacity()\n" }, { "title": "get_gpu_max_num_partitions", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n int: [description]\n ", "snippet": "gpu_max_num_partitions = physics_context.get_gpu_max_num_partitions()\n" }, { "title": "get_gpu_max_particle_contacts", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n int: [description]\n ", "snippet": "gpu_max_particle_contacts = physics_context.get_gpu_max_particle_contacts()\n" }, { "title": "get_gpu_max_rigid_contact_count", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n int: [description]\n ", "snippet": "gpu_max_rigid_contact_count = physics_context.get_gpu_max_rigid_contact_count()\n" }, { "title": "get_gpu_max_rigid_patch_count", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n int: [description]\n ", "snippet": "gpu_max_rigid_patch_count = physics_context.get_gpu_max_rigid_patch_count()\n" }, { "title": "get_gpu_max_soft_body_contacts", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n int: [description]\n ", "snippet": "gpu_max_soft_body_contacts = physics_context.get_gpu_max_soft_body_contacts()\n" }, { "title": "get_gpu_temp_buffer_capacity", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n int: [description]\n ", "snippet": "gpu_temp_buffer_capacity = physics_context.get_gpu_temp_buffer_capacity()\n" }, { "title": "get_gpu_total_aggregate_pairs_capacity", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n int: [description]\n ", "snippet": "gpu_total_aggregate_pairs_capacity = physics_context.get_gpu_total_aggregate_pairs_capacity()\n" }, { "title": "get_gravity", "description": "Gets current gravity.\n\n Raises:\n Exception: If the prim path registered in context doesn't correspond to a valid prim path currently.\n\n Returns:\n Tuple[list, float]: returns a tuple, first element corresponds to the gravity direction vector and second element is the magnitude.\n ", "snippet": "gravity = physics_context.get_gravity()\n" }, { "title": "get_invert_collision_group_filter", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n int: [description]\n ", "snippet": "invert_collision_group_filter = physics_context.get_invert_collision_group_filter()\n" }, { "title": "get_physics_dt", "description": "Returns the current physics dt.\n\n Raises:\n Exception: If the prim path registered in context doesn't correspond to a valid prim path currently.\n\n Returns:\n float: physics dt.\n ", "snippet": "physics_dt = physics_context.get_physics_dt()\n" }, { "title": "get_physx_update_transformations_settings", "description": "Gets how physx syncs with the usd when transformations are updated.\n\n Returns:\n Tuple[bool, bool, bool, bool]: [update_to_fast_cache, update_to_usd, update_velocities_to_usd, output_velocities_local_space]\n ", "snippet": "physx_update_transformations_settings = physics_context.get_physx_update_transformations_settings()\n" }, { "title": "get_solver_type", "description": "Gets current solver type.\n\n Raises:\n Exception: If the prim path registered in context doesn't correspond to a valid prim path currently.\n\n Returns:\n str: solver used for simulation.\n ", "snippet": "solver_type = physics_context.get_solver_type()\n" }, { "title": "is_ccd_enabled", "description": "Checks if ccd is enabled.\n\n Raises:\n Exception: If the prim path registered in context doesn't correspond to a valid prim path currently.\n\n Returns:\n bool: True if ccd is enabled, otherwise False.\n ", "snippet": "physics_context.is_ccd_enabled()\n" }, { "title": "is_gpu_dynamics_enabled", "description": "Checks if Gpu Dynamics is enabled.\n\n Raises:\n Exception: If the prim path registered in context doesn't correspond to a valid prim path currently.\n\n Returns:\n bool: True if Gpu Dynamics is enabled, otherwise False.\n ", "snippet": "physics_context.is_gpu_dynamics_enabled()\n" }, { "title": "is_stablization_enabled", "description": "Checks if stabilization is enabled.\n\n Raises:\n Exception: If the prim path registered in context doesn't correspond to a valid prim path currently.\n\n Returns:\n bool: True if stabilization is enabled, otherwise False.\n ", "snippet": "physics_context.is_stablization_enabled()\n" }, { "title": "set_bounce_threshold", "description": "[summary]\n\n Args:\n value (float): [description]\n\n Raises:\n Exception: [description]\n ", "snippet": "physics_context.set_bounce_threshold(value=value) # float\n" }, { "title": "set_broadphase_type", "description": "Broadcast phase algorithm used in simulation.\n\n Args:\n broadcast_type (str): type of broadcasting to be used, can be \"MBP\"\n\n Raises:\n Exception: If the prim path registered in context doesn't correspond to a valid prim path currently.\n ", "snippet": "physics_context.set_broadphase_type(broadcast_type=broadcast_type) # str\n" }, { "title": "set_enable_scene_query_support", "description": " Sets the Enable Scene Query Support attribute in Physx Scene\n\n Args:\n enable_scene_query_support (bool): Whether to enable scene query support\n\n Raises:\n Exception: [description]\n ", "snippet": "physics_context.set_enable_scene_query_support(enable_scene_query_support=enable_scene_query_support) # bool\n" }, { "title": "set_friction_correlation_distance", "description": "[summary]\n\n Args:\n value (float): [description]\n\n Raises:\n Exception: [description]\n ", "snippet": "physics_context.set_friction_correlation_distance(value=value) # float\n" }, { "title": "set_friction_offset_threshold", "description": "[summary]\n\n Args:\n value (float): [description]\n\n Raises:\n Exception: [description]\n ", "snippet": "physics_context.set_friction_offset_threshold(value=value) # float\n" }, { "title": "set_gpu_found_lost_aggregate_pairs_capacity", "description": "[summary]\n\n Args:\n value (int): [description]\n\n Raises:\n Exception: [description]\n ", "snippet": "physics_context.set_gpu_found_lost_aggregate_pairs_capacity(value=value) # int\n" }, { "title": "set_gpu_found_lost_pairs_capacity", "description": "[summary]\n\n Args:\n value (int): [description]\n\n Raises:\n Exception: [description]\n ", "snippet": "physics_context.set_gpu_found_lost_pairs_capacity(value=value) # int\n" }, { "title": "set_gpu_heap_capacity", "description": "[summary]\n\n Args:\n value (int): [description]\n\n Raises:\n Exception: [description]\n ", "snippet": "physics_context.set_gpu_heap_capacity(value=value) # int\n" }, { "title": "set_gpu_max_num_partitions", "description": "[summary]\n\n Args:\n value (int): [description]\n\n Raises:\n Exception: [description]\n ", "snippet": "physics_context.set_gpu_max_num_partitions(value=value) # int\n" }, { "title": "set_gpu_max_particle_contacts", "description": "[summary]\n\n Args:\n value (int): [description]\n\n Raises:\n Exception: [description]\n ", "snippet": "physics_context.set_gpu_max_particle_contacts(value=value) # int\n" }, { "title": "set_gpu_max_rigid_contact_count", "description": "[summary]\n\n Args:\n value (int): [description]\n\n Raises:\n Exception: [description]\n ", "snippet": "physics_context.set_gpu_max_rigid_contact_count(value=value) # int\n" }, { "title": "set_gpu_max_rigid_patch_count", "description": "[summary]\n\n Args:\n value (int): [description]\n\n Raises:\n Exception: [description]\n ", "snippet": "physics_context.set_gpu_max_rigid_patch_count(value=value) # int\n" }, { "title": "set_gpu_max_soft_body_contacts", "description": "[summary]\n\n Args:\n value (int): [description]\n\n Raises:\n Exception: [description]\n ", "snippet": "physics_context.set_gpu_max_soft_body_contacts(value=value) # int\n" }, { "title": "set_gpu_temp_buffer_capacity", "description": "[summary]\n\n Args:\n value (int): [description]\n\n Raises:\n Exception: [description]\n ", "snippet": "physics_context.set_gpu_temp_buffer_capacity(value=value) # int\n" }, { "title": "set_gpu_total_aggregate_pairs_capacity", "description": "[summary]\n\n Args:\n value (int): [description]\n\n Raises:\n Exception: [description]\n ", "snippet": "physics_context.set_gpu_total_aggregate_pairs_capacity(value=value) # int\n" }, { "title": "set_gravity", "description": "sets the gravity direction and magnitude.\n\n Args:\n value (float): gravity value to be used in simulation.\n\n Raises:\n Exception: If the prim path registered in context doesn't correspond to a valid prim path currently.\n ", "snippet": "physics_context.set_gravity(value=value) # float\n" }, { "title": "set_invert_collision_group_filter", "description": "[summary]\n\n Args:\n invert_collision_group_filter (bool): [description]\n\n Raises:\n Exception: [description]\n ", "snippet": "physics_context.set_invert_collision_group_filter(invert_collision_group_filter=invert_collision_group_filter) # bool\n" }, { "title": "set_physics_dt", "description": "Sets the physics dt on the PhysicsScene\n\n Args:\n dt (float, optional): physics dt. Defaults to 1.0/60.0.\n substeps (int, optional): number of physics steps to run for before rendering a frame. Defaults to 1.\n\n Raises:\n Exception: If the prim path registered in context doesn't correspond to a valid prim path currently.\n ValueError: Physics dt must be a >= 0.\n ValueError: Physics dt must be a <= 1.0.\n ", "snippet": "physics_context.set_physics_dt(dt=0.016666666666666666, # float\n substeps=1) # int\n" }, { "title": "set_physx_update_transformations_settings", "description": "Sets how physx syncs with the usd when transformations are updated.\n\n Args:\n update_to_fast_cache (bool, optional): Uses Fast cache if set to True. Defaults to True.\n update_to_usd (bool, optional): Updates to USD the transformations. Defaults to True.\n update_velocities_to_usd (bool, optional): Updates Velocities to USD. Defaults to True.\n output_velocities_local_space (bool, optional): Output the velocities in the local frame and not the world frame. Defaults to False.\n ", "snippet": "physics_context.set_physx_update_transformations_settings(update_to_fast_cache=None, # typing.Union[bool, NoneType]\n update_to_usd=None, # typing.Union[bool, NoneType]\n update_velocities_to_usd=None, # typing.Union[bool, NoneType]\n output_velocities_local_space=None) # typing.Union[bool, NoneType]\n" }, { "title": "set_solver_type", "description": "solver used for simulation.\n\n Args:\n solver_type (str): can be \"TGS\" or \"PGS\". for references look at..\n\n Raises:\n Exception: If the prim path registered in context doesn't correspond to a valid prim path currently.\n ", "snippet": "physics_context.set_solver_type(solver_type=solver_type) # str\n" }, { "title": "warm_start", "description": "", "snippet": "physics_context.warm_start()\n" } ] }, { "title": "Prims", "snippets": [ { "title": "BaseSensor", "snippets": [ { "title": "BaseSensor", "description": "", "snippet": "base_sensor = BaseSensor(prim_path=prim_path, # str\n name=\"base_sensor\", # str\n position=None, # typing.Union[typing.Sequence[float], NoneType]\n translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None, # typing.Union[typing.Sequence[float], NoneType]\n scale=None, # typing.Union[typing.Sequence[float], NoneType]\n visible=None) # typing.Union[bool, NoneType]\n" }, { "title": "initialize", "description": "", "snippet": "base_sensor.initialize(physics_sim_view=None)\n" }, { "title": "post_reset", "description": "", "snippet": "base_sensor.post_reset()\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "base_sensor.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = base_sensor.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = base_sensor.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = base_sensor.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = base_sensor.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = base_sensor.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = base_sensor.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = base_sensor.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "base_sensor.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "base_sensor.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "base_sensor.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "base_sensor.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "base_sensor.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "base_sensor.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "base_sensor.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "base_sensor.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "base_sensor.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "ClothPrim", "snippets": [ { "title": "ClothPrim", "description": "Cloth primitive object provide functionalities to create and control cloth parameters", "snippet": "cloth_prim = ClothPrim(prim_path=prim_path, # str\n particle_system=particle_system, # omni.isaac.core.prims.soft.particle_system.ParticleSystem\n particle_material=None, # typing.Union[omni.isaac.core.materials.particle_material.ParticleMaterial, NoneType]\n name=\"cloth\", # typing.Union[str, NoneType]\n position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None, # typing.Union[typing.Sequence[float], NoneType]\n scale=None, # typing.Union[typing.Sequence[float], NoneType]\n visible=None, # typing.Union[bool, NoneType]\n particle_mass=0.01, # typing.Union[float, NoneType]\n pressure=None, # typing.Union[float, NoneType]\n particle_group=0, # typing.Union[int, NoneType]\n self_collision=True, # typing.Union[bool, NoneType]\n self_collision_filter=True, # typing.Union[bool, NoneType]\n stretch_stiffness=None, # typing.Union[float, NoneType]\n bend_stiffness=None, # typing.Union[float, NoneType]\n shear_stiffness=None, # typing.Union[float, NoneType]\n spring_damping=None) # typing.Union[float, NoneType]\n" }, { "title": "get_cloth_bend_stiffness", "description": " \n Reports a single value that would be used to generate the stiffnesses. This API does not report the actually created stiffnesses.\n Returns:\n float: The bend stiffness.\n ", "snippet": "cloth_bend_stiffness = cloth_prim.get_cloth_bend_stiffness()\n" }, { "title": "get_cloth_damping", "description": " \n Reports a single value that would be used to generate the dampings. This API does not report the actually created dampings.\n Returns:\n float: The spring damping.\n ", "snippet": "cloth_damping = cloth_prim.get_cloth_damping()\n" }, { "title": "get_cloth_shear_stiffness", "description": " \n Reports a single value that would be used to generate the stiffnesses. This API does not report the actually created stiffnesses.\n Returns:\n float: The shear stiffness.\n ", "snippet": "cloth_shear_stiffness = cloth_prim.get_cloth_shear_stiffness()\n" }, { "title": "get_cloth_stretch_stiffness", "description": " \n Reports a single value that would be used to generate the stiffnesses. This API does not report the actually created stiffnesses.\n Returns:\n float: The stretch stiffness.\n ", "snippet": "cloth_stretch_stiffness = cloth_prim.get_cloth_stretch_stiffness()\n" }, { "title": "get_current_dynamic_state", "description": "Return the DynamicState that contains the position and orientation of the cloth prim\n\n Returns:\n DynamicState:\n position (np.ndarray, optional): \n position in the world frame of the prim. shape is (3, ). \n Defaults to None, which means left unchanged.\n orientation (np.ndarray, optional): \n quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "current_dynamic_state = cloth_prim.get_current_dynamic_state()\n" }, { "title": "get_particle_group", "description": " Returns:\n bool: self collision.\n ", "snippet": "particle_group = cloth_prim.get_particle_group()\n" }, { "title": "get_pressure", "description": " Returns:\n float: pressure value.\n ", "snippet": "pressure = cloth_prim.get_pressure()\n" }, { "title": "get_self_collision", "description": " Returns:\n bool: self collision.\n ", "snippet": "self_collision = cloth_prim.get_self_collision()\n" }, { "title": "get_self_collision_filter", "description": " Returns:\n bool: self collision filter.\n ", "snippet": "self_collision_filter = cloth_prim.get_self_collision_filter()\n" }, { "title": "get_spring_damping", "description": " \n Gets damping values of spring constraints\n Returns:\n Union[np.ndarray, torch.Tensor]: The spring damping.\n ", "snippet": "spring_damping = cloth_prim.get_spring_damping()\n" }, { "title": "get_stretch_stiffness", "description": " Gets stretch stiffness values of spring constraints\n Returns:\n float: The stretch stiffness.\n ", "snippet": "stretch_stiffness = cloth_prim.get_stretch_stiffness()\n" }, { "title": "set_cloth_bend_stiffness", "description": "Sets a single bend stiffness value to all springs constraints in the cloth\n Args:\n stiffness (float): The cloth springs bend stiffness value.\n Range: [0 , inf), Units: force/distance = mass/second/second\n ", "snippet": "cloth_prim.set_cloth_bend_stiffness(stiffness=stiffness) # float\n" }, { "title": "set_cloth_damping", "description": "Sets a single damping value to all springs constraints in the cloth\n Args:\n damping (float): The cloth springs damping value.\n Range: [0 , inf), Units: force/velocity = mass/second\n ", "snippet": "cloth_prim.set_cloth_damping(damping=damping) # float\n" }, { "title": "set_cloth_shear_stiffness", "description": "Sets a single shear stiffness value to all springs constraints in the cloth\n Args:\n stiffness (float): The cloth springs shear stiffness value.\n Range: [0 , inf), Units: force/distance = mass/second/second\n ", "snippet": "cloth_prim.set_cloth_shear_stiffness(stiffness=stiffness) # float\n" }, { "title": "set_cloth_stretch_stiffness", "description": "Sets a single stretch stiffness value to all springs constraints in the cloth\n Args:\n stiffness (Union[np.ndarray, torch.Tensor]): The cloth springs stretch stiffness value.\n Range: [0 , inf), Units: force/distance = mass/second/second\n ", "snippet": "cloth_prim.set_cloth_stretch_stiffness(stiffness=stiffness) # typing.Union[numpy.ndarray, torch.Tensor]\n" }, { "title": "set_particle_group", "description": " Args:\n particle_group(int): particle group.\n ", "snippet": "cloth_prim.set_particle_group(particle_group=particle_group) # int\n" }, { "title": "set_pressure", "description": " Args:\n pressure(float): pressure value.\n ", "snippet": "cloth_prim.set_pressure(pressure=pressure) # float\n" }, { "title": "set_self_collision", "description": " Args:\n self_collision(bool): self collision.\n ", "snippet": "cloth_prim.set_self_collision(self_collision=self_collision) # bool\n" }, { "title": "set_self_collision_filter", "description": " Args:\n self_collision_filter(bool): self collision filter.\n ", "snippet": "cloth_prim.set_self_collision_filter(self_collision_filter=self_collision_filter) # bool\n" }, { "title": "set_spring_damping", "description": " Sets damping values of spring constraints in the cloth\n Args:\n damping (List[float]): The damping values of springs.\n Range: [0 , inf), Units: force/distance = mass/second\n ", "snippet": "cloth_prim.set_spring_damping(damping=damping) # typing.Union[numpy.ndarray, torch.Tensor]\n" }, { "title": "set_stretch_stiffness", "description": " Sets stretch stiffness values of spring constraints in the cloth\n It represents a stiffness for linear springs placed between particles to counteract stretching.\n\n Args:\n stiffness (Union[np.ndarray, torch.Tensor]): The stretch stiffnesses.\n Range: [0 , inf), Units: force/distance = mass/second/second\n ", "snippet": "cloth_prim.set_stretch_stiffness(stiffness=stiffness) # typing.Union[numpy.ndarray, torch.Tensor]\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "cloth_prim.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = cloth_prim.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = cloth_prim.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = cloth_prim.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = cloth_prim.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = cloth_prim.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = cloth_prim.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = cloth_prim.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "cloth_prim.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "cloth_prim.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "cloth_prim.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "cloth_prim.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "cloth_prim.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "cloth_prim.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "cloth_prim.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "cloth_prim.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "cloth_prim.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "ClothPrimView", "snippets": [ { "title": "ClothPrimView", "description": "The view class for cloth prims.", "snippet": "cloth_prim_view = ClothPrimView(prim_paths_expr=prim_paths_expr, # str\n particle_systems=None, # typing.Union[numpy.ndarray, torch.Tensor]\n particle_materials=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n name=\"cloth_prim_view\", # str\n reset_xform_properties=True, # bool\n positions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n translations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n scales=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n visibilities=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n particle_masses=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n pressures=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n particle_groups=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n self_collisions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n self_collision_filters=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n stretch_stiffnesses=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n bend_stiffnesses=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n shear_stiffnesses=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n spring_dampings=None) # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n" }, { "title": "get_cloths_bend_stiffnesses", "description": "Gets the value of bend stiffness set to all the springs within cloths indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: bend stiffness tensor with shape (M, )\n ", "snippet": "cloths_bend_stiffnesses = cloth_prim_view.get_cloths_bend_stiffnesses(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_cloths_dampings", "description": "Gets the value of damping set for all the springs within cloths indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: damping tensor with shape (M, )\n ", "snippet": "cloths_dampings = cloth_prim_view.get_cloths_dampings(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_cloths_shear_stiffnesses", "description": "Gets the value of shear stiffness set to all the springs within cloths indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: shear stiffness tensor with shape (M, )\n ", "snippet": "cloths_shear_stiffnesses = cloth_prim_view.get_cloths_shear_stiffnesses(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_cloths_stretch_stiffnesses", "description": "Gets the value of stretch stiffness set to all the springs within cloths indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: stretch stiffness tensor with shape (M, )\n ", "snippet": "cloths_stretch_stiffnesses = cloth_prim_view.get_cloths_stretch_stiffnesses(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_particle_groups", "description": "Gets the particle groups of the cloths indicated by the indices.\n \n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: particle groups with shape (M, ).\n ", "snippet": "particle_groups = cloth_prim_view.get_particle_groups(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_particle_masses", "description": "Gets the particle masses for the cloths indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: mass tensor with shape (M, max_particles_per_cloth)\n ", "snippet": "particle_masses = cloth_prim_view.get_particle_masses(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_pressures", "description": "Gets the pressures of the cloths indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: cloths pressure with shape (M, ).\n ", "snippet": "pressures = cloth_prim_view.get_pressures(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_self_collision_filters", "description": "Gets the self collision filters for the cloths indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: the self collision filters tensor with shape (M, )\n ", "snippet": "self_collision_filters = cloth_prim_view.get_self_collision_filters(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_self_collisions", "description": "Gets the self collision for the cloths indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: the self collision tensor with shape (M, )\n ", "snippet": "self_collisions = cloth_prim_view.get_self_collisions(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_spring_dampings", "description": "Gets the spring damping for the cloths indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: damping tensor with shape (M, max_springs_per_cloth)\n ", "snippet": "spring_dampings = cloth_prim_view.get_spring_dampings(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_stretch_stiffnesses", "description": "Gets the spring stretch stiffness for the cloths indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: stiffness tensor with shape (M, max_springs_per_cloth)\n ", "snippet": "stretch_stiffnesses = cloth_prim_view.get_stretch_stiffnesses(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_velocities", "description": "Gets the particle velocities for the cloths indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: velocity tensor with shape (M, max_particles_per_cloth, 3)\n ", "snippet": "velocities = cloth_prim_view.get_velocities(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_world_positions", "description": "Gets the particle world positions for the cloths indicated by the indices.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: position tensor with shape (M, max_particles_per_cloth, 3)\n ", "snippet": "world_positions = cloth_prim_view.get_world_positions(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "initialize", "description": "Create a physics simulation view if not passed and creates a rigid body view in physX.\n\n Args:\n physics_sim_view (omni.physics.tensors.SimulationView, optional): current physics simulation view. Defaults to None.\n ", "snippet": "cloth_prim_view.initialize(physics_sim_view=None) # omni.physics.tensors.bindings._physicsTensors.SimulationView\n" }, { "title": "is_physics_handle_valid", "description": " Returns:\n bool: True if the physics handle of the view is valid (i.e physics is initialized for the view). Otherwise False.\n ", "snippet": "cloth_prim_view.is_physics_handle_valid()\n" }, { "title": "set_cloths_bend_stiffnesses", "description": "Sets a single value of bend stiffnesses to all the springs within cloths indicated by the indices.\n\n Args:\n values (Union[np.ndarray, torch.Tensor]): cloth spring bend stiffness values with the shape (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "cloth_prim_view.set_cloths_bend_stiffnesses(values=values, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_cloths_dampings", "description": "Sets a single value of damping to all the springs within cloths indicated by the indices.\n\n Args:\n values (Union[np.ndarray, torch.Tensor]): cloth spring damping with the shape (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "cloth_prim_view.set_cloths_dampings(values=values, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_cloths_shear_stiffnesses", "description": "Sets a single value of shear stiffnesses to all the springs within cloths indicated by the indices.\n\n Args:\n values (Union[np.ndarray, torch.Tensor]): cloth spring shear stiffness values with the shape (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "cloth_prim_view.set_cloths_shear_stiffnesses(values=values, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_cloths_stretch_stiffnesses", "description": "Sets a single value of stretch stiffnesses to all the springs within cloths indicated by the indices.\n\n Args:\n values (Union[np.ndarray, torch.Tensor]): cloth spring stretch stiffness values with the shape (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "cloth_prim_view.set_cloths_stretch_stiffnesses(values=values, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_particle_groups", "description": "Sets the particle group of the cloths indicated by the indices.\n\n Args:\n particle_groups (Union[np.ndarray, torch.Tensor]): particle group with shape (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "cloth_prim_view.set_particle_groups(particle_groups=particle_groups, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_particle_masses", "description": "Sets the particle masses for the cloths indicated by the indices.\n\n Args:\n masses (Union[np.ndarray, torch.Tensor]): cloth particle masses with the shape \n (M, max_particles_per_cloth, 3).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "cloth_prim_view.set_particle_masses(masses=masses, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_pressures", "description": "Sets the pressures of the cloths indicated by the indices.\n\n Args:\n pressures (Union[np.ndarray, torch.Tensor]): cloths pressure with shape (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "cloth_prim_view.set_pressures(pressures=pressures, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_self_collision_filters", "description": "Sets the self collision filters for the cloths indicated by the indices.\n\n Args:\n self_collision_filters (Union[np.ndarray, torch.Tensor]): self collision filters with the shape (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "cloth_prim_view.set_self_collision_filters(self_collision_filters=self_collision_filters, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_self_collisions", "description": "Sets the self collision flags for the cloths indicated by the indices.\n\n Args:\n self_collisions (Union[np.ndarray, torch.Tensor]): self collision flag with the shape (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "cloth_prim_view.set_self_collisions(self_collisions=self_collisions, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_spring_dampings", "description": "Sets the spring damping for the cloths indicated by the indices.\n\n Args:\n damping (Union[np.ndarray, torch.Tensor]): cloth spring damping with the shape \n (M, max_springs_per_cloth).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "cloth_prim_view.set_spring_dampings(damping=damping, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_stretch_stiffnesses", "description": "Sets the spring stretch stiffness values for springs within the cloths indicated by the indices.\n\n Args:\n stiffness (Union[np.ndarray, torch.Tensor]): cloth spring stiffness with the shape (M, max_springs_per_cloth).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "cloth_prim_view.set_stretch_stiffnesses(stiffness=stiffness, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_velocities", "description": "Sets the particle velocities for the cloths indicated by the indices.\n\n Args:\n velocities (Union[np.ndarray, torch.Tensor]): particle velocities with the shape \n (M, max_particles_per_cloth, 3).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "cloth_prim_view.set_velocities(velocities=velocities, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_world_positions", "description": "Sets the particle world positions for the cloths indicated by the indices.\n\n Args:\n positions (Union[np.ndarray, torch.Tensor]): particle positions with the shape \n (M, max_particles_per_cloth, 3).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indices to specify which cloth prims to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "cloth_prim_view.set_world_positions(positions=positions, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "apply_visual_materials", "description": "Used to apply visual material to the prims and optionally its prim descendants.\n\n Args:\n visual_materials (Union[VisualMaterial, List[VisualMaterial]]): visual materials to be applied to the prims. Currently supports\n PreviewSurface, OmniPBR and OmniGlass. If a list is provided then\n its size has to be equal the view's size or indices size. \n If one material is provided it will be applied to all prims in the view.\n weaker_than_descendants (Optional[Union[bool, List[bool]]], optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False. \n If a list of visual materials is provided then a list\n has to be provided with the same size for this arg as well.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Raises:\n Exception: length of visual materials != length of prims indexed\n Exception: length of visual materials != length of weaker descendants bools arg\n ", "snippet": "cloth_prim_view.apply_visual_materials(visual_materials=visual_materials, # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, typing.List[omni.isaac.core.materials.visual_material.VisualMaterial]]\n weaker_than_descendants=None, # typing.Union[bool, typing.List[bool], NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_applied_visual_materials", "description": "\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n List[VisualMaterial]: a list of the current applied visual materials to the prims if its type is currently supported.\n ", "snippet": "applied_visual_materials = cloth_prim_view.get_applied_visual_materials(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimViewState: returns the default state of the prims (positions and orientations) that is used after each reset.\n ", "snippet": "default_state = cloth_prim_view.get_default_state()\n" }, { "title": "get_local_poses", "description": "Gets prim poses in the view with respect to the local's frame (the prim's parent frame).\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: \n first index is translations in the local frame of the prims. shape is (M, 3). \n second index is quaternion orientations in the local frame of the prims.\n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n ", "snippet": "local_poses = cloth_prim_view.get_local_poses(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_local_scales", "description": "Gets prim scales in the view with respect to the local frame (the parent's frame).\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: scales applied to the prim's dimensions in the local frame. shape is (M, 3).\n ", "snippet": "local_scales = cloth_prim_view.get_local_scales(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_visibilities", "description": "Returns the current visibilities of the prims in stage.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Shape (M,) with type bool, where each item holds True \n if the prim is visible in stage. False otherwise.\n ", "snippet": "visibilities = cloth_prim_view.get_visibilities(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_world_poses", "description": " Returns the poses (positions and orientations) of the prims in the view with respect to the world frame.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: first index is positions in the world frame of the prims. shape is (M, 3). \n second index is quaternion orientations in the world frame of the prims.\n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n ", "snippet": "world_poses = cloth_prim_view.get_world_poses(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_world_scales", "description": "Gets prim scales in the view with respect to the world's frame.\n\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: scales applied to the prim's dimensions in the world frame. shape is (M, 3).\n ", "snippet": "world_scales = cloth_prim_view.get_world_scales(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "initialize", "description": "", "snippet": "cloth_prim_view.initialize(physics_sim_view=None) # omni.physics.tensors.bindings._physicsTensors.SimulationView\n" }, { "title": "is_valid", "description": " Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n bool: True if all prim paths specified in the view correspond to a valid prim in stage. False otherwise.\n ", "snippet": "cloth_prim_view.is_valid(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "is_visual_material_applied", "description": " Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n List[bool]: True if there is a visual material applied is applied to the corresponding prim in the view. False otherwise.\n ", "snippet": "cloth_prim_view.is_visual_material_applied(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "post_reset", "description": "Resets the prims to its default state (positions and orientations).\n ", "snippet": "cloth_prim_view.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prims (positions and orientations), that will be used after each reset.\n\n Args:\n positions (Optional[np.ndarray], optional): positions in the world frame of the prim. shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[np.ndarray], optional): quaternion orientations in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "cloth_prim_view.set_default_state(positions=None, # typing.Union[numpy.ndarray, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_local_poses", "description": "Sets prim poses in the view with respect to the local frame (the prim's parent frame).\n\n Args:\n translations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n translations in the local frame of the prims\n (with respect to its parent prim). shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n quaternion orientations in the local frame of the prims. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "cloth_prim_view.set_local_poses(translations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_local_scales", "description": "Sets prim scales in the view with respect to the local frame (the prim's parent frame).\n\n Args:\n scales (Optional[Union[np.ndarray, torch.Tensor]]): scales to be applied to the prim's dimensions in the view. \n shape is (M, 3).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "cloth_prim_view.set_local_scales(scales=scales, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_visibilities", "description": "Sets the visibilities of the prims in stage.\n\n Args:\n visibilities (Union[np.ndarray, torch.Tensor]): flag to set the visibilities of the usd prims in stage. \n Shape (M,). Where M <= size of the encapsulated prims in the view.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "cloth_prim_view.set_visibilities(visibilities=visibilities, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_world_poses", "description": "Sets prim poses in the view with respect to the world's frame.\n\n Args:\n positions (Optional[Union[np.ndarray, torch.Tensor]], optional): positions in the world frame of the prims. shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): quaternion orientations in the world frame of the prims. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "cloth_prim_view.set_world_poses(positions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" } ] }, { "title": "GeometryPrim", "snippets": [ { "title": "GeometryPrim", "description": "Provides high level functions to deal with a Geom prim and its attributes/ properties.\n The prim_path should correspond to type UsdGeom.Cube, UsdGeom.Capsule, UsdGeom.Cone, UsdGeom.Cylinder,\n UsdGeom.Sphere or UsdGeom.Mesh.\n\n Args:\n prim_path (str): prim path of the Prim to encapsulate or create.\n name (str, optional): shortname to be used as a key by Scene class.\n Note: needs to be unique if the object is added to the Scene.\n Defaults to \"xform_prim\".\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world/ local frame of the prim\n (depends if translation or position is specified).\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n scale (Optional[Sequence[float]], optional): local scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n visible (bool, optional): set to false for an invisible prim in the stage while rendering. Defaults to True.\n collision (bool, optional): Set to True if the geometry should have a collider (i.e not only a visual geometry).\n Defaults to False.\n track_contact_forces (bool, Optional) : if enabled, the view will track the net contact forces on each geometry prim in the view. \n Note that the collision flag should be set to True to report contact forces. Defaults to False.\n prepare_contact_sensors (bool, Optional): applies contact reporter API to the prim if it already does not have one. Defaults to False.\n disable_stablization (bool, optional): disables the contact stablization parameter in the physics context. Defaults to True.\n contact_filter_prim_paths_expr (Optional[List[str]], Optional): a list of filter expressions which allows for tracking contact forces \n between the geometry prim and this subset through get_contact_force_matrix(). \n ", "snippet": "geometry_prim = GeometryPrim(prim_path=prim_path, # str\n name=\"geometry_prim\", # str\n position=None, # typing.Union[typing.Sequence[float], NoneType]\n translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None, # typing.Union[typing.Sequence[float], NoneType]\n scale=None, # typing.Union[typing.Sequence[float], NoneType]\n visible=None, # typing.Union[bool, NoneType]\n collision=False, # bool\n track_contact_forces=False, # bool\n prepare_contact_sensor=False, # bool\n disable_stablization=True, # bool\n contact_filter_prim_paths_expr=[]) # typing.Union[typing.List[str], NoneType]\n" }, { "title": "apply_physics_material", "description": "Used to apply physics material to the held prim and optionally its descendants.\n\n Args:\n physics_material (PhysicsMaterial): physics material to be applied to the held prim. This where you want to\n define friction, restitution..etc. Note: if a physics material is not\n defined, the defaults will be used from PhysX.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants\n materials, otherwise False. Defaults to False.\n ", "snippet": "geometry_prim.apply_physics_material(physics_material=physics_material, # omni.isaac.core.materials.physics_material.PhysicsMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_physics_material", "description": "Returns the current applied physics material in case it was applied using apply_physics_material or not.\n\n Returns:\n PhysicsMaterial: the current applied physics material.\n ", "snippet": "applied_physics_material = geometry_prim.get_applied_physics_material()\n" }, { "title": "get_collision_approximation", "description": " Returns:\n str: approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "collision_approximation = geometry_prim.get_collision_approximation()\n" }, { "title": "get_collision_enabled", "description": " Returns:\n ", "snippet": "collision_enabled = geometry_prim.get_collision_enabled()\n" }, { "title": "get_contact_force_matrix", "description": " If the object is initialized with filter_paths_expr list, this method returns the contact forces between the prims \n in the view and the filter prims. i.e., a matrix of dimension (self._contact_view.num_filters, 3) \n where num_filters is the determined according to the filter_paths_expr parameter.\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (self._geometry_prim_view._contact_view.num_filters, 3).\n ", "snippet": "contact_force_matrix = geometry_prim.get_contact_force_matrix(dt=1.0) # float\n" }, { "title": "get_contact_offset", "description": " Returns:\n float: contact offset of the collision shape.\n ", "snippet": "contact_offset = geometry_prim.get_contact_offset()\n" }, { "title": "get_min_torsional_patch_radius", "description": " Returns:\n float: minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "min_torsional_patch_radius = geometry_prim.get_min_torsional_patch_radius()\n" }, { "title": "get_net_contact_forces", "description": " If contact forces of the prims in the view are tracked, this method returns the net contact forces on prims. \n i.e., a matrix of dimension (1, 3)\n\n Args:\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (3).\n\n ", "snippet": "net_contact_forces = geometry_prim.get_net_contact_forces(dt=1.0) # float\n" }, { "title": "get_rest_offset", "description": " Returns:\n float: rest offset of the collision shape.\n ", "snippet": "rest_offset = geometry_prim.get_rest_offset()\n" }, { "title": "get_torsional_patch_radius", "description": " Returns:\n float: radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "torsional_patch_radius = geometry_prim.get_torsional_patch_radius()\n" }, { "title": "set_collision_approximation", "description": "\n Args:\n approximation_type (str): approximation used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\"\n ", "snippet": "geometry_prim.set_collision_approximation(approximation_type=approximation_type) # str\n" }, { "title": "set_collision_enabled", "description": "\n Args:\n ", "snippet": "geometry_prim.set_collision_enabled(enabled=enabled) # bool\n" }, { "title": "set_contact_offset", "description": " Args:\n offset (float): Contact offset of a collision shape. Allowed range [maximum(0, rest_offset), 0].\n Default value is -inf, means default is picked by simulation based on the shape extent.\n ", "snippet": "geometry_prim.set_contact_offset(offset=offset) # float\n" }, { "title": "set_min_torsional_patch_radius", "description": " Args:\n radius (float): minimum radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "geometry_prim.set_min_torsional_patch_radius(radius=radius) # float\n" }, { "title": "set_rest_offset", "description": " Args:\n offset (float): Rest offset of a collision shape. Allowed range [-max_float, contact_offset.\n Default value is -inf, means default is picked by simulatiion. For rigid bodies its zero.\n ", "snippet": "geometry_prim.set_rest_offset(offset=offset) # float\n" }, { "title": "set_torsional_patch_radius", "description": " Args:\n radius (float): radius of the contact patch used to apply torsional friction. Allowed range [0, max_float].\n ", "snippet": "geometry_prim.set_torsional_patch_radius(radius=radius) # float\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "geometry_prim.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = geometry_prim.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = geometry_prim.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = geometry_prim.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = geometry_prim.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = geometry_prim.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = geometry_prim.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = geometry_prim.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "geometry_prim.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "geometry_prim.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "geometry_prim.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "geometry_prim.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "geometry_prim.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "geometry_prim.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "geometry_prim.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "geometry_prim.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "geometry_prim.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "GeometryPrimView", "snippets": [ { "title": "GeometryPrimView", "description": " Provides high level functions to deal with geom prims (1 or more prims) \n as well as its attributes/ properties.\n This object wraps all matching geom prims found at the regex provided at the prim_paths_expr.\n\n Note: - each prim will have \"xformOp:orient\", \"xformOp:translate\" and \"xformOp:scale\" only post init,\n unless it is a non-root articulation link.\n\n Args:\n prim_paths_expr (str): prim paths regex to encapsulate all prims that match it.\n example: \"/World/Env[1-5]/Microwave\" will match /World/Env1/Microwave, \n /World/Env2/Microwave..etc.\n (a non regex prim path can also be used to encapsulate one XForm).\n name (str, optional): shortname to be used as a key by Scene class. \n Note: needs to be unique if the object is added to the Scene.\n Defaults to \"geometry_prim_view\".\n positions (Optional[Union[np.ndarray, torch.Tensor]], optional): \n default positions in the world frame of the prim. \n shape is (N, 3).\n Defaults to None, which means left unchanged.\n translations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n default translations in the local frame of the prims\n (with respect to its parent prims). shape is (N, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n default quaternion orientations in the world/ local frame of the prim\n (depends if translation or position is specified).\n quaternion is scalar-first (w, x, y, z). shape is (N, 4).\n Defaults to None, which means left unchanged.\n scales (Optional[Union[np.ndarray, torch.Tensor]], optional): local scales to be applied to \n the prim's dimensions. shape is (N, 3).\n Defaults to None, which means left unchanged.\n visibilities (Optional[Union[np.ndarray, torch.Tensor]], optional): set to false for an invisible prim in \n the stage while rendering. shape is (N,). \n Defaults to None.\n reset_xform_properties (bool, optional): True if the prims don't have the right set of xform properties \n (i.e: translate, orient and scale) ONLY and in that order.\n Set this parameter to False if the object were cloned using using \n the cloner api in omni.isaac.cloner. Defaults to True.\n collisions (Optional[Union[np.ndarray, torch.Tensor]], optional): Set to True if the geometry already have/\n should have a collider (i.e not only a visual geometry). shape is (N,).\n Defaults to None.\n track_contact_forces (bool, Optional) : if enabled, the view will track the net contact forces on each geometry prim \n in the view. Note that the collision flag should be set to True to report \n contact forces. Defaults to False.\n prepare_contact_sensors (bool, Optional): applies contact reporter API to the prim if it already does not have one. \n Defaults to False.\n disable_stablization (bool, optional): disables the contact stablization parameter in the physics context.\n Defaults to True.\n contact_filter_prim_paths_expr (Optional[List[str]], Optional): a list of filter expressions which allows for tracking \n contact forces between the geometry prim and this subset \n through get_contact_force_matrix(). \n ", "snippet": "geometry_prim_view = GeometryPrimView(prim_paths_expr=prim_paths_expr, # str\n name=\"geometry_prim_view\", # str\n positions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n translations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n scales=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n visibilities=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n reset_xform_properties=True, # bool\n collisions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n track_contact_forces=False, # bool\n prepare_contact_sensors=False, # bool\n disable_stablization=True, # bool\n contact_filter_prim_paths_expr=[]) # typing.Union[typing.List[str], NoneType]\n" }, { "title": "apply_collision_apis", "description": "retrieves the collision apis applied to prims already \n or applies collision apis to prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "geometry_prim_view.apply_collision_apis(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "apply_physics_materials", "description": "Used to apply physics material to prims in the view and optionally its descendants.\n\n Args:\n physics_materials (Union[PhysicsMaterial, List[PhysicsMaterial]]): physics materials to be applied to prims in the view.\n Physics material can be used to define friction, restitution..etc.\n Note: if a physics material is not defined, the defaults will be used\n from PhysX. If a list is provided then its size has to be equal\n the view's size or indices size.\n If one material is provided it will be applied to all prims in the view.\n weaker_than_descendants (Optional[Union[bool, List[bool]]], optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False. \n If a list of visual materials is provided then a list\n has to be provided with the same size for this arg as well.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Raises:\n Exception: length of physics materials != length of prims indexed\n Exception: length of physics materials != length of weaker descendants arg\n ", "snippet": "geometry_prim_view.apply_physics_materials(physics_materials=physics_materials, # typing.Union[omni.isaac.core.materials.physics_material.PhysicsMaterial, typing.List[omni.isaac.core.materials.physics_material.PhysicsMaterial]]\n weaker_than_descendants=None, # typing.Union[bool, typing.List[bool], NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "disable_collision", "description": "Disables collision on prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "geometry_prim_view.disable_collision(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "enable_collision", "description": "Enables collision on prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "geometry_prim_view.enable_collision(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_applied_physics_materials", "description": "Gets the applied physics material to prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n List[PhysicsMaterial]: the current applied physics materials for prims in the view.\n ", "snippet": "applied_physics_materials = geometry_prim_view.get_applied_physics_materials(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_collision_approximations", "description": "Gets collision approximation types for prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n List[str]: approximations used for collision, could be \"none\", \"convexHull\" or \"convexDecomposition\". size == M or size of the view.\n\n ", "snippet": "collision_approximations = geometry_prim_view.get_collision_approximations(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_contact_force_matrix", "description": " If the object is initialized with filter_paths_expr list, this method returns the contact forces between the prims \n in the view and the filter prims. i.e., a matrix of dimension (self.count, self._contact_view.num_filters, 3) \n where num_filters is the determined according to the filter_paths_expr parameter.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (M, self._contact_view.num_filters, 3).\n ", "snippet": "contact_force_matrix = geometry_prim_view.get_contact_force_matrix(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True, # bool\n dt=1.0) # float\n" }, { "title": "get_contact_offsets", "description": "Gets contact offsets for prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Contact offsets of the collision shapes. Shape is (M,).\n ", "snippet": "contact_offsets = geometry_prim_view.get_contact_offsets(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_min_torsional_patch_radii", "description": "Gets minimum torsional patch radii for prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: minimum radius of the contact patch used to apply torsional friction. shape is (M,).\n ", "snippet": "min_torsional_patch_radii = geometry_prim_view.get_min_torsional_patch_radii(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_net_contact_forces", "description": " If contact forces of the prims in the view are tracked, this method returns the net contact forces on prims. \n i.e., a matrix of dimension (self.count, 3)\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (M,3).\n\n ", "snippet": "net_contact_forces = geometry_prim_view.get_net_contact_forces(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True, # bool\n dt=1.0) # float\n" }, { "title": "get_rest_offsets", "description": "Gets rest offsets for prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n Returns:\n Union[np.ndarray, torch.Tensor]: Rest offsets of the collision shapes. Shape is (M,).\n ", "snippet": "rest_offsets = geometry_prim_view.get_rest_offsets(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_torsional_patch_radii", "description": "Gets torsional patch radii for prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: radius of the contact patch used to apply torsional friction. shape is (M,).\n ", "snippet": "torsional_patch_radii = geometry_prim_view.get_torsional_patch_radii(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "initialize", "description": "", "snippet": "geometry_prim_view.initialize(physics_sim_view=None) # omni.physics.tensors.bindings._physicsTensors.SimulationView\n" }, { "title": "is_collision_enabled", "description": "Queries if collision is enabled on prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: True if collision is enabled. Shape is (M,).\n ", "snippet": "geometry_prim_view.is_collision_enabled(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_collision_approximations", "description": "Sets collision approximation types for prims in the view.\n\n Args:\n approximation_types (List[str]): approximations used for collision, \n could be \"none\", \"convexHull\" or \"convexDecomposition\". \n List size == M or the size of the view.\n\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "geometry_prim_view.set_collision_approximations(approximation_types=approximation_types, # typing.List[str]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_contact_offsets", "description": " Sets contact offsets for prims in the view.\n\n Args:\n offsets (Union[np.ndarray, torch.Tensor]): Contact offsets of the collision shapes. Allowed range [maximum(0, rest_offset), 0]. \n Default value is -inf, means default is picked by simulation based on the shape extent.\n Shape (M,).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "geometry_prim_view.set_contact_offsets(offsets=offsets, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_min_torsional_patch_radii", "description": "Sets minimum torsional patch radii for prims in the view.\n\n Args:\n radii (Union[np.ndarray, torch.Tensor]): minimum radius of the contact patch used to apply torsional friction. \n Allowed range [0, max_float]. shape is (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "geometry_prim_view.set_min_torsional_patch_radii(radii=radii, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_rest_offsets", "description": "Sets rest offsets for prims in the view.\n\n Args:\n offsets (Union[np.ndarray, torch.Tensor]): Rest offset of a collision shape. Allowed range [-max_float, contact_offset. \n Default value is -inf, means default is picked by simulatiion. \n For rigid bodies its zero. Shape (M,).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "geometry_prim_view.set_rest_offsets(offsets=offsets, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_torsional_patch_radii", "description": "Sets torsional patch radii for prims in the view.\n\n Args:\n radii (Union[np.ndarray, torch.Tensor]): radius of the contact patch used to apply torsional friction. Allowed range [0, max_float]. \n shape is (M,).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "geometry_prim_view.set_torsional_patch_radii(radii=radii, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "apply_visual_materials", "description": "Used to apply visual material to the prims and optionally its prim descendants.\n\n Args:\n visual_materials (Union[VisualMaterial, List[VisualMaterial]]): visual materials to be applied to the prims. Currently supports\n PreviewSurface, OmniPBR and OmniGlass. If a list is provided then\n its size has to be equal the view's size or indices size. \n If one material is provided it will be applied to all prims in the view.\n weaker_than_descendants (Optional[Union[bool, List[bool]]], optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False. \n If a list of visual materials is provided then a list\n has to be provided with the same size for this arg as well.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Raises:\n Exception: length of visual materials != length of prims indexed\n Exception: length of visual materials != length of weaker descendants bools arg\n ", "snippet": "geometry_prim_view.apply_visual_materials(visual_materials=visual_materials, # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, typing.List[omni.isaac.core.materials.visual_material.VisualMaterial]]\n weaker_than_descendants=None, # typing.Union[bool, typing.List[bool], NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_applied_visual_materials", "description": "\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n List[VisualMaterial]: a list of the current applied visual materials to the prims if its type is currently supported.\n ", "snippet": "applied_visual_materials = geometry_prim_view.get_applied_visual_materials(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimViewState: returns the default state of the prims (positions and orientations) that is used after each reset.\n ", "snippet": "default_state = geometry_prim_view.get_default_state()\n" }, { "title": "get_local_poses", "description": "Gets prim poses in the view with respect to the local's frame (the prim's parent frame).\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: \n first index is translations in the local frame of the prims. shape is (M, 3). \n second index is quaternion orientations in the local frame of the prims.\n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n ", "snippet": "local_poses = geometry_prim_view.get_local_poses(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_local_scales", "description": "Gets prim scales in the view with respect to the local frame (the parent's frame).\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: scales applied to the prim's dimensions in the local frame. shape is (M, 3).\n ", "snippet": "local_scales = geometry_prim_view.get_local_scales(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_visibilities", "description": "Returns the current visibilities of the prims in stage.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Shape (M,) with type bool, where each item holds True \n if the prim is visible in stage. False otherwise.\n ", "snippet": "visibilities = geometry_prim_view.get_visibilities(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_world_poses", "description": " Returns the poses (positions and orientations) of the prims in the view with respect to the world frame.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: first index is positions in the world frame of the prims. shape is (M, 3). \n second index is quaternion orientations in the world frame of the prims.\n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n ", "snippet": "world_poses = geometry_prim_view.get_world_poses(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_world_scales", "description": "Gets prim scales in the view with respect to the world's frame.\n\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: scales applied to the prim's dimensions in the world frame. shape is (M, 3).\n ", "snippet": "world_scales = geometry_prim_view.get_world_scales(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "initialize", "description": "", "snippet": "geometry_prim_view.initialize(physics_sim_view=None) # omni.physics.tensors.bindings._physicsTensors.SimulationView\n" }, { "title": "is_valid", "description": " Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n bool: True if all prim paths specified in the view correspond to a valid prim in stage. False otherwise.\n ", "snippet": "geometry_prim_view.is_valid(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "is_visual_material_applied", "description": " Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n List[bool]: True if there is a visual material applied is applied to the corresponding prim in the view. False otherwise.\n ", "snippet": "geometry_prim_view.is_visual_material_applied(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "post_reset", "description": "Resets the prims to its default state (positions and orientations).\n ", "snippet": "geometry_prim_view.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prims (positions and orientations), that will be used after each reset.\n\n Args:\n positions (Optional[np.ndarray], optional): positions in the world frame of the prim. shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[np.ndarray], optional): quaternion orientations in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "geometry_prim_view.set_default_state(positions=None, # typing.Union[numpy.ndarray, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_local_poses", "description": "Sets prim poses in the view with respect to the local frame (the prim's parent frame).\n\n Args:\n translations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n translations in the local frame of the prims\n (with respect to its parent prim). shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n quaternion orientations in the local frame of the prims. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "geometry_prim_view.set_local_poses(translations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_local_scales", "description": "Sets prim scales in the view with respect to the local frame (the prim's parent frame).\n\n Args:\n scales (Optional[Union[np.ndarray, torch.Tensor]]): scales to be applied to the prim's dimensions in the view. \n shape is (M, 3).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "geometry_prim_view.set_local_scales(scales=scales, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_visibilities", "description": "Sets the visibilities of the prims in stage.\n\n Args:\n visibilities (Union[np.ndarray, torch.Tensor]): flag to set the visibilities of the usd prims in stage. \n Shape (M,). Where M <= size of the encapsulated prims in the view.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "geometry_prim_view.set_visibilities(visibilities=visibilities, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_world_poses", "description": "Sets prim poses in the view with respect to the world's frame.\n\n Args:\n positions (Optional[Union[np.ndarray, torch.Tensor]], optional): positions in the world frame of the prims. shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): quaternion orientations in the world frame of the prims. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "geometry_prim_view.set_world_poses(positions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" } ] }, { "title": "ParticleSystem", "snippets": [ { "title": "ParticleSystem", "description": "A wrapper around PhysX particle system.\n\nPhysX uses GPU-accelerated position-based-dynamics (PBD) particle simulation [1]. The particle system\ncan be used to simulate fluids, cloth and inflatables [2].\n\nThe wrapper is useful for creating and setting solver parameters common to the particle objects\nassociated with the system. The particle system's solver parameters cannot be changed once the scene\nis playing.\n\nNote:\n CPU simulation of particles is not supported. PhysX must be simulated with GPU enabled.\n\nReference:\n [1] https://mmacklin.com/pbf_sig_preprint.pdf\n [2] https://docs.omniverse.nvidia.com/prod_extensions/prod_extensions/ext_physics.html#particle-simulation", "snippet": "particle_system = ParticleSystem(prim_path=prim_path, # str\n name=\"particle_system\", # typing.Union[str, NoneType]\n particle_system_enabled=None, # typing.Union[bool, NoneType]\n simulation_owner=None, # typing.Union[str, NoneType]\n contact_offset=None, # typing.Union[float, NoneType]\n rest_offset=None, # typing.Union[float, NoneType]\n particle_contact_offset=None, # typing.Union[float, NoneType]\n solid_rest_offset=None, # typing.Union[float, NoneType]\n fluid_rest_offset=None, # typing.Union[float, NoneType]\n enable_ccd=None, # typing.Union[bool, NoneType]\n solver_position_iteration_count=None, # typing.Union[float, NoneType]\n max_depenetration_velocity=None, # typing.Union[float, NoneType]\n wind=None, # typing.Sequence[float]\n max_neighborhood=None, # typing.Union[int, NoneType]\n max_velocity=None, # typing.Union[float, NoneType]\n global_self_collision_enabled=None, # typing.Union[bool, NoneType]\n non_particle_collision_enabled=None) # typing.Union[bool, NoneType]\n" }, { "title": "apply_particle_anisotropy", "description": "Applies anisotropy to the particle system.\n\n This is used to compute anisotropic scaling of particles in a post-processing step.\n It only affects the rendering output including iso-surface generation.\n ", "snippet": "particle_system.apply_particle_anisotropy()\n" }, { "title": "apply_particle_isotropy", "description": "Applies iso-surface extraction to the particle system.\n\n This is used to define settings to extract an iso-surface from the particles\n in a post-processing step. It only affects the rendering output including iso-surface generation.\n ", "snippet": "particle_system.apply_particle_isotropy()\n" }, { "title": "apply_particle_material", "description": "", "snippet": "particle_system.apply_particle_material(particle_materials=particle_materials) # omni.isaac.core.materials.particle_material.ParticleMaterial\n" }, { "title": "apply_particle_smoothing", "description": "Applies smoothing to the simulated particle system.\n\n This is used to control smoothing of particles in a post-processing step.\n It only affects the rendering output including iso-surface generation.\n ", "snippet": "particle_system.apply_particle_smoothing()\n" }, { "title": "get_applied_particle_material", "description": "", "snippet": "applied_particle_material = particle_system.get_applied_particle_material()\n" }, { "title": "get_contact_offset", "description": " Returns:\n float: The contact offset used for collisions with non-particle objects.\n ", "snippet": "contact_offset = particle_system.get_contact_offset()\n" }, { "title": "get_enable_ccd", "description": " Returns:\n bool: Whether continuous collision detection for particles is enabled or disabled.\n ", "snippet": "enable_ccd = particle_system.get_enable_ccd()\n" }, { "title": "get_fluid_rest_offset", "description": " Returns:\n float: The rest offset used for fluid-fluid particle interactions.\n ", "snippet": "fluid_rest_offset = particle_system.get_fluid_rest_offset()\n" }, { "title": "get_global_self_collision_enabled", "description": " Returns:\n bool: Whether self collisions to follow particle-object-specific settings\n is enabled or disabled.\n ", "snippet": "global_self_collision_enabled = particle_system.get_global_self_collision_enabled()\n" }, { "title": "get_max_depenetration_velocity", "description": " Returns:\n float: The maximum velocity permitted between intersecting particles.\n ", "snippet": "max_depenetration_velocity = particle_system.get_max_depenetration_velocity()\n" }, { "title": "get_max_neighborhood", "description": " Returns:\n int: The particle neighborhood size.\n ", "snippet": "max_neighborhood = particle_system.get_max_neighborhood()\n" }, { "title": "get_max_velocity", "description": " Returns:\n float: The maximum particle velocity.\n ", "snippet": "max_velocity = particle_system.get_max_velocity()\n" }, { "title": "get_particle_contact_offset", "description": " Returns:\n float: The contact offset used for interactions between particles.\n ", "snippet": "particle_contact_offset = particle_system.get_particle_contact_offset()\n" }, { "title": "get_particle_system_enabled", "description": " Returns:\n bool: Whether particle system is enabled or not.\n ", "snippet": "particle_system_enabled = particle_system.get_particle_system_enabled()\n" }, { "title": "get_rest_offset", "description": " Returns:\n float: The rest offset used for collisions with non-particle objects.\n ", "snippet": "rest_offset = particle_system.get_rest_offset()\n" }, { "title": "get_simulation_owner", "description": " Returns:\n Usd.Prim: The physics scene prim attached to particle system.\n ", "snippet": "simulation_owner = particle_system.get_simulation_owner()\n" }, { "title": "get_solid_rest_offset", "description": " Returns:\n float: The rest offset used for solid-solid or solid-fluid particle interactions.\n ", "snippet": "solid_rest_offset = particle_system.get_solid_rest_offset()\n" }, { "title": "get_solver_position_iteration_count", "description": " Returns:\n int: The number of solver iterations for positions.\n ", "snippet": "solver_position_iteration_count = particle_system.get_solver_position_iteration_count()\n" }, { "title": "get_wind", "description": " Returns:\n Sequence[float]: The wind applied to the current particle system.\n ", "snippet": "wind = particle_system.get_wind()\n" }, { "title": "initialize", "description": "", "snippet": "particle_system.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "particle_system.is_valid()\n" }, { "title": "post_reset", "description": "", "snippet": "particle_system.post_reset()\n" }, { "title": "set_contact_offset", "description": "Set the contact offset used for collisions with non-particle objects such as rigid or deformable bodies.\n\n Args:\n value (float): The contact offset.\n ", "snippet": "particle_system.set_contact_offset(value=value) # float\n" }, { "title": "set_enable_ccd", "description": "Enable continuous collision detection for particles.\n\n Args:\n value (bool): Whether to enable or disable.\n ", "snippet": "particle_system.set_enable_ccd(value=value) # bool\n" }, { "title": "set_fluid_rest_offset", "description": "Set the rest offset used for fluid-fluid particle interactions.\n\n Note: Must be smaller than particle contact offset.\n\n Args:\n value (float): The rest offset.\n ", "snippet": "particle_system.set_fluid_rest_offset(value=value) # float\n" }, { "title": "set_global_self_collision_enabled", "description": "Enable self collisions to follow particle-object-specific settings.\n\n If True, self collisions follow particle-object-specific settings. If False,\n all particle self collisions are disabled, regardless of any other settings.\n\n Note: Improves performance if self collisions are not needed.\n\n Args:\n value (bool): Whether to enable or disable.\n ", "snippet": "particle_system.set_global_self_collision_enabled(value=value) # bool\n" }, { "title": "set_max_depenetration_velocity", "description": "Set the maximum velocity permitted to be introduced by the solver to\n depenetrate intersecting particles.\n\n Args:\n value (float): The maximum depenetration velocity.\n ", "snippet": "particle_system.set_max_depenetration_velocity(value=value) # float\n" }, { "title": "set_max_neighborhood", "description": "Set the particle neighborhood size.\n\n Args:\n value (int): The neighborhood size.\n ", "snippet": "particle_system.set_max_neighborhood(value=value) # int\n" }, { "title": "set_max_velocity", "description": "Set the maximum particle velocity.\n\n Args:\n value (float): The maximum velocity.\n ", "snippet": "particle_system.set_max_velocity(value=value) # float\n" }, { "title": "set_particle_contact_offset", "description": "Set the contact offset used for interactions between particles.\n\n Note: Must be larger than solid and fluid rest offsets.\n\n Args:\n value (float): The contact offset.\n ", "snippet": "particle_system.set_particle_contact_offset(value=value) # float\n" }, { "title": "set_particle_system_enabled", "description": "Set enabling of the particle system.\n\n Args:\n value (bool): Whether to enable or disable.\n ", "snippet": "particle_system.set_particle_system_enabled(value=value) # bool\n" }, { "title": "set_rest_offset", "description": "Set the rest offset used for collisions with non-particle objects such as rigid or deformable bodies.\n\n Args:\n value (float): The rest offset.\n ", "snippet": "particle_system.set_rest_offset(value=value) # float\n" }, { "title": "set_simulation_owner", "description": "Set the PhysicsScene that simulates this particle system.\n\n Args:\n value (str): The prim path to the physics scene.\n ", "snippet": "particle_system.set_simulation_owner(value=value) # str\n" }, { "title": "set_solid_rest_offset", "description": "Set the rest offset used for solid-solid or solid-fluid particle interactions.\n\n Note: Must be smaller than particle contact offset.\n\n Args:\n value (float): The rest offset.\n ", "snippet": "particle_system.set_solid_rest_offset(value=value) # float\n" }, { "title": "set_solver_position_iteration_count", "description": "Set the number of solver iterations for position.\n\n Args:\n value (int): Number of solver iterations.\n ", "snippet": "particle_system.set_solver_position_iteration_count(value=value) # int\n" }, { "title": "set_wind", "description": "Set the wind velocity applied to the current particle system.\n\n Args:\n value (Sequence[float]): The wind applied to the current particle system.\n ", "snippet": "particle_system.set_wind(value=value) # typing.Sequence[float]\n" } ] }, { "title": "ParticleSystemView", "snippets": [ { "title": "ParticleSystemView", "description": "Provides high level functions to deal with particle systems (1 or more particle systems) as well as its attributes/ properties.\nThis object wraps all matching particle systems found at the regex provided at the prim_paths_expr.\nNote: not all the attributes of the PhysxSchema.PhysxParticleSystem is currently controlled with this view class\nTensor API support will be added in the future to extend the functionality of this class to applications beyond cloth.", "snippet": "particle_system_view = ParticleSystemView(prim_paths_expr=prim_paths_expr, # str\n name=\"particle_system_view\", # str\n particle_systems_enabled=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n simulation_owners=None, # typing.Union[typing.Sequence[str], NoneType]\n contact_offsets=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n rest_offsets=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n particle_contact_offsets=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n solid_rest_offsets=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n fluid_rest_offsets=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n enable_ccds=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n solver_position_iteration_counts=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n max_depenetration_velocities=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n winds=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n max_neighborhoods=None, # typing.Union[int, NoneType]\n max_velocities=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n global_self_collisions_enabled=None) # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n" }, { "title": "apply_particle_materials", "description": "Used to apply particle material to prims in the view.\n\n Args:\n particle_materials (Union[ParticleMaterial, List[ParticleMaterial]]): particle materials to be applied to prims in the view. \n Note: if a physics material is not defined, \n the defaults will be used from PhysX.\n If a list is provided then its size has to be equal \n the view's size or indices size. \n If one material is provided it will be applied to all prims in the view.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n Raises:\n Exception: length of physics materials != length of prims indexed\n ", "snippet": "particle_system_view.apply_particle_materials(particle_materials=particle_materials, # typing.Union[omni.isaac.core.materials.particle_material.ParticleMaterial, typing.List[omni.isaac.core.materials.particle_material.ParticleMaterial]]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_applied_particle_materials", "description": "Gets the applied particle material to prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n List[ParticleMaterial]: the current applied particle materials for prims in the view.\n ", "snippet": "applied_particle_materials = particle_system_view.get_applied_particle_materials(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_contact_offsets", "description": " Returns:\n Union[np.ndarray, torch.Tensor]: The contact offset used for collisions with non-particle objects for each particle system. shape is (M, ). \n \n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n ", "snippet": "contact_offsets = particle_system_view.get_contact_offsets(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_enable_ccds", "description": " Returns:\n Union[np.ndarray, torch.Tensor]: Whether continuous collision detection for particles is enabled or disabled for each particle system. shape is (M, ). \n \n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n ", "snippet": "enable_ccds = particle_system_view.get_enable_ccds(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_fluid_rest_offsets", "description": " Returns:\n Union[np.ndarray, torch.Tensor]: The rest offset used for fluid-fluid particle interactions. shape is (M, ). \n \n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n ", "snippet": "fluid_rest_offsets = particle_system_view.get_fluid_rest_offsets(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_global_self_collisions_enabled", "description": " Returns:\n Union[np.ndarray, torch.Tensor]: Whether self collisions to follow particle-object-specific settings \n is enabled or disabled. for each particle system. shape is (M, ). \n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n ", "snippet": "global_self_collisions_enabled = particle_system_view.get_global_self_collisions_enabled(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_max_depenetration_velocities", "description": " Returns:\n Union[np.ndarray, torch.Tensor]: The maximum velocity permitted to be introduced by the solver to\n depenetrate intersecting particles for particle systems for each particle system. shape is (M, ).\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n ", "snippet": "max_depenetration_velocities = particle_system_view.get_max_depenetration_velocities(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_max_neighborhoods", "description": " Returns:\n Union[np.ndarray, torch.Tensor]: The particle neighborhood size for each particle system. shape is (M, ). \n \n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n ", "snippet": "max_neighborhoods = particle_system_view.get_max_neighborhoods(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_max_velocities", "description": " Returns:\n Union[np.ndarray, torch.Tensor]: The maximum particle velocities for each particle system. shape is (M, ). \n \n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n ", "snippet": "max_velocities = particle_system_view.get_max_velocities(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_particle_contact_offsets", "description": " Returns:\n Union[np.ndarray, torch.Tensor]: The contact offset used for interactions between particles in the view concatenated. shape is (M, ). \n \n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n ", "snippet": "particle_contact_offsets = particle_system_view.get_particle_contact_offsets(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_particle_systems_enabled", "description": " Returns:\n Union[np.ndarray, torch.Tensor]: Whether particle system is enabled or not for each particle system. shape is (M, ). \n \n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n ", "snippet": "particle_systems_enabled = particle_system_view.get_particle_systems_enabled(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_rest_offsets", "description": " Returns:\n Union[np.ndarray, torch.Tensor]: The rest offset used for collisions with non-particle objects for each particle system. shape is (M, ). \n \n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n ", "snippet": "rest_offsets = particle_system_view.get_rest_offsets(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_simulation_owners", "description": " Returns:\n Sequence[str]: The physics scene prim path attached to particle system. shape is (M, ). \n \n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n ", "snippet": "simulation_owners = particle_system_view.get_simulation_owners(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_solid_rest_offsets", "description": " Returns:\n Union[np.ndarray, torch.Tensor]: The rest offset used for solid-solid or solid-fluid particle interactions. shape is (M, ). \n \n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n ", "snippet": "solid_rest_offsets = particle_system_view.get_solid_rest_offsets(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_solver_position_iteration_counts", "description": " Returns:\n Union[np.ndarray, torch.Tensor]: The number of solver iterations for positions for each particle system. shape is (M, ). \n \n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n ", "snippet": "solver_position_iteration_counts = particle_system_view.get_solver_position_iteration_counts(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_winds", "description": " Returns:\n Union[np.ndarray, torch.Tensor]: The winds applied to the current particle system. shape is (M, 3). \n \n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n ", "snippet": "winds = particle_system_view.get_winds(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "initialize", "description": "Create a physics simulation view if not passed and creates a Particle System View.\n\n Args:\n physics_sim_view (omni.physics.tensors.SimulationView, optional): current physics simulation view. Defaults to None.\n ", "snippet": "particle_system_view.initialize(physics_sim_view=None) # omni.physics.tensors.bindings._physicsTensors.SimulationView\n" }, { "title": "is_physics_handle_valid", "description": " Returns:\n bool: True if the physics handle of the view is valid (i.e physics is initialized for the view). Otherwise False.\n ", "snippet": "particle_system_view.is_physics_handle_valid()\n" }, { "title": "is_valid", "description": " Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n Returns:\n bool: True if all prim paths specified in the view correspond to a valid prim in stage. False otherwise.\n ", "snippet": "particle_system_view.is_valid(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "post_reset", "description": "Resets the particles to their initial states.\n ", "snippet": "particle_system_view.post_reset()\n" }, { "title": "set_contact_offsets", "description": "Set the contact offset used for collisions with non-particle objects such as rigid or deformable bodies for particle systems.\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]]): maximum particle velocity tensor to set particle systems to. shape is (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view). \n ", "snippet": "particle_system_view.set_contact_offsets(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_enable_ccds", "description": "Enable continuous collision detection for particles for particle systems.\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]]): maximum particle velocity tensor to set particle systems to. shape is (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view). \n ", "snippet": "particle_system_view.set_enable_ccds(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_fluid_rest_offsets", "description": "Set the rest offset used for fluid-fluid particle interactions.\n\n Note: Must be smaller than particle contact offset.\n\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]]): fluid rest offset to set particle systems to. shape is (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view). \n ", "snippet": "particle_system_view.set_fluid_rest_offsets(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_global_self_collisions_enabled", "description": "Enable self collisions to follow particle-object-specific settings for particle systems.\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]]): maximum particle velocity tensor to set particle systems to. shape is (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view). \n ", "snippet": "particle_system_view.set_global_self_collisions_enabled(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_max_depenetration_velocities", "description": " Set the maximum velocity permitted to be introduced by the solver to depenetrate intersecting particles for particle systems.\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]]): maximum particle velocity tensor to set particle systems to. shape is (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view). \n ", "snippet": "particle_system_view.set_max_depenetration_velocities(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_max_neighborhoods", "description": "Set the particle neighborhood size for particle systems.\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]]): maximum particle velocity tensor to set particle systems to. shape is (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view). \n ", "snippet": "particle_system_view.set_max_neighborhoods(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_max_velocities", "description": "Set the maximum particle velocity for particle systems.\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]]): maximum particle velocity tensor to set particle systems to. shape is (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view). \n ", "snippet": "particle_system_view.set_max_velocities(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_particle_contact_offsets", "description": "Set the contact offset used for interactions between particles.\n\n Note: Must be larger than solid and fluid rest offsets.\n\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]]): The contact offset.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view). ", "snippet": "particle_system_view.set_particle_contact_offsets(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_particle_systems_enabled", "description": "Set enabling of the particle systems.\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]]): maximum particle velocity tensor to set particle systems to. shape is (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view). \n ", "snippet": "particle_system_view.set_particle_systems_enabled(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_rest_offsets", "description": "Set the rest offset used for collisions with non-particle objects such as rigid or deformable bodies for particle systems.\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]]): maximum particle velocity tensor to set particle systems to. shape is (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view). \n ", "snippet": "particle_system_view.set_rest_offsets(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_simulation_owners", "description": "Set the PhysicsScene that simulates particle systems.\n Args:\n values (Sequence[str]): PhysicsScene list to set particle systems to. shape is (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view). \n ", "snippet": "particle_system_view.set_simulation_owners(values=values, # typing.Sequence[str]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_solid_rest_offsets", "description": "Set the rest offset used for solid-solid or solid-fluid particle interactions.\n\n Note: Must be smaller than particle contact offset.\n\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]]): solid rest offset to set particle systems to. shape is (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view). ", "snippet": "particle_system_view.set_solid_rest_offsets(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_solver_position_iteration_counts", "description": "Set the number of solver iterations for position for particle systems.\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]]): maximum particle velocity tensor to set particle systems to. shape is (M, ).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view). \n ", "snippet": "particle_system_view.set_solver_position_iteration_counts(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_winds", "description": "Set the winds velocities applied to the current particle system.\n\n Args:\n values (Optional[Union[np.ndarray, torch.Tensor]]): The wind applied to the current particle system. shape is (M, 3).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view). \n ", "snippet": "particle_system_view.set_winds(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" } ] }, { "title": "RigidContactView", "snippets": [ { "title": "RigidContactView", "description": "Provides high level functions to deal with rigid prims that track their contacts through filters\n as well as its attributes/ properties.\n This object wraps all matching Rigid Prims found at the regex provided at the prim_paths_expr.\n\n Note: if the prim does not already have a rigid body api applied to it before init, it will NOT apply it.\n\n Args:\n prim_paths_expr (str): prim paths regex to encapsulate all prims that match it.\n example: \"/World/Env[1-5]/Cube\" will match /World/Env1/Cube, \n /World/Env2/Cube..etc.\n (a non regex prim path can also be used to encapsulate one rigid prim).\n name (str, optional): shortname to be used as a key by Scene class. \n Note: needs to be unique if the object is added to the Scene. \n Defaults to \"rigid_contact_view\".\n prepare_contact_sensors (bool, Optional): if rigid prims in the view are not cloned from a prim in a prepared state, \n (although slow for large number of prims) this ensures that \n appropriate physics settings are applied on all the prim in the view. \n disable_stablization (bool, optional): disables the contact stablization parameter in the physics context \n apply_rigid_body_api (bool, optional): apply rigid body API to prims in prim_paths_expr and filter_paths_expr when prepare_contact_sensors=True \n ", "snippet": "rigid_contact_view = RigidContactView(prim_paths_expr=prim_paths_expr, # str\n filter_paths_expr=filter_paths_expr, # typing.List[str]\n name=\"rigid_contact_view\", # str\n prepare_contact_sensors=True, # bool\n disable_stablization=True, # bool\n apply_rigid_body_api=True) # bool\n" }, { "title": "get_contact_force_matrix", "description": "Gets the contact forces between the prims in the view and the filter prims. i.e., a matrix of dimension \n (self.num_shapes, self.num_filters, 3) where filter_count is the determined according to the filter_paths_expr parameter.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n dt (float): time step multiplier to convert the underlying impulses to forces. The function returns contact impulses if the default dt is used\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (M, self.num_filters, 3).\n ", "snippet": "contact_force_matrix = rigid_contact_view.get_contact_force_matrix(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True, # bool\n dt=1.0) # float\n" }, { "title": "get_net_contact_forces", "description": "Gets the overall net contact forces on the prims in the view with respect to the world's frame.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n dt (float): time step multiplier to convert the underlying impulses to forces. The function returns contact impulses if the default dt is used\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (M,3).\n ", "snippet": "net_contact_forces = rigid_contact_view.get_net_contact_forces(indices=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n clone=True, # bool\n dt=1.0) # float\n" }, { "title": "initialize", "description": "Create a physics simulation view if not passed and creates a rigid contact view in physX.\n\n Args:\n physics_sim_view (omni.physics.tensors.SimulationView, optional): current physics simulation view. Defaults to None.\n ", "snippet": "rigid_contact_view.initialize(physics_sim_view=None) # omni.physics.tensors.bindings._physicsTensors.SimulationView\n" }, { "title": "is_physics_handle_valid", "description": " Returns:\n bool: True if the physics handle of the view is valid (i.e physics is initialized for the view). Otherwise False.\n ", "snippet": "rigid_contact_view.is_physics_handle_valid()\n" } ] }, { "title": "RigidPrim", "snippets": [ { "title": "RigidPrim", "description": " Provides high level functions to deal with a rigid body prim and its attributes/ properties.\n If there is an prim present at the path, it will use it. Otherwise, a new XForm prim at\n the specified prim path will be created.\n Notes: if the prim does not already have a rigid body api applied to it before init, it will apply it.\n\n Args:\n prim_path (str): prim path of the Prim to encapsulate or create.\n name (str, optional): shortname to be used as a key by Scene class. \n Note: needs to be unique if the object is added to the Scene. \n Defaults to \"rigid_prim\".\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world/ local frame of the prim\n (depends if translation or position is specified).\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n scale (Optional[Sequence[float]], optional): local scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n visible (bool, optional): set to false for an invisible prim in the stage while rendering. Defaults to True.\n mass (Optional[float], optional): mass in kg. Defaults to None.\n linear_velocity (Optional[np.ndarray], optional): linear velocity in the world frame. Defaults to None.\n angular_velocity (Optional[np.ndarray], optional): angular velocity in the world frame. Defaults to None.\n\n ", "snippet": "rigid_prim = RigidPrim(prim_path=prim_path, # str\n name=\"rigid_prim\", # str\n position=None, # typing.Union[typing.Sequence[float], NoneType]\n translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None, # typing.Union[typing.Sequence[float], NoneType]\n scale=None, # typing.Union[typing.Sequence[float], NoneType]\n visible=None, # typing.Union[bool, NoneType]\n mass=None, # typing.Union[float, NoneType]\n density=None, # typing.Union[float, NoneType]\n linear_velocity=None, # typing.Union[numpy.ndarray, NoneType]\n angular_velocity=None) # typing.Union[numpy.ndarray, NoneType]\n" }, { "title": "disable_rigid_body_physics", "description": " disable rigid body physics (enabled by default):\n Object will not be moved by external forces such as gravity and collisions\n ", "snippet": "rigid_prim.disable_rigid_body_physics()\n" }, { "title": "enable_rigid_body_physics", "description": " enable rigid body physics (enabled by default):\n Object will be moved by external forces such as gravity and collisions\n ", "snippet": "rigid_prim.enable_rigid_body_physics()\n" }, { "title": "get_angular_velocity", "description": " Returns:\n np.ndarray: current angular velocity of the the rigid prim. Shape (3,).\n ", "snippet": "angular_velocity = rigid_prim.get_angular_velocity()\n" }, { "title": "get_current_dynamic_state", "description": " \n Returns:\n DynamicState: the dynamic state of the rigid body including position, orientation, linear_velocity and angular_velocity.\n ", "snippet": "current_dynamic_state = rigid_prim.get_current_dynamic_state()\n" }, { "title": "get_default_state", "description": " Returns:\n DynamicState: returns the default state of the prim (position, orientation, linear_velocity and \n angular_velocity) that is used after each reset.\n ", "snippet": "default_state = rigid_prim.get_default_state()\n" }, { "title": "get_density", "description": " Returns:\n float: density of the rigid body.\n ", "snippet": "density = rigid_prim.get_density()\n" }, { "title": "get_linear_velocity", "description": " Returns:\n np.ndarray: current linear velocity of the the rigid prim. Shape (3,).\n ", "snippet": "linear_velocity = rigid_prim.get_linear_velocity()\n" }, { "title": "get_mass", "description": " Returns:\n float: mass of the rigid body in kg.\n ", "snippet": "mass = rigid_prim.get_mass()\n" }, { "title": "get_sleep_threshold", "description": " Returns:\n float: Mass-normalized kinetic energy threshold below which \n an actor may go to sleep. Range: [0, inf)\n Defaults: 0.00005 * tolerancesSpeed* tolerancesSpeed\n Units: distance^2 / second^2.\n ", "snippet": "sleep_threshold = rigid_prim.get_sleep_threshold()\n" }, { "title": "set_angular_velocity", "description": "Sets the angular velocity of the prim in stage.\n Args:\n velocity (np.ndarray): angular velocity to set the rigid prim to. Shape (3,).\n ", "snippet": "rigid_prim.set_angular_velocity(velocity=velocity) # numpy.ndarray\n" }, { "title": "set_default_state", "description": " Sets the default state of the prim, that will be used after each reset. \n \n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n linear_velocity (np.ndarray): linear velocity to set the rigid prim to. Shape (3,).\n angular_velocity (np.ndarray): angular velocity to set the rigid prim to. Shape (3,).\n ", "snippet": "rigid_prim.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None, # typing.Union[typing.Sequence[float], NoneType]\n linear_velocity=None, # typing.Union[numpy.ndarray, NoneType]\n angular_velocity=None) # typing.Union[numpy.ndarray, NoneType]\n" }, { "title": "set_density", "description": " Args:\n mass (float): density of the rigid body.\n ", "snippet": "rigid_prim.set_density(density=density) # float\n" }, { "title": "set_linear_velocity", "description": "Sets the linear velocity of the prim in stage.\n Args:\n velocity (np.ndarray): linear velocity to set the rigid prim to. Shape (3,).\n ", "snippet": "rigid_prim.set_linear_velocity(velocity=velocity) # numpy.ndarray\n" }, { "title": "set_mass", "description": " Args:\n mass (float): mass of the rigid body in kg.\n ", "snippet": "rigid_prim.set_mass(mass=mass) # float\n" }, { "title": "set_sleep_threshold", "description": " Args:\n threshold (float): Mass-normalized kinetic energy threshold below which \n an actor may go to sleep. Range: [0, inf)\n Defaults: 0.00005 * tolerancesSpeed* tolerancesSpeed\n Units: distance^2 / second^2.\n ", "snippet": "rigid_prim.set_sleep_threshold(threshold=threshold) # float\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "rigid_prim.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = rigid_prim.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = rigid_prim.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = rigid_prim.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = rigid_prim.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = rigid_prim.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = rigid_prim.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = rigid_prim.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "rigid_prim.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "rigid_prim.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "rigid_prim.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "rigid_prim.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "rigid_prim.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "rigid_prim.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "rigid_prim.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "rigid_prim.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "rigid_prim.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "RigidPrimView", "snippets": [ { "title": "RigidPrimView", "description": "Provides high level functions to deal with prims that has rigid body api applied to it (1 or more rigid body prims) \n as well as its attributes/ properties.\n This object wraps all matching Rigid Prims found at the regex provided at the prim_paths_expr.\n Note: \n - each prim will have \"xformOp:orient\", \"xformOp:translate\" and \"xformOp:scale\" only post init,\n unless it is a non-root articulation link.\n - if the prim does not already have a rigid body api applied to it before init, it will apply it.\n\n Args:\n prim_paths_expr (str): prim paths regex to encapsulate all prims that match it.\n example: \"/World/Env[1-5]/Cube\" will match /World/Env1/Cube, \n /World/Env2/Cube..etc.\n (a non regex prim path can also be used to encapsulate one rigid prim).\n name (str, optional): shortname to be used as a key by Scene class. \n Note: needs to be unique if the object is added to the Scene. \n Defaults to \"rigid_prim_view\".\n positions (Optional[Union[np.ndarray, torch.Tensor]], optional): \n default positions in the world frame of the prims. \n shape is (N, 3).\n Defaults to None, which means left unchanged.\n translations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n default translations in the local frame of the prims\n (with respect to its parent prims). shape is (N, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n default quaternion orientations in the world/ local frame of the prims\n (depends if translation or position is specified).\n quaternion is scalar-first (w, x, y, z). shape is (N, 4).\n Defaults to None, which means left unchanged.\n scales (Optional[Union[np.ndarray, torch.Tensor]], optional): local scales to be applied to \n the prim's dimensions in the view. shape is (N, 3).\n Defaults to None, which means left unchanged.\n visibilities (Optional[Union[np.ndarray, torch.Tensor]], optional): set to false for an invisible prim in \n the stage while rendering. shape is (N,). \n Defaults to None.\n reset_xform_properties (bool, optional): True if the prims don't have the right set of xform properties \n (i.e: translate, orient and scale) ONLY and in that order.\n Set this parameter to False if the object were cloned using using \n the cloner api in omni.isaac.cloner. Defaults to True.\n masses (Optional[Union[np.ndarray, torch.Tensor]], optional): mass in kg specified for each prim in the view. \n shape is (N,). Defaults to None.\n densities (Optional[Union[np.ndarray, torch.Tensor]], optional): density in kg/m^3 specified for each prim in the view. \n shape is (N,). Defaults to None.\n linear_velocities (Optional[Union[np.ndarray, torch.Tensor]], optional): default linear velocity of each prim in the view\n (to be applied in the first frame and on resets). \n Shape is (N, 3). Defaults to None.\n angular_velocities (Optional[Union[np.ndarray, torch.Tensor]], optional): default angular velocity of each prim in the view\n (to be applied in the first frame and on resets). \n Shape is (N, 3). Defaults to None.\n track_contact_forces (bool, Optional) : if enabled, the view will track the net contact forces on each rigid prim in the view\n prepare_contact_sensors (bool, Optional): if rigid prims in the view are not cloned from a prim in a prepared state, \n (although slow for large number of prims) this ensures that \n appropriate physics settings are applied on all the prim in the view.\n disable_stablization (bool, optional): disables the contact stablization parameter in the physics context \n contact_filter_prim_paths_expr (Optional[List[str]], Optional): a list of filter expressions which allows for tracking contact forces \n between prims and this subset through get_contact_force_matrix(). \n ", "snippet": "rigid_prim_view = RigidPrimView(prim_paths_expr=prim_paths_expr, # str\n name=\"rigid_prim_view\", # str\n positions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n translations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n scales=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n visibilities=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n reset_xform_properties=True, # bool\n masses=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n densities=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n linear_velocities=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n angular_velocities=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n track_contact_forces=False, # bool\n prepare_contact_sensors=True, # bool\n disable_stablization=True, # bool\n contact_filter_prim_paths_expr=[]) # typing.Union[typing.List[str], NoneType]\n" }, { "title": "apply_forces", "description": "Applies forces to prims in the view.\n\n Args:\n forces (Optional[Union[np.ndarray, torch.Tensor]]): forces to be applied to the prims.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n is_global (bool, optional): True if forces are in the global frame. Otherwise False. Defaults to True.\n\n ", "snippet": "rigid_prim_view.apply_forces(forces=forces, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n is_global=True) # bool\n" }, { "title": "apply_forces_and_torques_at_pos", "description": "Applies forces and torques to prims in the view. The forces and/or torques can be in local or global coordinates.\n The forces can applied at a location given by positions variable.\n\n Args:\n forces (Optional[Union[np.ndarray, torch.Tensor]]): forces to be applied to the prims. If not specified, no force will be applied.\n Defaults to None (i.e: no forces will be applied).\n torques (Optional[Union[np.ndarray, torch.Tensor]]): torques to be applied to the prims. If not specified, no torque will be applied.\n Defaults to None (i.e: no torques will be applied).\n positions (Optional[Union[np.ndarray, torch.Tensor]]): position of the forces with respect to the body frame.\n If not specified, the forces are applied at the origin of the body frame.\n Defaults to None (i.e: applied forces will be at the origin of the body frame).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n is_global (bool, optional): True if forces, torques, and positions are in the global frame.\n False if forces, torques, and positions are in the local frame. Defaults to True.\n ", "snippet": "rigid_prim_view.apply_forces_and_torques_at_pos(forces=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n torques=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n positions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n is_global=True) # bool\n" }, { "title": "disable_gravities", "description": " disable gravity on rigid bodies (enabled by default):\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "rigid_prim_view.disable_gravities(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "disable_rigid_body_physics", "description": " disable rigid body physics (enabled by default):\n Object will not be moved by external forces such as gravity and collisions\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "rigid_prim_view.disable_rigid_body_physics(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "enable_gravities", "description": " enable gravity on rigid bodies (enabled by default):\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "rigid_prim_view.enable_gravities(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "enable_rigid_body_physics", "description": " enable rigid body physics (enabled by default):\n Object will be moved by external forces such as gravity and collisions\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "rigid_prim_view.enable_rigid_body_physics(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_angular_velocities", "description": "Gets the angular velocities of prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: angular velocities of the prims in the view. shape is (M, 3).\n ", "snippet": "angular_velocities = rigid_prim_view.get_angular_velocities(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_coms", "description": "Gets rigid body center of mass of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: rigid body center of mass positions and orientations of prims in the view. \n position shape is (M, 3), orientation shape is (M, 4).\n ", "snippet": "coms = rigid_prim_view.get_coms(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_contact_force_matrix", "description": " If the object is initialized with filter_paths_expr list, this method returns the contact forces between the prims \n in the view and the filter prims. i.e., a matrix of dimension (self.count, self._contact_view.num_filters, 3) \n where num_filters is the determined according to the filter_paths_expr parameter.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (M, self._contact_view.num_filters, 3).\n ", "snippet": "contact_force_matrix = rigid_prim_view.get_contact_force_matrix(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True, # bool\n dt=1.0) # float\n" }, { "title": "get_current_dynamic_state", "description": " \n Returns:\n DynamicState: the dynamic state of the rigid bodies including positions, orientations, linear_velocities and angular_velocities.\n ", "snippet": "current_dynamic_state = rigid_prim_view.get_current_dynamic_state()\n" }, { "title": "get_default_state", "description": "Gets the default state of prims in the view, that will be used after each reset. \n\n Returns:\n DynamicsViewState: returns the default state of the prims (positions, orientations, linear_velocities and \n angular_velocities) that is used after each reset.\n ", "snippet": "default_state = rigid_prim_view.get_default_state()\n" }, { "title": "get_densities", "description": "Gets densities of prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n \n Returns:\n Union[np.ndarray, torch.Tensor]: densities of prims in the view in kg/m^3. shape (M,).\n ", "snippet": "densities = rigid_prim_view.get_densities(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_inertias", "description": "Gets rigid body inertias of prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: rigid body inertias of prims in the view. \n shape is (M, 9).\n ", "snippet": "inertias = rigid_prim_view.get_inertias(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_inv_inertias", "description": "Gets rigid body inverse inertias of prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: rigid body inverse inertias of prims in the view. \n shape is (M, 9).\n ", "snippet": "inv_inertias = rigid_prim_view.get_inv_inertias(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_inv_masses", "description": "Gets rigid body inverse masses of prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: rigid body inverse masses of prims in the view. \n shape is (M,).\n ", "snippet": "inv_masses = rigid_prim_view.get_inv_masses(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_linear_velocities", "description": "Gets the linear velocities of prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: linear velocities of the prims in the view. shape is (M, 3).\n ", "snippet": "linear_velocities = rigid_prim_view.get_linear_velocities(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_local_poses", "description": "Gets prim poses in the view with respect to the local frame (the prim's parent frame).\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: \n first index is positions in the local frame of the prims. shape is (M, 3). \n second index is quaternion orientations in the local frame of the prims.\n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n ", "snippet": "local_poses = rigid_prim_view.get_local_poses(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_masses", "description": "Gets rigid body masses of prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: masses of in kg of prims in the view. shape is (M,).\n ", "snippet": "masses = rigid_prim_view.get_masses(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_net_contact_forces", "description": " If contact forces of the prims in the view are tracked, this method returns the net contact forces on prims. \n i.e., a matrix of dimension (self.count, 3)\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n dt (float): time step multiplier to convert the underlying impulses to forces. If the default value is used then the forces are in fact contact impulses\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Net contact forces of the prims with shape (M,3).\n\n ", "snippet": "net_contact_forces = rigid_prim_view.get_net_contact_forces(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True, # bool\n dt=1.0) # float\n" }, { "title": "get_sleep_thresholds", "description": "Gets sleep thresholds of prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n \n Returns:\n Union[np.ndarray, torch.Tensor]: Mass-normalized kinetic energy threshold below which \n an actor may go to sleep. Range: [0, inf)\n Defaults: 0.00005 * tolerancesSpeed* tolerancesSpeed\n Units: distance^2 / second^2. shape (M,).\n ", "snippet": "sleep_thresholds = rigid_prim_view.get_sleep_thresholds(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_velocities", "description": "Gets the linear and angular velocities of prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: linear and angular velocities of the prims in the view concatenated. shape is (M, 6).\n ", "snippet": "velocities = rigid_prim_view.get_velocities(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_world_poses", "description": "Gets the poses of the prims in the view with respect to the world's frame.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: \n first index is positions in the world frame of the prims. shape is (M, 3). \n second index is quaternion orientations in the world frame of the prims.\n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n ", "snippet": "world_poses = rigid_prim_view.get_world_poses(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "initialize", "description": "Create a physics simulation view if not passed and creates a rigid body view in physX.\n\n Args:\n physics_sim_view (omni.physics.tensors.SimulationView, optional): current physics simulation view. Defaults to None.\n ", "snippet": "rigid_prim_view.initialize(physics_sim_view=None) # omni.physics.tensors.bindings._physicsTensors.SimulationView\n" }, { "title": "is_physics_handle_valid", "description": " Returns:\n bool: True if the physics handle of the view is valid (i.e physics is initialized for the view). Otherwise False.\n ", "snippet": "rigid_prim_view.is_physics_handle_valid()\n" }, { "title": "post_reset", "description": "Resets the prims to its default state.\n ", "snippet": "rigid_prim_view.post_reset()\n" }, { "title": "set_angular_velocities", "description": "Sets the angular velocities of the prims in the view. The method does this through the physx API only.\n i.e: It has to be called after initialization.\n Note: This method is not supported for the gpu pipeline. set_velocities method should be used instead.\n\n Args:\n velocities (Optional[Union[np.ndarray, torch.Tensor]]): angular velocities to set the rigid prims to. shape is (M, 3).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "rigid_prim_view.set_angular_velocities(velocities=velocities, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_coms", "description": "Sets body center of mass positions and orientations for articulation bodies in the view.\n\n Args:\n positions (Union[np.ndarray, torch.Tensor]): body center of mass positions for articulations in the view. shape (M, K, 3).\n orientations (Union[np.ndarray, torch.Tensor]): body center of mass orientations for articulations in the view. shape (M, K, 4).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "rigid_prim_view.set_coms(positions=None, # typing.Union[numpy.ndarray, torch.Tensor]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_default_state", "description": "Sets the default state of prims in the view, that will be used after each reset. \n\n Args:\n positions (Optional[np.ndarray], optional): default positions in the world frame of the prim. shape is (M, 3).\n orientations (Optional[np.ndarray], optional): default quaternion orientations in the world frame of the prims.\n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n linear_velocities (Optional[np.ndarray], optional): default linear velocities of each prim in the view\n (to be applied in the first frame and on resets).\n Shape is (M, 3). Defaults to None.\n angular_velocities (Optional[np.ndarray], optional): default angular velocities of each prim in the view\n (to be applied in the first frame and on resets).\n Shape is (M, 3). Defaults to None.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "rigid_prim_view.set_default_state(positions=None, # typing.Union[numpy.ndarray, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, NoneType]\n linear_velocities=None, # typing.Union[numpy.ndarray, NoneType]\n angular_velocities=None, # typing.Union[numpy.ndarray, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_densities", "description": "Sets densities of prims in the view.\n\n Args:\n densities (Optional[Union[np.ndarray, torch.Tensor]]): density in kg/m^3 specified for each prim in the view. \n shape is (M,). Defaults to None.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "rigid_prim_view.set_densities(densities=densities, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_inertias", "description": "Sets body inertias for prims in the view.\n\n Args:\n values (Union[np.ndarray, torch.Tensor]): body inertias for prims in the view. shape (M, K, 9).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "rigid_prim_view.set_inertias(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_linear_velocities", "description": "Sets the linear velocities of the prims in the view. The method does this through the physx API only.\n i.e: It has to be called after initialization.\n Note: This method is not supported for the gpu pipeline. set_velocities method should be used instead.\n\n Args:\n velocities (Optional[Union[np.ndarray, torch.Tensor]]): linear velocities to set the rigid prims to. shape is (M, 3).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "rigid_prim_view.set_linear_velocities(velocities=velocities, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_local_poses", "description": "Sets prim poses in the view with respect to the local frame (the prim's parent frame).\n\n Args:\n translations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n translations in the local frame of the prims\n (with respect to its parent prim). shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n quaternion orientations in the local frame of the prims. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "rigid_prim_view.set_local_poses(translations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_masses", "description": "Sets body masses for prims in the view.\n\n Args:\n masses (Union[np.ndarray, torch.Tensor]): body masses for prims in kg. shape (M,).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "rigid_prim_view.set_masses(masses=masses, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_sleep_thresholds", "description": "Sets sleep thresholds of prims in the view.\n \n\n Args:\n\n thresholds (Optional[Union[np.ndarray, torch.Tensor]]): Mass-normalized kinetic energy threshold below which \n an actor may go to sleep. Range: [0, inf)\n Defaults: 0.00005 * tolerancesSpeed* tolerancesSpeed\n Units: distance^2 / second^2. shape (M,).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "rigid_prim_view.set_sleep_thresholds(thresholds=thresholds, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_velocities", "description": "Sets the linear and angular velocities of the prims in the view at once. The method does this through the physx API only.\n i.e: It has to be called after initialization.\n\n Args:\n velocities (Optional[Union[np.ndarray, torch.Tensor]]): linear and angular velocities respectively to set the rigid prims to. shape is (M, 6).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "rigid_prim_view.set_velocities(velocities=velocities, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_world_poses", "description": "Sets poses of prims in the view with respect to the world's frame.\n\n Args:\n positions (Optional[Union[np.ndarray, torch.Tensor]], optional): positions in the world frame of the prim. shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): quaternion orientations in the world frame of the prims. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "rigid_prim_view.set_world_poses(positions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "apply_visual_materials", "description": "Used to apply visual material to the prims and optionally its prim descendants.\n\n Args:\n visual_materials (Union[VisualMaterial, List[VisualMaterial]]): visual materials to be applied to the prims. Currently supports\n PreviewSurface, OmniPBR and OmniGlass. If a list is provided then\n its size has to be equal the view's size or indices size. \n If one material is provided it will be applied to all prims in the view.\n weaker_than_descendants (Optional[Union[bool, List[bool]]], optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False. \n If a list of visual materials is provided then a list\n has to be provided with the same size for this arg as well.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Raises:\n Exception: length of visual materials != length of prims indexed\n Exception: length of visual materials != length of weaker descendants bools arg\n ", "snippet": "rigid_prim_view.apply_visual_materials(visual_materials=visual_materials, # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, typing.List[omni.isaac.core.materials.visual_material.VisualMaterial]]\n weaker_than_descendants=None, # typing.Union[bool, typing.List[bool], NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_applied_visual_materials", "description": "\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n List[VisualMaterial]: a list of the current applied visual materials to the prims if its type is currently supported.\n ", "snippet": "applied_visual_materials = rigid_prim_view.get_applied_visual_materials(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimViewState: returns the default state of the prims (positions and orientations) that is used after each reset.\n ", "snippet": "default_state = rigid_prim_view.get_default_state()\n" }, { "title": "get_local_poses", "description": "Gets prim poses in the view with respect to the local's frame (the prim's parent frame).\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: \n first index is translations in the local frame of the prims. shape is (M, 3). \n second index is quaternion orientations in the local frame of the prims.\n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n ", "snippet": "local_poses = rigid_prim_view.get_local_poses(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_local_scales", "description": "Gets prim scales in the view with respect to the local frame (the parent's frame).\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: scales applied to the prim's dimensions in the local frame. shape is (M, 3).\n ", "snippet": "local_scales = rigid_prim_view.get_local_scales(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_visibilities", "description": "Returns the current visibilities of the prims in stage.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Shape (M,) with type bool, where each item holds True \n if the prim is visible in stage. False otherwise.\n ", "snippet": "visibilities = rigid_prim_view.get_visibilities(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_world_poses", "description": " Returns the poses (positions and orientations) of the prims in the view with respect to the world frame.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: first index is positions in the world frame of the prims. shape is (M, 3). \n second index is quaternion orientations in the world frame of the prims.\n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n ", "snippet": "world_poses = rigid_prim_view.get_world_poses(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_world_scales", "description": "Gets prim scales in the view with respect to the world's frame.\n\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: scales applied to the prim's dimensions in the world frame. shape is (M, 3).\n ", "snippet": "world_scales = rigid_prim_view.get_world_scales(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "initialize", "description": "", "snippet": "rigid_prim_view.initialize(physics_sim_view=None) # omni.physics.tensors.bindings._physicsTensors.SimulationView\n" }, { "title": "is_valid", "description": " Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n bool: True if all prim paths specified in the view correspond to a valid prim in stage. False otherwise.\n ", "snippet": "rigid_prim_view.is_valid(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "is_visual_material_applied", "description": " Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n List[bool]: True if there is a visual material applied is applied to the corresponding prim in the view. False otherwise.\n ", "snippet": "rigid_prim_view.is_visual_material_applied(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "post_reset", "description": "Resets the prims to its default state (positions and orientations).\n ", "snippet": "rigid_prim_view.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prims (positions and orientations), that will be used after each reset.\n\n Args:\n positions (Optional[np.ndarray], optional): positions in the world frame of the prim. shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[np.ndarray], optional): quaternion orientations in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "rigid_prim_view.set_default_state(positions=None, # typing.Union[numpy.ndarray, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_local_poses", "description": "Sets prim poses in the view with respect to the local frame (the prim's parent frame).\n\n Args:\n translations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n translations in the local frame of the prims\n (with respect to its parent prim). shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n quaternion orientations in the local frame of the prims. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "rigid_prim_view.set_local_poses(translations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_local_scales", "description": "Sets prim scales in the view with respect to the local frame (the prim's parent frame).\n\n Args:\n scales (Optional[Union[np.ndarray, torch.Tensor]]): scales to be applied to the prim's dimensions in the view. \n shape is (M, 3).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "rigid_prim_view.set_local_scales(scales=scales, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_visibilities", "description": "Sets the visibilities of the prims in stage.\n\n Args:\n visibilities (Union[np.ndarray, torch.Tensor]): flag to set the visibilities of the usd prims in stage. \n Shape (M,). Where M <= size of the encapsulated prims in the view.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "rigid_prim_view.set_visibilities(visibilities=visibilities, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_world_poses", "description": "Sets prim poses in the view with respect to the world's frame.\n\n Args:\n positions (Optional[Union[np.ndarray, torch.Tensor]], optional): positions in the world frame of the prims. shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): quaternion orientations in the world frame of the prims. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "rigid_prim_view.set_world_poses(positions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" } ] }, { "title": "XFormPrim", "snippets": [ { "title": "XFormPrim", "description": "Provides high level functions to deal with an Xform prim and its attributes/ properties.\n If there is an Xform prim present at the path, it will use it. Otherwise, a new XForm prim at\n the specified prim path will be created.\n\n Note: the prim will have \"xformOp:orient\", \"xformOp:translate\" and \"xformOp:scale\" only post init, \n unless it is a non-root articulation link.\n\n Args:\n prim_path (str): prim path of the Prim to encapsulate or create.\n name (str, optional): shortname to be used as a key by Scene class. \n Note: needs to be unique if the object is added to the Scene.\n Defaults to \"xform_prim\".\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world/ local frame of the prim\n (depends if translation or position is specified).\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n scale (Optional[Sequence[float]], optional): local scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n visible (bool, optional): set to false for an invisible prim in the stage while rendering. Defaults to True.\n\n Raises:\n Exception: if translation and position defined at the same time", "snippet": "xform_prim = XFormPrim(prim_path=prim_path, # str\n name=\"xform_prim\", # str\n position=None, # typing.Union[typing.Sequence[float], NoneType]\n translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None, # typing.Union[typing.Sequence[float], NoneType]\n scale=None, # typing.Union[typing.Sequence[float], NoneType]\n visible=None) # typing.Union[bool, NoneType]\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "xform_prim.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = xform_prim.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = xform_prim.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = xform_prim.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = xform_prim.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = xform_prim.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = xform_prim.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = xform_prim.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "xform_prim.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "xform_prim.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "xform_prim.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "xform_prim.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "xform_prim.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "xform_prim.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "xform_prim.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "xform_prim.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "xform_prim.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "XFormPrimView", "snippets": [ { "title": "XFormPrimView", "description": "Provides high level functions to deal with an Xform prim view (1 or more XForm prims and its descendants) \n as well as its attributes/ properties.\n This object wraps all matching XForms found at the regex provided at the prim_paths_expr.\n\n Note: each prim will have \"xformOp:orient\", \"xformOp:translate\" and \"xformOp:scale\" only post init,\n unless it is a non-root articulation link.\n\n Args:\n prim_paths_expr (str): prim paths regex to encapsulate all prims that match it.\n example: \"/World/Env[1-5]/Franka\" will match /World/Env1/Franka, \n /World/Env2/Franka..etc.\n (a non regex prim path can also be used to encapsulate one XForm).\n name (str, optional): shortname to be used as a key by Scene class. \n Note: needs to be unique if the object is added to the Scene. \n Defaults to \"xform_prim_view\".\n positions (Optional[Union[np.ndarray, torch.Tensor]], optional): \n default positions in the world frame of the prim. \n shape is (N, 3).\n Defaults to None, which means left unchanged.\n translations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n default translations in the local frame of the prims\n (with respect to its parent prims). shape is (N, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n default quaternion orientations in the world/ local frame of the prim\n (depends if translation or position is specified).\n quaternion is scalar-first (w, x, y, z). shape is (N, 4).\n Defaults to None, which means left unchanged.\n scales (Optional[Union[np.ndarray, torch.Tensor]], optional): local scales to be applied to \n the prim's dimensions. shape is (N, 3).\n Defaults to None, which means left unchanged.\n visibilities (Optional[Union[np.ndarray, torch.Tensor]], optional): set to false for an invisible prim in \n the stage while rendering. shape is (N,). \n Defaults to None.\n reset_xform_properties (bool, optional): True if the prims don't have the right set of xform properties \n (i.e: translate, orient and scale) ONLY and in that order.\n Set this parameter to False if the object were cloned using using \n the cloner api in omni.isaac.cloner. Defaults to True.\n\n Raises:\n Exception: if translations and positions defined at the same time.\n Exception: No prim was matched using the prim_paths_expr provided.", "snippet": "xform_prim_view = XFormPrimView(prim_paths_expr=prim_paths_expr, # str\n name=\"xform_prim_view\", # str\n positions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n translations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n scales=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n visibilities=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n reset_xform_properties=True) # bool\n" }, { "title": "apply_visual_materials", "description": "Used to apply visual material to the prims and optionally its prim descendants.\n\n Args:\n visual_materials (Union[VisualMaterial, List[VisualMaterial]]): visual materials to be applied to the prims. Currently supports\n PreviewSurface, OmniPBR and OmniGlass. If a list is provided then\n its size has to be equal the view's size or indices size. \n If one material is provided it will be applied to all prims in the view.\n weaker_than_descendants (Optional[Union[bool, List[bool]]], optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False. \n If a list of visual materials is provided then a list\n has to be provided with the same size for this arg as well.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Raises:\n Exception: length of visual materials != length of prims indexed\n Exception: length of visual materials != length of weaker descendants bools arg\n ", "snippet": "xform_prim_view.apply_visual_materials(visual_materials=visual_materials, # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, typing.List[omni.isaac.core.materials.visual_material.VisualMaterial]]\n weaker_than_descendants=None, # typing.Union[bool, typing.List[bool], NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_applied_visual_materials", "description": "\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n List[VisualMaterial]: a list of the current applied visual materials to the prims if its type is currently supported.\n ", "snippet": "applied_visual_materials = xform_prim_view.get_applied_visual_materials(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimViewState: returns the default state of the prims (positions and orientations) that is used after each reset.\n ", "snippet": "default_state = xform_prim_view.get_default_state()\n" }, { "title": "get_local_poses", "description": "Gets prim poses in the view with respect to the local's frame (the prim's parent frame).\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: \n first index is translations in the local frame of the prims. shape is (M, 3). \n second index is quaternion orientations in the local frame of the prims.\n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n ", "snippet": "local_poses = xform_prim_view.get_local_poses(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_local_scales", "description": "Gets prim scales in the view with respect to the local frame (the parent's frame).\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: scales applied to the prim's dimensions in the local frame. shape is (M, 3).\n ", "snippet": "local_scales = xform_prim_view.get_local_scales(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_visibilities", "description": "Returns the current visibilities of the prims in stage.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Shape (M,) with type bool, where each item holds True \n if the prim is visible in stage. False otherwise.\n ", "snippet": "visibilities = xform_prim_view.get_visibilities(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_world_poses", "description": " Returns the poses (positions and orientations) of the prims in the view with respect to the world frame.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: first index is positions in the world frame of the prims. shape is (M, 3). \n second index is quaternion orientations in the world frame of the prims.\n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n ", "snippet": "world_poses = xform_prim_view.get_world_poses(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_world_scales", "description": "Gets prim scales in the view with respect to the world's frame.\n\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: scales applied to the prim's dimensions in the world frame. shape is (M, 3).\n ", "snippet": "world_scales = xform_prim_view.get_world_scales(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "initialize", "description": "", "snippet": "xform_prim_view.initialize(physics_sim_view=None) # omni.physics.tensors.bindings._physicsTensors.SimulationView\n" }, { "title": "is_valid", "description": " Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n bool: True if all prim paths specified in the view correspond to a valid prim in stage. False otherwise.\n ", "snippet": "xform_prim_view.is_valid(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "is_visual_material_applied", "description": " Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n List[bool]: True if there is a visual material applied is applied to the corresponding prim in the view. False otherwise.\n ", "snippet": "xform_prim_view.is_visual_material_applied(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "post_reset", "description": "Resets the prims to its default state (positions and orientations).\n ", "snippet": "xform_prim_view.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prims (positions and orientations), that will be used after each reset.\n\n Args:\n positions (Optional[np.ndarray], optional): positions in the world frame of the prim. shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[np.ndarray], optional): quaternion orientations in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "xform_prim_view.set_default_state(positions=None, # typing.Union[numpy.ndarray, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_local_poses", "description": "Sets prim poses in the view with respect to the local frame (the prim's parent frame).\n\n Args:\n translations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n translations in the local frame of the prims\n (with respect to its parent prim). shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n quaternion orientations in the local frame of the prims. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "xform_prim_view.set_local_poses(translations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_local_scales", "description": "Sets prim scales in the view with respect to the local frame (the prim's parent frame).\n\n Args:\n scales (Optional[Union[np.ndarray, torch.Tensor]]): scales to be applied to the prim's dimensions in the view. \n shape is (M, 3).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "xform_prim_view.set_local_scales(scales=scales, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_visibilities", "description": "Sets the visibilities of the prims in stage.\n\n Args:\n visibilities (Union[np.ndarray, torch.Tensor]): flag to set the visibilities of the usd prims in stage. \n Shape (M,). Where M <= size of the encapsulated prims in the view.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "xform_prim_view.set_visibilities(visibilities=visibilities, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_world_poses", "description": "Sets prim poses in the view with respect to the world's frame.\n\n Args:\n positions (Optional[Union[np.ndarray, torch.Tensor]], optional): positions in the world frame of the prims. shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): quaternion orientations in the world frame of the prims. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "xform_prim_view.set_world_poses(positions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" } ] } ] }, { "title": "Robots", "snippets": [ { "title": "Robot", "snippets": [ { "title": "Robot", "description": "[summary]\n\n Args:\n prim_path (str): [description]\n name (str, optional): [description]. Defaults to \"robot\".\n position (Optional[Sequence[float]], optional): [description]. Defaults to None.\n translation (Optional[Sequence[float]], optional): [description]. Defaults to None.\n orientation (Optional[Sequence[float]], optional): [description]. Defaults to None.\n scale (Optional[Sequence[float]], optional): [description]. Defaults to None.\n visible (bool, optional): [description]. Defaults to True.\n articulation_controller (Optional[ArticulationController], optional): [description]. Defaults to None.\n ", "snippet": "robot = Robot(prim_path=prim_path, # str\n name=\"robot\", # str\n position=None, # typing.Union[typing.Sequence[float], NoneType]\n translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None, # typing.Union[typing.Sequence[float], NoneType]\n scale=None, # typing.Union[typing.Sequence[float], NoneType]\n visible=True, # bool\n articulation_controller=None) # typing.Union[omni.isaac.core.controllers.articulation_controller.ArticulationController, NoneType]\n" }, { "title": "post_reset", "description": "[summary]\n ", "snippet": "robot.post_reset()\n" }, { "title": "apply_action", "description": "[summary]\n\n Args:\n control_actions (ArticulationAction): actions to be applied for next physics step.\n indices (Optional[Union[list, np.ndarray]], optional): degree of freedom indices to apply actions to. \n Defaults to all degrees of freedom.\n\n Raises:\n Exception: [description]\n ", "snippet": "robot.apply_action(control_actions=control_actions) # omni.isaac.core.utils.types.ArticulationAction\n" }, { "title": "disable_gravity", "description": "Keep gravity from affecting the robot\n ", "snippet": "robot.disable_gravity()\n" }, { "title": "enable_gravity", "description": "Gravity will affect the robot\n ", "snippet": "robot.enable_gravity()\n" }, { "title": "get_angular_velocity", "description": "[summary]\n\n Returns:\n np.ndarray: [description]\n ", "snippet": "angular_velocity = robot.get_angular_velocity()\n" }, { "title": "get_applied_action", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n ArticulationAction: [description]\n ", "snippet": "applied_action = robot.get_applied_action()\n" }, { "title": "get_applied_joint_efforts", "description": "Gets the efforts applied to the joints\n\n Args:\n joint_indices (Optional[Union[List, np.ndarray]], optional): _description_. Defaults to None.\n\n Raises:\n Exception: _description_\n\n Returns:\n np.ndarray: _description_\n ", "snippet": "applied_joint_efforts = robot.get_applied_joint_efforts(joint_indices=None) # typing.Union[typing.List, numpy.ndarray, NoneType]\n" }, { "title": "get_articulation_body_count", "description": "[summary]\n\n Returns:\n int: [description]\n ", "snippet": "articulation_body_count = robot.get_articulation_body_count()\n" }, { "title": "get_articulation_controller", "description": " Returns:\n ArticulationController: PD Controller of all degrees of freedom of an articulation, can apply position targets, velocity targets and efforts.\n ", "snippet": "articulation_controller = robot.get_articulation_controller()\n" }, { "title": "get_dof_index", "description": "[summary]\n\n Args:\n dof_name (str): [description]\n\n Returns:\n int: [description]\n ", "snippet": "dof_index = robot.get_dof_index(dof_name=dof_name) # str\n" }, { "title": "get_enabled_self_collisions", "description": "[summary]\n\n Returns:\n bool: [description]\n ", "snippet": "enabled_self_collisions = robot.get_enabled_self_collisions()\n" }, { "title": "get_joint_efforts", "description": " Deprecated function. Please use get_applied_joint_efforts instead.\n\n Args:\n joint_indices (Optional[Union[List, np.ndarray]], optional): _description_. Defaults to None.\n\n Raises:\n Exception: _description_\n\n Returns:\n np.ndarray: _description_\n ", "snippet": "joint_efforts = robot.get_joint_efforts(joint_indices=None) # typing.Union[typing.List, numpy.ndarray, NoneType]\n" }, { "title": "get_joint_positions", "description": "_summary_\n\n Args:\n joint_indices (Optional[Union[List, np.ndarray]], optional): _description_. Defaults to None.\n\n Returns:\n np.ndarray: _description_\n ", "snippet": "joint_positions = robot.get_joint_positions(joint_indices=None) # typing.Union[typing.List, numpy.ndarray, NoneType]\n" }, { "title": "get_joint_velocities", "description": "_summary_\n\n Args:\n joint_indices (Optional[Union[List, np.ndarray]], optional): _description_. Defaults to None.\n\n Returns:\n np.ndarray: _description_\n ", "snippet": "joint_velocities = robot.get_joint_velocities(joint_indices=None) # typing.Union[typing.List, numpy.ndarray, NoneType]\n" }, { "title": "get_joints_default_state", "description": " Accessor for the default joints state.\n\n Returns:\n JointsState: The defaults that the robot is reset to when post_reset() is called (often\n automatically called during world.reset()).\n ", "snippet": "joints_default_state = robot.get_joints_default_state()\n" }, { "title": "get_joints_state", "description": "[summary]\n\n Returns:\n JointsState: [description]\n ", "snippet": "joints_state = robot.get_joints_state()\n" }, { "title": "get_linear_velocity", "description": "[summary]\n\n Returns:\n np.ndarray: [description]\n ", "snippet": "linear_velocity = robot.get_linear_velocity()\n" }, { "title": "get_sleep_threshold", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "sleep_threshold = robot.get_sleep_threshold()\n" }, { "title": "get_solver_position_iteration_count", "description": "[summary]\n\n Returns:\n int: [description]\n ", "snippet": "solver_position_iteration_count = robot.get_solver_position_iteration_count()\n" }, { "title": "get_solver_velocity_iteration_count", "description": "[summary]\n\n Returns:\n int: [description]\n ", "snippet": "solver_velocity_iteration_count = robot.get_solver_velocity_iteration_count()\n" }, { "title": "get_stabilization_threshold", "description": "[summary]\n\n Returns:\n float: [description]\n ", "snippet": "stabilization_threshold = robot.get_stabilization_threshold()\n" }, { "title": "initialize", "description": "Create a physics simulation view if not passed and creates an articulation view using physX tensor api.\n This needs to be called after each hard reset (i.e stop + play on the timeline) before interacting with any\n of the functions of this class.\n\n Args:\n physics_sim_view (omni.physics.tensors.SimulationView, optional): current physics simulation view. Defaults to None.\n ", "snippet": "robot.initialize(physics_sim_view=None) # omni.physics.tensors.bindings._physicsTensors.SimulationView\n" }, { "title": "set_angular_velocity", "description": "[summary]\n\n Args:\n velocity (np.ndarray): [description]\n ", "snippet": "robot.set_angular_velocity(velocity=velocity) # numpy.ndarray\n" }, { "title": "set_enabled_self_collisions", "description": "[summary]\n\n Args:\n flag (bool): [description]\n ", "snippet": "robot.set_enabled_self_collisions(flag=flag) # bool\n" }, { "title": "set_joint_efforts", "description": "[summary]\n\n Args:\n efforts (np.ndarray): [description]\n joint_indices (Optional[Union[list, np.ndarray]], optional): [description]. Defaults to None.\n\n Raises:\n Exception: [description]\n ", "snippet": "robot.set_joint_efforts(efforts=efforts, # numpy.ndarray\n joint_indices=None) # typing.Union[typing.List, numpy.ndarray, NoneType]\n" }, { "title": "set_joint_positions", "description": "[summary]\n\n Args:\n positions (np.ndarray): [description]\n indices (Optional[Union[list, np.ndarray]], optional): [description]. Defaults to None.\n\n Raises:\n Exception: [description]\n ", "snippet": "robot.set_joint_positions(positions=positions, # numpy.ndarray\n joint_indices=None) # typing.Union[typing.List, numpy.ndarray, NoneType]\n" }, { "title": "set_joint_velocities", "description": "[summary]\n\n Args:\n velocities (np.ndarray): [description]\n indices (Optional[Union[list, np.ndarray]], optional): [description]. Defaults to None.\n\n Raises:\n Exception: [description]\n ", "snippet": "robot.set_joint_velocities(velocities=velocities, # numpy.ndarray\n joint_indices=None) # typing.Union[typing.List, numpy.ndarray, NoneType]\n" }, { "title": "set_joints_default_state", "description": "[summary]\n\n Args:\n positions (Optional[np.ndarray], optional): [description]. Defaults to None.\n velocities (Optional[np.ndarray], optional): [description]. Defaults to None.\n efforts (Optional[np.ndarray], optional): [description]. Defaults to None.\n ", "snippet": "robot.set_joints_default_state(positions=None, # typing.Union[numpy.ndarray, NoneType]\n velocities=None, # typing.Union[numpy.ndarray, NoneType]\n efforts=None) # typing.Union[numpy.ndarray, NoneType]\n" }, { "title": "set_linear_velocity", "description": "Sets the linear velocity of the prim in stage.\n\n Args:\n velocity (np.ndarray):linear velocity to set the rigid prim to. Shape (3,).\n ", "snippet": "robot.set_linear_velocity(velocity=velocity) # numpy.ndarray\n" }, { "title": "set_sleep_threshold", "description": "[summary]\n\n Args:\n threshold (float): [description]\n ", "snippet": "robot.set_sleep_threshold(threshold=threshold) # float\n" }, { "title": "set_solver_position_iteration_count", "description": "[summary]\n\n Args:\n count (int): [description]\n ", "snippet": "robot.set_solver_position_iteration_count(count=count) # int\n" }, { "title": "set_solver_velocity_iteration_count", "description": "[summary]\n\n Args:\n count (int): [description]\n ", "snippet": "robot.set_solver_velocity_iteration_count(count=count) # int\n" }, { "title": "set_stabilization_threshold", "description": "[summary]\n\n Args:\n threshold (float): [description]\n ", "snippet": "robot.set_stabilization_threshold(threshold=threshold) # float\n" }, { "title": "apply_visual_material", "description": "Used to apply visual material to the held prim and optionally its descendants.\n\n Args:\n visual_material (VisualMaterial): visual material to be applied to the held prim. Currently supports\n PreviewSurface, OmniPBR and OmniGlass.\n weaker_than_descendants (bool, optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False.\n ", "snippet": "robot.apply_visual_material(visual_material=visual_material, # omni.isaac.core.materials.visual_material.VisualMaterial\n weaker_than_descendants=False) # bool\n" }, { "title": "get_applied_visual_material", "description": "Returns the current applied visual material in case it was applied using apply_visual_material OR\n it's one of the following materials that was already applied before: PreviewSurface, OmniPBR and OmniGlass.\n\n Returns:\n VisualMaterial: the current applied visual material if its type is currently supported.\n ", "snippet": "applied_visual_material = robot.get_applied_visual_material()\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimState: returns the default state of the prim (position and orientation) that is used after each reset.\n ", "snippet": "default_state = robot.get_default_state()\n" }, { "title": "get_local_pose", "description": "Gets prim's pose with respect to the local frame (the prim's parent frame).\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the local frame of the prim. shape is (3, ). \n second index is quaternion orientation in the local frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "local_pose = robot.get_local_pose()\n" }, { "title": "get_local_scale", "description": "Gets prim's scale with respect to the local frame (the parent's frame).\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the local frame. shape is (3, ).\n ", "snippet": "local_scale = robot.get_local_scale()\n" }, { "title": "get_visibility", "description": " Returns:\n bool: true if the prim is visible in stage. false otherwise.\n ", "snippet": "visibility = robot.get_visibility()\n" }, { "title": "get_world_pose", "description": "Gets prim's pose with respect to the world's frame.\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame of the prim. shape is (3, ). \n second index is quaternion orientation in the world frame of the prim.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n ", "snippet": "world_pose = robot.get_world_pose()\n" }, { "title": "get_world_scale", "description": "Gets prim's scale with respect to the world's frame.\n\n Returns:\n np.ndarray: scale applied to the prim's dimensions in the world frame. shape is (3, ).\n ", "snippet": "world_scale = robot.get_world_scale()\n" }, { "title": "initialize", "description": "", "snippet": "robot.initialize(physics_sim_view=None)\n" }, { "title": "is_valid", "description": " Returns:\n bool: True is the current prim path corresponds to a valid prim in stage. False otherwise.\n ", "snippet": "robot.is_valid()\n" }, { "title": "is_visual_material_applied", "description": " Returns:\n bool: True if there is a visual material applied. False otherwise.\n ", "snippet": "robot.is_visual_material_applied()\n" }, { "title": "post_reset", "description": "Resets the prim to its default state (position and orientation).\n ", "snippet": "robot.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prim (position and orientation), that will be used after each reset.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "robot.set_default_state(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_pose", "description": "Sets prim's pose with respect to the local frame (the prim's parent frame).\n\n Args:\n translation (Optional[Sequence[float]], optional): translation in the local frame of the prim\n (with respect to its parent prim). shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the local frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "robot.set_local_pose(translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_local_scale", "description": "Sets prim's scale with respect to the local frame (the prim's parent frame).\n\n Args:\n scale (Optional[Sequence[float]]): scale to be applied to the prim's dimensions. shape is (3, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "robot.set_local_scale(scale=scale) # typing.Union[typing.Sequence[float], NoneType]\n" }, { "title": "set_visibility", "description": "Sets the visibility of the prim in stage.\n\n Args:\n visible (bool): flag to set the visibility of the usd prim in stage.\n ", "snippet": "robot.set_visibility(visible=visible) # bool\n" }, { "title": "set_world_pose", "description": "Sets prim's pose with respect to the world's frame.\n\n Args:\n position (Optional[Sequence[float]], optional): position in the world frame of the prim. shape is (3, ).\n Defaults to None, which means left unchanged.\n orientation (Optional[Sequence[float]], optional): quaternion orientation in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (4, ).\n Defaults to None, which means left unchanged.\n ", "snippet": "robot.set_world_pose(position=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None) # typing.Union[typing.Sequence[float], NoneType]\n" } ] }, { "title": "RobotView", "snippets": [ { "title": "RobotView", "description": "[summary]\n\n Args:\n prim_path (str): [description]\n name (str, optional): [description]. Defaults to \"robot\".\n position (Optional[np.ndarray], optional): [description]. Defaults to None.\n translation (Optional[np.ndarray], optional): [description]. Defaults to None.\n orientation (Optional[np.ndarray], optional): [description]. Defaults to None.\n scale (Optional[np.ndarray], optional): [description]. Defaults to None.\n visible (bool, optional): [description]. Defaults to True.\n articulation_controller (Optional[ArticulationController], optional): [description]. Defaults to None.\n ", "snippet": "robot_view = RobotView(prim_paths_expr=prim_paths_expr, # str\n name=\"rigid_prim_view\", # str\n positions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n translations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n scales=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n visibilities=None) # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n" }, { "title": "post_reset", "description": "[summary]\n ", "snippet": "robot_view.post_reset()\n" }, { "title": "apply_action", "description": " Applies ArticulationActions which encapsulates joint position targets, velocity targets, efforts and joint indices in one object.\n Can be used instead of the seperate set_joint_position_targets..etc.\n\n Args:\n control_actions (ArticulationActions): actions to be applied for next physics step.\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "robot_view.apply_action(control_actions=control_actions, # omni.isaac.core.utils.types.ArticulationActions\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "get_angular_velocities", "description": "Gets the angular velocities of prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: angular velocities of the prims in the view. shape is (M, 3).\n ", "snippet": "angular_velocities = robot_view.get_angular_velocities(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_applied_actions", "description": "Gets current applied actions in an ArticulationActions object.\n\n Args:\n clone (bool, optional): True to return clones of the internal buffers. Otherwise False. Defaults to True.\n\n Returns:\n ArticulationActions: current applied actions (i.e: current position targets and velocity targets)\n ", "snippet": "applied_actions = robot_view.get_applied_actions(clone=True) # bool\n" }, { "title": "get_applied_joint_efforts", "description": "Gets the joint efforts of articulations in the view. The method will return the efforts set by the set_joint_efforts.\n \n Args:\n efforts (Optional[Union[np.ndarray, torch.Tensor]]): efforts of articulations in the view to be set to in the next frame. \n shape is (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: joint efforts of articulations in the view assigned via set_joint_efforts. shape is (M, K).\n ", "snippet": "applied_joint_efforts = robot_view.get_applied_joint_efforts(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_armatures", "description": "Gets armatures for articulation in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to query. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n clone (Optional[bool]): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: maximum efforts for articulations in the view. shape (M, K).\n ", "snippet": "armatures = robot_view.get_armatures(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_articulation_body_count", "description": " Returns:\n int: number of links in the articulation.\n ", "snippet": "articulation_body_count = robot_view.get_articulation_body_count()\n" }, { "title": "get_body_coms", "description": "Gets rigid body center of mass of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n body_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): body indicies to specify which bodies \n to query. Shape (K,).\n Where K <= num of bodies.\n Defaults to None (i.e: all bodies).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: rigid body center of mass positions and orientations of articulations in the view. \n position shape is (M, K, 3), orientation shape is (M, k, 4).\n ", "snippet": "body_coms = robot_view.get_body_coms(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n body_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_body_index", "description": "Gets the body index in the articulation given its name.\n\n Args:\n body_name (str): name of the body/link to query.\n\n Returns:\n int: index of the body/link in the articulation buffers.\n ", "snippet": "body_index = robot_view.get_body_index(body_name=body_name) # str\n" }, { "title": "get_body_inertias", "description": "Gets rigid body inertias of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n body_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): body indicies to specify which bodies \n to query. Shape (K,).\n Where K <= num of bodies.\n Defaults to None (i.e: all bodies).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: rigid body inertias of articulations in the view. \n shape is (M, K, 9).\n ", "snippet": "body_inertias = robot_view.get_body_inertias(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n body_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_body_inv_inertias", "description": "Gets rigid body inverse inertias of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n body_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): body indicies to specify which bodies \n to query. Shape (K,).\n Where K <= num of bodies.\n Defaults to None (i.e: all bodies).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: rigid body inverse inertias of articulations in the view. \n shape is (M, K, 9).\n ", "snippet": "body_inv_inertias = robot_view.get_body_inv_inertias(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n body_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_body_inv_masses", "description": "Gets rigid body inverse masses of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n body_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): body indicies to specify which bodies \n to query. Shape (K,).\n Where K <= num of bodies.\n Defaults to None (i.e: all bodies).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: rigid body inverse masses of articulations in the view. \n shape is (M, K).\n ", "snippet": "body_inv_masses = robot_view.get_body_inv_masses(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n body_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_body_masses", "description": "Gets rigid body masses of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n body_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): body indicies to specify which bodies \n to query. Shape (K,).\n Where K <= num of bodies.\n Defaults to None (i.e: all bodies).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: rigid body masses of articulations in the view. \n shape is (M, K).\n ", "snippet": "body_masses = robot_view.get_body_masses(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n body_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_coriolis_and_centrifugal_forces", "description": "Gets the coriolis and centrifugal forces of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to query. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Coriolis and centrifugal forces of articulations in the view. \n shape is (M, K).\n ", "snippet": "coriolis_and_centrifugal_forces = robot_view.get_coriolis_and_centrifugal_forces(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_dof_index", "description": "Gets the dof index in the joint buffers given its name.\n\n Args:\n dof_name (str): name of the joint that corresponds to the degree of freedom to query.\n\n Returns:\n int: index of the degree of freedom in the joint buffers.\n ", "snippet": "dof_index = robot_view.get_dof_index(dof_name=dof_name) # str\n" }, { "title": "get_dof_limits", "description": " Returns:\n Union[np.ndarray, torch.Tensor]: degrees of freedom position limits. \n shape is (N, num_dof, 2) where index 0 corresponds to the lower limit and index 1 corresponds to the upper limit. \n ", "snippet": "dof_limits = robot_view.get_dof_limits()\n" }, { "title": "get_dof_types", "description": "Gets the dof types given the dof names.\n\n Args:\n dof_names (List[str], optional): names of the joints that corresponds to the degrees of freedom to query. Defaults to None.\n\n Returns:\n List[str]: types of the joints that corresponds to the degrees of freedom. Types can be invalid, translation or rotation.\n ", "snippet": "dof_types = robot_view.get_dof_types(dof_names=None) # typing.List[str]\n" }, { "title": "get_effort_modes", "description": " Gets effort modes for articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to query. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n\n Returns:\n List: Returns a List of size (M, K) indicating the effort modes. accelaration or force.\n ", "snippet": "effort_modes = robot_view.get_effort_modes(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "get_enabled_self_collisions", "description": " Gets the enable self collisions flag\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: true if self collisions enabled. otherwise false. shape (M,)\n ", "snippet": "enabled_self_collisions = robot_view.get_enabled_self_collisions(indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "get_fixed_tendon_dampings", "description": "Gets the dampings of fixed tendons for articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: fixed tendon dampings of articulations in the view. \n shape is (M, K).\n ", "snippet": "fixed_tendon_dampings = robot_view.get_fixed_tendon_dampings(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_fixed_tendon_limit_stiffnesses", "description": "Gets the limit stiffness of fixed tendons for articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: fixed tendon stiffnesses of articulations in the view. \n shape is (M, K).\n ", "snippet": "fixed_tendon_limit_stiffnesses = robot_view.get_fixed_tendon_limit_stiffnesses(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_fixed_tendon_limits", "description": "Gets the limits of fixed tendons for articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: fixed tendon stiffnesses of articulations in the view. \n shape is (M, K, 2).\n ", "snippet": "fixed_tendon_limits = robot_view.get_fixed_tendon_limits(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_fixed_tendon_offsets", "description": "Gets the offsets of fixed tendons for articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: fixed tendon stiffnesses of articulations in the view. \n shape is (M, K).\n ", "snippet": "fixed_tendon_offsets = robot_view.get_fixed_tendon_offsets(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_fixed_tendon_rest_lengths", "description": "Gets the rest length of fixed tendons for articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: fixed tendon stiffnesses of articulations in the view. \n shape is (M, K).\n ", "snippet": "fixed_tendon_rest_lengths = robot_view.get_fixed_tendon_rest_lengths(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_fixed_tendon_stiffnesses", "description": "Gets the stiffness of fixed tendons for articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: fixed tendon stiffnesses of articulations in the view. \n shape is (M, K).\n ", "snippet": "fixed_tendon_stiffnesses = robot_view.get_fixed_tendon_stiffnesses(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_friction_coefficients", "description": "Gets friction coefficients for articulation in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to query. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n clone (Optional[bool]): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: maximum efforts for articulations in the view. shape (M, K).\n ", "snippet": "friction_coefficients = robot_view.get_friction_coefficients(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_gains", "description": " Gets stiffness and damping of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to query. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n clone (bool, optional): True to return clones of the internal buffers. Otherwise False. Defaults to True.\n\n Returns:\n Tuple[Union[np.ndarray, torch.Tensor], Union[np.ndarray, torch.Tensor]]: stiffness and damping of\n articulations in the view respectively. shapes are (M, K).\n ", "snippet": "gains = robot_view.get_gains(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_generalized_gravity_forces", "description": "Gets the generalized gravity forces of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to query. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: generalized gravity forces of articulations in the view. \n shape is (M, K).\n ", "snippet": "generalized_gravity_forces = robot_view.get_generalized_gravity_forces(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_jacobian_shape", "description": " Returns:\n Union[np.ndarray, torch.Tensor]: shape of jacobian for a single articulation. \n ", "snippet": "jacobian_shape = robot_view.get_jacobian_shape()\n" }, { "title": "get_jacobians", "description": "Gets the jacobians of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: jacobians of articulations in the view. \n shape is (M, jacobian_shape).\n ", "snippet": "jacobians = robot_view.get_jacobians(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_joint_positions", "description": "Gets the joint positions of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to query. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: joint positions of articulations in the view. \n shape is (M, K).\n ", "snippet": "joint_positions = robot_view.get_joint_positions(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_joint_velocities", "description": "Gets the joint velocities of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to query. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: joint velocities of articulations in the view. \n shape is (M, K).\n ", "snippet": "joint_velocities = robot_view.get_joint_velocities(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_joints_default_state", "description": " Returns:\n JointsState: current joints default state. (i.e: the joint positions and velocities after a reset).\n ", "snippet": "joints_default_state = robot_view.get_joints_default_state()\n" }, { "title": "get_joints_state", "description": " Returns:\n JointsState: current joint positions and velocities.\n ", "snippet": "joints_state = robot_view.get_joints_state()\n" }, { "title": "get_linear_velocities", "description": "Gets the linear velocities of prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: linear velocities of the prims in the view. shape is (M, 3).\n ", "snippet": "linear_velocities = robot_view.get_linear_velocities(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True)\n" }, { "title": "get_local_poses", "description": "Gets prim poses in the view with respect to the local frame (the prim's parent frame).\n \n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: \n first index is positions in the local frame of the prims. shape is (M, 3). \n second index is quaternion orientations in the local frame of the prims.\n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n ", "snippet": "local_poses = robot_view.get_local_poses(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_mass_matrices", "description": "Gets the mass matrices of articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: mass matrices of articulations in the view. \n shape is (M, mass_matrix_shape).\n ", "snippet": "mass_matrices = robot_view.get_mass_matrices(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_mass_matrix_shape", "description": " Returns:\n Union[np.ndarray, torch.Tensor]: shape of mass matrix for a single articulation. \n ", "snippet": "mass_matrix_shape = robot_view.get_mass_matrix_shape()\n" }, { "title": "get_max_efforts", "description": "Gets maximum efforts for articulation in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to query. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n clone (Optional[bool]): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: maximum efforts for articulations in the view. shape (M, K).\n ", "snippet": "max_efforts = robot_view.get_max_efforts(indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_sleep_thresholds", "description": "Gets sleep thresholds for articulations in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: current sleep thresholds. shape (M,).\n ", "snippet": "sleep_thresholds = robot_view.get_sleep_thresholds(indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "get_solver_position_iteration_counts", "description": "Gets the physics solver itertion counts for joint positions.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: number of iterations for the solver. Shape (M,).\n ", "snippet": "solver_position_iteration_counts = robot_view.get_solver_position_iteration_counts(indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "get_solver_velocity_iteration_counts", "description": " Gets the physics solver itertion counts for joint velocities.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: number of iterations for the solver. Shape (M,).\n ", "snippet": "solver_velocity_iteration_counts = robot_view.get_solver_velocity_iteration_counts(indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "get_stabilization_thresholds", "description": "Gets the stabilizaion thresholds.\n\n Args:\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: current stabilization thresholds. Shape (M,).\n ", "snippet": "stabilization_thresholds = robot_view.get_stabilization_thresholds(indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "get_velocities", "description": "Gets the linear and angular velocities of prims in the view.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view)\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[np.ndarray, torch.Tensor]: linear and angular velocities of the prims in the view concatenated. shape is (M, 6).\n ", "snippet": "velocities = robot_view.get_velocities(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "get_world_poses", "description": "Gets the poses of the prims in the view with respect to the world's frame.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n clone (bool, optional): True to return a clone of the internal buffer. Otherwise False. Defaults to True.\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: \n first index is positions in the world frame of the prims. shape is (M, 3). \n second index is quaternion orientations in the world frame of the prims.\n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n ", "snippet": "world_poses = robot_view.get_world_poses(indices=None, # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n clone=True) # bool\n" }, { "title": "initialize", "description": "Create a physics simulation view if not passed and creates an articulation view using physX tensor api.\n\n Args:\n physics_sim_view (omni.physics.tensors.SimulationView, optional): current physics simulation view. Defaults to None.\n ", "snippet": "robot_view.initialize(physics_sim_view=None) # omni.physics.tensors.bindings._physicsTensors.SimulationView\n" }, { "title": "is_physics_handle_valid", "description": " Returns:\n bool: False if .initialize() needs to be called again for the physics handle to be valid. Otherwise True.\n Note: if physics handle is not valid many of the methods that requires physX will return None.\n ", "snippet": "robot_view.is_physics_handle_valid()\n" }, { "title": "post_reset", "description": "Resets the prims to its default state.\n ", "snippet": "robot_view.post_reset()\n" }, { "title": "set_angular_velocities", "description": "Sets the angular velocities of the prims in the view. The method does this through the physx API only.\n i.e: It has to be called after initialization.\n Note: This method is not supported for the gpu pipeline. set_velocities method should be used instead.\n\n Args:\n velocities (Optional[Union[np.ndarray, torch.Tensor]]): angular velocities to set the rigid prims to. shape is (M, 3).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "robot_view.set_angular_velocities(velocities=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_armatures", "description": "Sets armatures for articulation joints in the view.\n\n Args:\n values (Union[np.ndarray, torch.Tensor]): armatures for articulations in the view. shape (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n ", "snippet": "robot_view.set_armatures(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_body_coms", "description": "Sets body center of mass positions and orientations for articulation bodies in the view.\n\n Args:\n positions (Union[np.ndarray, torch.Tensor]): body center of mass positions for articulations in the view. shape (M, K, 3).\n orientations (Union[np.ndarray, torch.Tensor]): body center of mass orientations for articulations in the view. shape (M, K, 4).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n body_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): body indicies to specify which bodies \n to manipulate. Shape (K,).\n Where K <= num of bodies.\n Defaults to None (i.e: all bodies).\n ", "snippet": "robot_view.set_body_coms(positions=None, # typing.Union[numpy.ndarray, torch.Tensor]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n body_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_body_inertias", "description": "Sets body inertias for articulation bodies in the view.\n\n Args:\n values (Union[np.ndarray, torch.Tensor]): body inertias for articulations in the view. shape (M, K, 9).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n body_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): body indicies to specify which bodies \n to manipulate. Shape (K,).\n Where K <= num of bodies.\n Defaults to None (i.e: all bodies).\n ", "snippet": "robot_view.set_body_inertias(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n body_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_body_masses", "description": "Sets body masses for articulation bodies in the view.\n\n Args:\n values (Union[np.ndarray, torch.Tensor]): body masses for articulations in the view. shape (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n body_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): body indicies to specify which bodies \n to manipulate. Shape (K,).\n Where K <= num of bodies.\n Defaults to None (i.e: all bodies).\n ", "snippet": "robot_view.set_body_masses(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n body_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_effort_modes", "description": " Sets effort modes for articulations in the view.\n\n Args:\n mode (str): effort mode to be applied to prims in the view. force or acceleration.\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n\n Raises:\n Exception: _description_\n ", "snippet": "robot_view.set_effort_modes(mode=mode, # str\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_enabled_self_collisions", "description": " Sets the enable self collisions flag\n\n Args:\n flags (Union[np.ndarray, torch.Tensor]): true to enable self collision. otherwise false. shape (M,)\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "robot_view.set_enabled_self_collisions(flags=flags, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_fixed_tendon_properties", "description": "Sets fixed tendon properties for articulations in the view.\n\n Args:\n stiffnesses (Union[np.ndarray, torch.Tensor]): fixed tendon stiffnesses for articulations in the view. shape (M, K).\n dampings (Union[np.ndarray, torch.Tensor]): fixed tendon dampings for articulations in the view. shape (M, K).\n limit_stiffnesses (Union[np.ndarray, torch.Tensor]): fixed tendon limit stiffnesses for articulations in the view. shape (M, K).\n limits (Union[np.ndarray, torch.Tensor]): fixed tendon limits for articulations in the view. shape (M, K, 2).\n rest_lengths (Union[np.ndarray, torch.Tensor]): fixed tendon rest lengths for articulations in the view. shape (M, K).\n offsets (Union[np.ndarray, torch.Tensor]): fixed tendon offsets for articulations in the view. shape (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "robot_view.set_fixed_tendon_properties(stiffnesses=None, # typing.Union[numpy.ndarray, torch.Tensor]\n dampings=None, # typing.Union[numpy.ndarray, torch.Tensor]\n limit_stiffnesses=None, # typing.Union[numpy.ndarray, torch.Tensor]\n limits=None, # typing.Union[numpy.ndarray, torch.Tensor]\n rest_lengths=None, # typing.Union[numpy.ndarray, torch.Tensor]\n offsets=None, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_friction_coefficients", "description": "Sets friction coefficients for articulation joints in the view.\n\n Args:\n values (Union[np.ndarray, torch.Tensor]): friction coefficients for articulations in the view. shape (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n ", "snippet": "robot_view.set_friction_coefficients(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_gains", "description": " Sets stiffness and damping of articulations in the view.\n\n Args:\n kps (Optional[Union[np.ndarray, torch.Tensor]], optional): stiffness of the drives. shape is (M, K). Defaults to None.\n kds (Optional[Union[np.ndarray, torch.Tensor]], optional): damping of the drives. shape is (M, K).. Defaults to None.\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n save_to_usd (bool, optional): True to save the gains in the usd. otherwise False.\n ", "snippet": "robot_view.set_gains(kps=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n kds=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n save_to_usd=False) # bool\n" }, { "title": "set_joint_efforts", "description": "Sets the joint efforts of articulations in the view.\n\n Args:\n efforts (Optional[Union[np.ndarray, torch.Tensor]]): efforts of articulations in the view to be set to in the next frame. \n shape is (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n ", "snippet": "robot_view.set_joint_efforts(efforts=efforts, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_joint_position_targets", "description": " Sets the joint position targets for the implicit pd controllers.\n\n Args:\n positions (Optional[Union[np.ndarray, torch.Tensor]]): joint position targets for the implicit pd controller. \n shape is (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n ", "snippet": "robot_view.set_joint_position_targets(positions=positions, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_joint_positions", "description": "Sets the joint positions of articulations in the view.\n\n Args:\n positions (Optional[Union[np.ndarray, torch.Tensor]]): joint positions of articulations in the view to be set to in the next frame. \n shape is (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n ", "snippet": "robot_view.set_joint_positions(positions=positions, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_joint_velocities", "description": "Sets the joint velocities of articulations in the view.\n\n Args:\n velocities (Optional[Union[np.ndarray, torch.Tensor]]): joint velocities of articulations in the view to be set to in the next frame. \n shape is (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n ", "snippet": "robot_view.set_joint_velocities(velocities=velocities, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_joint_velocity_targets", "description": " Sets the joint velocity targets for the implicit pd controllers.\n\n Args:\n velocities (Optional[Union[np.ndarray, torch.Tensor]]): joint velocity targets for the implicit pd controller. \n shape is (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n ", "snippet": "robot_view.set_joint_velocity_targets(velocities=velocities, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_joints_default_state", "description": "Sets the joints default state (joint positions, velocities and efforts) to be applied after each reset.\n\n Args:\n positions (Optional[Union[np.ndarray, torch.Tensor]], optional): default joint positions.\n shape is (N, num of dofs). Defaults to None.\n velocities (Optional[Union[np.ndarray, torch.Tensor]], optional): default joint velocities.\n shape is (N, num of dofs). Defaults to None.\n efforts (Optional[Union[np.ndarray, torch.Tensor]], optional): default joint efforts.\n shape is (N, num of dofs). Defaults to None.\n ", "snippet": "robot_view.set_joints_default_state(positions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n velocities=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n efforts=None) # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n" }, { "title": "set_linear_velocities", "description": "Sets the linear velocities of the prims in the view. The method does this through the physx API only.\n i.e: It has to be called after initialization.\n Note: This method is not supported for the gpu pipeline. set_velocities method should be used instead.\n\n Args:\n velocities (Optional[Union[np.ndarray, torch.Tensor]]): linear velocities to set the rigid prims to. shape is (M, 3).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "robot_view.set_linear_velocities(velocities=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_local_poses", "description": "Sets prim poses in the view with respect to the local frame (the prim's parent frame).\n\n Args:\n translations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n translations in the local frame of the prims\n (with respect to its parent prim). shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n quaternion orientations in the local frame of the prims. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "robot_view.set_local_poses(translations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_max_efforts", "description": "Sets maximum efforts for articulation in the view.\n\n Args:\n values (Union[np.ndarray, torch.Tensor]): maximum efforts for articulations in the view. shape (M, K).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n ", "snippet": "robot_view.set_max_efforts(values=values, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_sleep_thresholds", "description": " Sets sleep thresholds for articulations in the view.\n\n Args:\n thresholds (Union[np.ndarray, torch.Tensor]): sleep thresholds to be applied. shape (M,).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "robot_view.set_sleep_thresholds(thresholds=thresholds, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_solver_position_iteration_counts", "description": " Sets the physics solver itertion counts for joint positions.\n\n Args:\n counts (Union[np.ndarray, torch.Tensor]): number of iterations for the solver. Shape (M,).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "robot_view.set_solver_position_iteration_counts(counts=counts, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_solver_velocity_iteration_counts", "description": " Sets the physics solver itertion counts for joint velocities.\n\n Args:\n counts (Union[np.ndarray, torch.Tensor]): number of iterations for the solver. Shape (M,).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "robot_view.set_solver_velocity_iteration_counts(counts=counts, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_stabilization_thresholds", "description": "Sets the stabilizaion thresholds.\n\n Args:\n thresholds (Union[np.ndarray, torch.Tensor]): stabilization thresholds to be applied. Shape (M,).\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "robot_view.set_stabilization_thresholds(thresholds=thresholds, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "set_velocities", "description": "Sets the linear and angular velocities of the prims in the view at once. The method does this through the physx API only.\n i.e: It has to be called after initialization.\n\n Args:\n velocities (Optional[Union[np.ndarray, torch.Tensor]]): linear and angular velocities respectively to set the rigid prims to. shape is (M, 6).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "robot_view.set_velocities(velocities=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_world_poses", "description": "Sets poses of prims in the view with respect to the world's frame.\n\n Args:\n positions (Optional[Union[np.ndarray, torch.Tensor]], optional): positions in the world frame of the prim. shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): quaternion orientations in the world frame of the prims. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "robot_view.set_world_poses(positions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "switch_control_mode", "description": " Switches control mode between velocity, position or effort.\n\n Args:\n mode (str): control mode to switch the articulations specified to. mode can be velocity, position or effort.\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n joint_indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): joint indicies to specify which joints \n to manipulate. Shape (K,).\n Where K <= num of dofs.\n Defaults to None (i.e: all dofs).\n ", "snippet": "robot_view.switch_control_mode(mode=mode, # str\n indices=None, # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n joint_indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "switch_dof_control_mode", "description": "Switches dof control mode between velocity, position or effort.\n\n Args:\n mode (str): control mode to switch the dof in articulations specified to. mode an be velocity, position or effort.\n dof_index (int): dof index to swith the control mode of.\n indices (Optional[Union[np.ndarray, List, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "robot_view.switch_dof_control_mode(mode=mode, # str\n dof_index=dof_index, # int\n indices=None) # typing.Union[numpy.ndarray, typing.List, torch.Tensor, NoneType]\n" }, { "title": "apply_visual_materials", "description": "Used to apply visual material to the prims and optionally its prim descendants.\n\n Args:\n visual_materials (Union[VisualMaterial, List[VisualMaterial]]): visual materials to be applied to the prims. Currently supports\n PreviewSurface, OmniPBR and OmniGlass. If a list is provided then\n its size has to be equal the view's size or indices size. \n If one material is provided it will be applied to all prims in the view.\n weaker_than_descendants (Optional[Union[bool, List[bool]]], optional): True if the material shouldn't override the descendants \n materials, otherwise False. Defaults to False. \n If a list of visual materials is provided then a list\n has to be provided with the same size for this arg as well.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Raises:\n Exception: length of visual materials != length of prims indexed\n Exception: length of visual materials != length of weaker descendants bools arg\n ", "snippet": "robot_view.apply_visual_materials(visual_materials=visual_materials, # typing.Union[omni.isaac.core.materials.visual_material.VisualMaterial, typing.List[omni.isaac.core.materials.visual_material.VisualMaterial]]\n weaker_than_descendants=None, # typing.Union[bool, typing.List[bool], NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_applied_visual_materials", "description": "\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n List[VisualMaterial]: a list of the current applied visual materials to the prims if its type is currently supported.\n ", "snippet": "applied_visual_materials = robot_view.get_applied_visual_materials(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_default_state", "description": " Returns:\n XFormPrimViewState: returns the default state of the prims (positions and orientations) that is used after each reset.\n ", "snippet": "default_state = robot_view.get_default_state()\n" }, { "title": "get_local_poses", "description": "Gets prim poses in the view with respect to the local's frame (the prim's parent frame).\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: \n first index is translations in the local frame of the prims. shape is (M, 3). \n second index is quaternion orientations in the local frame of the prims.\n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n ", "snippet": "local_poses = robot_view.get_local_poses(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_local_scales", "description": "Gets prim scales in the view with respect to the local frame (the parent's frame).\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: scales applied to the prim's dimensions in the local frame. shape is (M, 3).\n ", "snippet": "local_scales = robot_view.get_local_scales(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_visibilities", "description": "Returns the current visibilities of the prims in stage.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: Shape (M,) with type bool, where each item holds True \n if the prim is visible in stage. False otherwise.\n ", "snippet": "visibilities = robot_view.get_visibilities(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_world_poses", "description": " Returns the poses (positions and orientations) of the prims in the view with respect to the world frame.\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[Tuple[np.ndarray, np.ndarray], Tuple[torch.Tensor, torch.Tensor]]: first index is positions in the world frame of the prims. shape is (M, 3). \n second index is quaternion orientations in the world frame of the prims.\n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n ", "snippet": "world_poses = robot_view.get_world_poses(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "get_world_scales", "description": "Gets prim scales in the view with respect to the world's frame.\n\n\n Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n Union[np.ndarray, torch.Tensor]: scales applied to the prim's dimensions in the world frame. shape is (M, 3).\n ", "snippet": "world_scales = robot_view.get_world_scales(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "initialize", "description": "", "snippet": "robot_view.initialize(physics_sim_view=None) # omni.physics.tensors.bindings._physicsTensors.SimulationView\n" }, { "title": "is_valid", "description": " Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n bool: True if all prim paths specified in the view correspond to a valid prim in stage. False otherwise.\n ", "snippet": "robot_view.is_valid(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "is_visual_material_applied", "description": " Args:\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n\n Returns:\n List[bool]: True if there is a visual material applied is applied to the corresponding prim in the view. False otherwise.\n ", "snippet": "robot_view.is_visual_material_applied(indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "post_reset", "description": "Resets the prims to its default state (positions and orientations).\n ", "snippet": "robot_view.post_reset()\n" }, { "title": "set_default_state", "description": "Sets the default state of the prims (positions and orientations), that will be used after each reset.\n\n Args:\n positions (Optional[np.ndarray], optional): positions in the world frame of the prim. shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[np.ndarray], optional): quaternion orientations in the world frame of the prim. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "robot_view.set_default_state(positions=None, # typing.Union[numpy.ndarray, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_local_poses", "description": "Sets prim poses in the view with respect to the local frame (the prim's parent frame).\n\n Args:\n translations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n translations in the local frame of the prims\n (with respect to its parent prim). shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): \n quaternion orientations in the local frame of the prims. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "robot_view.set_local_poses(translations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_local_scales", "description": "Sets prim scales in the view with respect to the local frame (the prim's parent frame).\n\n Args:\n scales (Optional[Union[np.ndarray, torch.Tensor]]): scales to be applied to the prim's dimensions in the view. \n shape is (M, 3).\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "robot_view.set_local_scales(scales=scales, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_visibilities", "description": "Sets the visibilities of the prims in stage.\n\n Args:\n visibilities (Union[np.ndarray, torch.Tensor]): flag to set the visibilities of the usd prims in stage. \n Shape (M,). Where M <= size of the encapsulated prims in the view.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to manipulate. Shape (M,).\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "robot_view.set_visibilities(visibilities=visibilities, # typing.Union[numpy.ndarray, torch.Tensor]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" }, { "title": "set_world_poses", "description": "Sets prim poses in the view with respect to the world's frame.\n\n Args:\n positions (Optional[Union[np.ndarray, torch.Tensor]], optional): positions in the world frame of the prims. shape is (M, 3).\n Defaults to None, which means left unchanged.\n orientations (Optional[Union[np.ndarray, torch.Tensor]], optional): quaternion orientations in the world frame of the prims. \n quaternion is scalar-first (w, x, y, z). shape is (M, 4).\n Defaults to None, which means left unchanged.\n indices (Optional[Union[np.ndarray, list, torch.Tensor]], optional): indicies to specify which prims \n to query. Shape (M,).\n Where M <= size of the encapsulated prims in the view.\n Defaults to None (i.e: all prims in the view).\n ", "snippet": "robot_view.set_world_poses(positions=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n orientations=None, # typing.Union[numpy.ndarray, torch.Tensor, NoneType]\n indices=None) # typing.Union[numpy.ndarray, list, torch.Tensor, NoneType]\n" } ] } ] }, { "title": "Scenes", "snippets": [ { "title": "Scene", "snippets": [ { "title": "Scene", "description": "This class provides functions to add objects of interest in the stage to retrieve their information and set their \n reset default state in an easy way. For example: \n - performing certain commands post_reset\n - getting bounding boxes of the objects \n - Deleting the objects/ removing them from stage..etc.\n\n Checkout the required tutorials at \n https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/overview.html", "snippet": "scene = Scene()\n" }, { "title": "add", "description": "[summary]\n\n Args:\n obj (XFormPrim): [description]\n\n Raises:\n Exception: [description]\n Exception: [description]\n\n Returns:\n XFormPrim: [description]\n ", "snippet": "scene.add(obj=obj) # omni.isaac.core.prims.xform_prim.XFormPrim\n" }, { "title": "add_default_ground_plane", "description": "[summary]\n\n Args:\n z_position (float, optional): [description]. Defaults to 0.\n name (str, optional): [description]. Defaults to \"default_ground_plane\".\n prim_path (str, optional): [description]. Defaults to \"/World/defaultGroundPlane\".\n static_friction (float, optional): [description]. Defaults to 0.5.\n dynamic_friction (float, optional): [description]. Defaults to 0.5.\n restitution (float, optional): [description]. Defaults to 0.8.\n\n Returns:\n [type]: [description]\n ", "snippet": "scene.add_default_ground_plane(z_position=0, # float\n name=\"default_ground_plane\",\n prim_path=\"/World/defaultGroundPlane\", # str\n static_friction=0.5, # float\n dynamic_friction=0.5, # float\n restitution=0.8) # float\n" }, { "title": "add_ground_plane", "description": "[summary]\n\n Args:\n size (Optional[float], optional): [description]. Defaults to None.\n z_position (float, optional): [description]. Defaults to 0.\n name (str, optional): [description]. Defaults to \"ground_plane\".\n prim_path (str, optional): [description]. Defaults to \"/World/groundPlane\".\n static_friction (float, optional): [description]. Defaults to 0.5.\n dynamic_friction (float, optional): [description]. Defaults to 0.5.\n restitution (float, optional): [description]. Defaults to 0.8.\n color (Optional[np.ndarray], optional): [description]. Defaults to None.\n\n Returns:\n [type]: [description]\n ", "snippet": "scene.add_ground_plane(size=None, # typing.Union[float, NoneType]\n z_position=0, # float\n name=\"ground_plane\",\n prim_path=\"/World/groundPlane\", # str\n static_friction=0.5, # float\n dynamic_friction=0.5, # float\n restitution=0.8, # float\n color=None) # typing.Union[numpy.ndarray, NoneType]\n" }, { "title": "clear", "description": "Clears the stage from all added objects to the Scene.\n\n Args:\n registry_only (bool, optional): True to remove the object from the scene registery only and not the USD. Defaults to False.\n ", "snippet": "scene.clear(registry_only=False) # bool\n" }, { "title": "compute_object_AABB", "description": "[summary]\n\n Args:\n name (str): [description]\n\n Raises:\n Exception: [description]\n\n Returns:\n Tuple[np.ndarray, np.ndarray]: [description]\n ", "snippet": "scene.compute_object_AABB(name=name) # str\n" }, { "title": "disable_bounding_boxes_computations", "description": "[summary]\n ", "snippet": "scene.disable_bounding_boxes_computations()\n" }, { "title": "enable_bounding_boxes_computations", "description": "[summary]\n ", "snippet": "scene.enable_bounding_boxes_computations()\n" }, { "title": "get_object", "description": "[summary]\n\n Args:\n name (Optional[str], optional): [description]. Defaults to None.\n prim_path (Optional[str], optional): [description]. Defaults to None.\n\n Returns:\n XFormPrim: [description]\n ", "snippet": "object = scene.get_object(name=name) # str\n" }, { "title": "object_exists", "description": "[summary]\n\n Args:\n name (str): [description]\n\n Returns:\n XFormPrim: [description]\n ", "snippet": "scene.object_exists(name=name) # str\n" }, { "title": "post_reset", "description": "calls post_reset on all added objects to the Scene Registery.\n ", "snippet": "scene.post_reset()\n" }, { "title": "remove_object", "description": "[summary]\n\n Args:\n name (str): Name of the prim to be removed. Defaults to None.\n registry_only (bool, optional): True to remove the object from the scene registery only and not the USD. Defaults to False.\n ", "snippet": "scene.remove_object(name=name, # str\n registry_only=False) # bool\n" } ] }, { "title": "SceneRegistry", "snippets": [ { "title": "SceneRegistry", "description": "", "snippet": "scene_registry = SceneRegistry()\n" }, { "title": "add_articulated_system", "description": "[summary]\n\n Args:\n name ([type]): [description]\n articulated_system (Articulation): [description]\n ", "snippet": "scene_registry.add_articulated_system(name=name,\n articulated_system=articulated_system) # omni.isaac.core.articulations.articulation.Articulation\n" }, { "title": "add_articulated_view", "description": "[summary]\n\n Args:\n name ([type]): [description]\n articulated_view (ArticulationView): [description]\n ", "snippet": "scene_registry.add_articulated_view(name=name,\n articulated_view=articulated_view) # omni.isaac.core.articulations.articulation_view.ArticulationView\n" }, { "title": "add_cloth", "description": "[summary]\n\n Args:\n name ([type]): [description]\n cloth (ClothPrim): [description]\n ", "snippet": "scene_registry.add_cloth(name=name,\n cloth=cloth) # omni.isaac.core.prims.soft.cloth_prim.ClothPrim\n" }, { "title": "add_cloth_view", "description": "[summary]\n\n Args:\n name ([type]): [description]\n geometry_object (ClothPrimView): [description]\n ", "snippet": "scene_registry.add_cloth_view(name=name,\n cloth_prim_view=cloth_prim_view) # omni.isaac.core.prims.soft.cloth_prim_view.ClothPrimView\n" }, { "title": "add_geometry_object", "description": "[summary]\n\n Args:\n name ([type]): [description]\n geometry_object (GeometryPrim): [description]\n ", "snippet": "scene_registry.add_geometry_object(name=name,\n geometry_object=geometry_object) # omni.isaac.core.prims.geometry_prim.GeometryPrim\n" }, { "title": "add_geometry_prim_view", "description": "[summary]\n\n Args:\n name ([type]): [description]\n geometry_object (GeometryPrim): [description]\n ", "snippet": "scene_registry.add_geometry_prim_view(name=name,\n geometry_prim_view=geometry_prim_view) # omni.isaac.core.prims.geometry_prim_view.GeometryPrimView\n" }, { "title": "add_particle_material", "description": "[summary]\n\n Args:\n name ([type]): [description]\n geometry_object (ParticleMaterial): [description]\n ", "snippet": "scene_registry.add_particle_material(name=name,\n particle_material=particle_material) # omni.isaac.core.materials.particle_material.ParticleMaterial\n" }, { "title": "add_particle_material_view", "description": "[summary]\n\n Args:\n name ([type]): [description]\n geometry_object (ParticleMaterialView): [description]\n ", "snippet": "scene_registry.add_particle_material_view(name=name,\n particle_material_view=particle_material_view) # omni.isaac.core.materials.particle_material_view.ParticleMaterialView\n" }, { "title": "add_particle_system", "description": "[summary]\n\n Args:\n name ([type]): [description]\n geometry_object (ParticleSystemView): [description]\n ", "snippet": "scene_registry.add_particle_system(name=name,\n particle_system=particle_system) # omni.isaac.core.prims.soft.particle_system.ParticleSystem\n" }, { "title": "add_particle_system_view", "description": "[summary]\n\n Args:\n name ([type]): [description]\n geometry_object (ParticleSystemView): [description]\n ", "snippet": "scene_registry.add_particle_system_view(name=name,\n particle_system_view=particle_system_view) # omni.isaac.core.prims.soft.particle_system_view.ParticleSystemView\n" }, { "title": "add_rigid_contact_view", "description": "[summary]\n\n Args:\n name ([type]): [description]\n rigid_contact_views (RigidContactView): [description]\n ", "snippet": "scene_registry.add_rigid_contact_view(name=name,\n rigid_contact_view=rigid_contact_view) # omni.isaac.core.prims.rigid_contact_view.RigidContactView\n" }, { "title": "add_rigid_object", "description": "[summary]\n\n Args:\n name ([type]): [description]\n rigid_object (RigidPrim): [description]\n ", "snippet": "scene_registry.add_rigid_object(name=name,\n rigid_object=rigid_object) # omni.isaac.core.prims.rigid_prim.RigidPrim\n" }, { "title": "add_rigid_prim_view", "description": "[summary]\n\n Args:\n name ([type]): [description]\n rigid_object (RigidPrim): [description]\n ", "snippet": "scene_registry.add_rigid_prim_view(name=name,\n rigid_prim_view=rigid_prim_view) # omni.isaac.core.prims.rigid_prim_view.RigidPrimView\n" }, { "title": "add_robot", "description": "[summary]\n\n Args:\n name ([type]): [description]\n robot (Robot): [description]\n ", "snippet": "scene_registry.add_robot(name=name,\n robot=robot) # omni.isaac.core.robots.robot.Robot\n" }, { "title": "add_robot_view", "description": "[summary]\n\n Args:\n name ([type]): [description]\n geometry_object (GeometryPrim): [description]\n ", "snippet": "scene_registry.add_robot_view(name=name,\n robot_view=robot_view) # omni.isaac.core.robots.robot_view.RobotView\n" }, { "title": "add_sensor", "description": "[summary]\n\n Args:\n name ([type]): [description]\n sensor (BaseSensor): [description]\n ", "snippet": "scene_registry.add_sensor(name=name,\n sensor=sensor) # omni.isaac.core.prims.base_sensor.BaseSensor\n" }, { "title": "add_xform", "description": "[summary]\n\n Args:\n name ([type]): [description]\n robot (Robot): [description]\n ", "snippet": "scene_registry.add_xform(name=name,\n xform=xform) # omni.isaac.core.prims.xform_prim.XFormPrim\n" }, { "title": "add_xform_view", "description": "[summary]\n\n Args:\n name ([type]): [description]\n geometry_object (GeometryPrim): [description]\n ", "snippet": "scene_registry.add_xform_view(name=name,\n xform_prim_view=xform_prim_view) # omni.isaac.core.prims.xform_prim_view.XFormPrimView\n" }, { "title": "get_object", "description": "[summary]\n\n Args:\n name (Optional[str], optional): [description]. Defaults to None.\n prim_path (Optional[str], optional): [description]. Defaults to None.\n\n Raises:\n Exception: [description]\n\n Returns:\n XFormPrim: [description]\n ", "snippet": "object = scene_registry.get_object(name=name) # str\n" }, { "title": "name_exists", "description": "[summary]\n\n Args:\n name (str): [description]\n\n Returns:\n bool: [description]\n ", "snippet": "scene_registry.name_exists(name=name) # str\n" }, { "title": "remove_object", "description": "[summary]\n\n Args:\n name (Optional[str], optional): [description]. Defaults to None.\n prim_path (Optional[str], optional): [description]. Defaults to None.\n\n Raises:\n Exception: [description]\n Exception: [description]\n NotImplementedError: [description]\n Exception: [description]\n ", "snippet": "scene_registry.remove_object(name=name) # str\n" } ] } ] }, { "title": "SimulationContext", "snippets": [ { "title": "SimulationContext", "description": " This class provide functions that take care of many time-related events such as\n perform a physics or a render step for instance. Adding/ removing callback functions that \n gets triggered with certain events such as a physics step, timeline event \n (pause or play..etc), stage open/ close..etc.\n\n It also includes an instance of PhysicsContext which takes care of many physics related\n settings such as setting physics dt, solver type..etc.\n\n Args:\n physics_dt (Optional[float], optional): dt between physics steps. Defaults to None.\n rendering_dt (Optional[float], optional): dt between rendering steps. Note: rendering means \n rendering a frame of the current application and not \n only rendering a frame to the viewports/ cameras. So UI\n elements of Isaac Sim will be refereshed with this dt \n as well if running non-headless. \n Defaults to None.\n stage_units_in_meters (Optional[float], optional): The metric units of assets. This will affect gravity value..etc.\n Defaults to None.\n physics_prim_path (Optional[str], optional): specifies the prim path to create a PhysicsScene at, \n only in the case where no PhysicsScene already defined. \n Defaults to \"/physicsScene\".\n set_defaults (bool, optional): set to True to use the defaults settings\n [physics_dt = 1.0/ 60.0,\n stage units in meters = 0.01 (i.e in cms),\n rendering_dt = 1.0 / 60.0,\n gravity = -9.81 m / s\n ccd_enabled,\n stabilization_enabled,\n gpu dynamics turned off,\n broadcast type is MBP,\n solver type is TGS]. Defaults to True.\n backend (str, optional): specifies the backend to be used (numpy or torch). Defaults to numpy.\n device (Optional[str], optional): specifies the device to be used if running on the gpu with torch backend.\n\n ", "snippet": "simulation_context = SimulationContext(physics_dt=None, # typing.Union[float, NoneType]\n rendering_dt=None, # typing.Union[float, NoneType]\n stage_units_in_meters=None, # typing.Union[float, NoneType]\n physics_prim_path=\"/physicsScene\", # str\n sim_params=None, # dict\n set_defaults=True, # bool\n backend=\"numpy\", # str\n device=None) # typing.Union[str, NoneType]\n" }, { "title": "add_physics_callback", "description": "Adds a callback which will be called before each physics step.\n callback_fn should take an argument of step_size: float\n\n Args:\n callback_name (str): should be unique.\n callback_fn (Callable[[float], None]): [description]\n ", "snippet": "simulation_context.add_physics_callback(callback_name=callback_name, # str\n callback_fn=callback_fn) # typing.Callable[[float], NoneType]\n" }, { "title": "add_render_callback", "description": "Adds a callback which will be called after each rendering event such as .render().\n callback_fn should take an argument of event\n\n Args:\n callback_name (str): [description]\n callback_fn (Callable): [description]\n ", "snippet": "simulation_context.add_render_callback(callback_name=callback_name, # str\n callback_fn=callback_fn) # typing.Callable\n" }, { "title": "add_stage_callback", "description": "Adds a callback which will be called after each stage event such as open/close.\n callback_fn should take an argument of event\n\n Args:\n callback_name (str): [description]\n callback_fn (Callable[[omni.usd.StageEvent], None]): [description]\n ", "snippet": "simulation_context.add_stage_callback(callback_name=callback_name, # str\n callback_fn=callback_fn) # typing.Callable\n" }, { "title": "add_timeline_callback", "description": "Adds a callback which will be called after each timeline event such as play/pause.\n callback_fn should take an argument of event\n\n Args:\n callback_name (str): [description]\n callback_fn (Callable[[omni.timeline.TimelineEvent], None]): [description]\n ", "snippet": "simulation_context.add_timeline_callback(callback_name=callback_name, # str\n callback_fn=callback_fn) # typing.Callable\n" }, { "title": "clear", "description": "Clears the current stage leaving the PhysicsScene only if under /World.", "snippet": "simulation_context.clear()\n" }, { "title": "clear_all_callbacks", "description": "Clears all callbacks which were added using add_*_callback fn.\n ", "snippet": "simulation_context.clear_all_callbacks()\n" }, { "title": "clear_physics_callbacks", "description": "[summary]\n ", "snippet": "simulation_context.clear_physics_callbacks()\n" }, { "title": "clear_render_callbacks", "description": "[summary]\n ", "snippet": "simulation_context.clear_render_callbacks()\n" }, { "title": "clear_stage_callbacks", "description": "[summary]\n ", "snippet": "simulation_context.clear_stage_callbacks()\n" }, { "title": "clear_timeline_callbacks", "description": "[summary]\n ", "snippet": "simulation_context.clear_timeline_callbacks()\n" }, { "title": "get_physics_context", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n PhysicsContext: [description]\n ", "snippet": "physics_context = simulation_context.get_physics_context()\n" }, { "title": "get_physics_dt", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n float: current physics dt of the PhysicsContext\n ", "snippet": "physics_dt = simulation_context.get_physics_dt()\n" }, { "title": "get_rendering_dt", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n float: current rendering dt\n ", "snippet": "rendering_dt = simulation_context.get_rendering_dt()\n" }, { "title": "initialize_physics", "description": "", "snippet": "simulation_context.initialize_physics()\n" }, { "title": "initialize_simulation_context_async", "description": "", "snippet": "simulation_context.initialize_simulation_context_async()\n" }, { "title": "is_playing", "description": "Returns: True if the simulator is playing.", "snippet": "simulation_context.is_playing()\n" }, { "title": "is_simulating", "description": "Returns: True if physics simulation is happening.\n\n Note:\n Can return True if start_simulation is called even if play was pressed/ called.\n\n Deprecated:\n With deprecation of Dynamic Control Toolbox, this function is not needed.\n ", "snippet": "simulation_context.is_simulating()\n" }, { "title": "is_stopped", "description": "Returns: True if the simulator is stopped.", "snippet": "simulation_context.is_stopped()\n" }, { "title": "pause", "description": "Pauses the physics simulation", "snippet": "simulation_context.pause()\n" }, { "title": "pause_async", "description": "Pauses the physics simulation", "snippet": "simulation_context.pause_async()\n" }, { "title": "physics_callback_exists", "description": "[summary]\n\n Args:\n callback_name (str): [description]\n\n Returns:\n bool: [description]\n ", "snippet": "simulation_context.physics_callback_exists(callback_name=callback_name) # str\n" }, { "title": "play", "description": "Start playing simulation.\n\n Note:\n it does one step internally to propagate all physics handles properly.\n ", "snippet": "simulation_context.play()\n" }, { "title": "play_async", "description": "Starts playing simulation.", "snippet": "simulation_context.play_async()\n" }, { "title": "remove_physics_callback", "description": "[summary]\n\n Args:\n callback_name (str): [description]\n ", "snippet": "simulation_context.remove_physics_callback(callback_name=callback_name) # str\n" }, { "title": "remove_render_callback", "description": "[summary]\n\n Args:\n callback_name (str): [description]\n ", "snippet": "simulation_context.remove_render_callback(callback_name=callback_name) # str\n" }, { "title": "remove_stage_callback", "description": "[summary]\n\n Args:\n callback_name (str): [description]\n ", "snippet": "simulation_context.remove_stage_callback(callback_name=callback_name) # str\n" }, { "title": "remove_timeline_callback", "description": "[summary]\n\n Args:\n callback_name (str): [description]\n ", "snippet": "simulation_context.remove_timeline_callback(callback_name=callback_name) # str\n" }, { "title": "render", "description": "Refreshes the Isaac Sim app rendering components including UI elements and view ports..etc.\n ", "snippet": "simulation_context.render()\n" }, { "title": "render_callback_exists", "description": "[summary]\n\n Args:\n callback_name (str): [description]\n\n Returns:\n bool: [description]\n ", "snippet": "simulation_context.render_callback_exists(callback_name=callback_name) # str\n" }, { "title": "reset", "description": "Resets the physics simulation view.\n\n Args:\n soft (bool, optional): if set to True simulation won't be stopped and start again. It only calls the reset on the scene objects. \n ", "snippet": "simulation_context.reset(soft=False) # bool\n" }, { "title": "reset_async", "description": "Resets the physics simulation view (asynchornous version).\n\n Args:\n soft (bool, optional): if set to True simulation won't be stopped and start again. It only calls the reset on the scene objects. \n ", "snippet": "simulation_context.reset_async(soft=False) # bool\n" }, { "title": "set_simulation_dt", "description": "Specify the physics step and rendering step size to use when stepping and rendering. It is recommended that the two values are divisible. \n\n Args:\n physics_dt (float): The physics time-step. None means it won't change the current setting. (default: None).\n rendering_dt (float): The rendering time-step. None means it won't change the current setting. (default: None)\n ", "snippet": "simulation_context.set_simulation_dt(physics_dt=None, # typing.Union[float, NoneType]\n rendering_dt=None) # typing.Union[float, NoneType]\n" }, { "title": "stage_callback_exists", "description": "[summary]\n\n Args:\n callback_name (str): [description]\n\n Returns:\n bool: [description]\n ", "snippet": "simulation_context.stage_callback_exists(callback_name=callback_name) # str\n" }, { "title": "step", "description": "Steps the physics simulation while rendering or without.\n\n Args:\n render (bool, optional): Set to False to only do a physics simulation without rendering. Note:\n app UI will be frozen (since its not rendering) in this case.\n Defaults to True.\n\n Raises:\n Exception: [description]\n ", "snippet": "simulation_context.step(render=True) # bool\n" }, { "title": "stop", "description": "Stops the physics simulation", "snippet": "simulation_context.stop()\n" }, { "title": "stop_async", "description": "Stops the physics simulation", "snippet": "simulation_context.stop_async()\n" }, { "title": "timeline_callback_exists", "description": "[summary]\n\n Args:\n callback_name (str): [description]\n\n Returns:\n bool: [description]\n ", "snippet": "simulation_context.timeline_callback_exists(callback_name=callback_name) # str\n" } ] }, { "title": "World", "snippets": [ { "title": "World", "description": " This class inherits from SimulationContext which provides the following.\n\n SimulationContext provide functions that take care of many time-related events such as\n perform a physics or a render step for instance. Adding/ removing callback functions that \n gets triggered with certain events such as a physics step, timeline event \n (pause or play..etc), stage open/ close..etc.\n\n It also includes an instance of PhysicsContext which takes care of many physics related\n settings such as setting physics dt, solver type..etc.\n \n In addition to what is provided from SimulationContext, this class allows the user to add a \n task to the world and it contains a scene object.\n \n To control the default reset state of different objects easily, the object could be added to\n a Scene. Besides this, the object is bound to a short keyword that fascilitates objects retrievals,\n like in a dict.\n\n Checkout the required tutorials at \n https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/overview.html\n\n Args:\n physics_dt (Optional[float], optional): dt between physics steps. Defaults to None.\n rendering_dt (Optional[float], optional): dt between rendering steps. Note: rendering means \n rendering a frame of the current application and not \n only rendering a frame to the viewports/ cameras. So UI\n elements of Isaac Sim will be refereshed with this dt \n as well if running non-headless. \n Defaults to None.\n stage_units_in_meters (Optional[float], optional): The metric units of assets. This will affect gravity value..etc.\n Defaults to None.\n physics_prim_path (Optional[str], optional): specifies the prim path to create a PhysicsScene at, \n only in the case where no PhysicsScene already defined. \n Defaults to \"/physicsScene\".\n set_defaults (bool, optional): set to True to use the defaults settings\n [physics_dt = 1.0/ 60.0,\n stage units in meters = 0.01 (i.e in cms),\n rendering_dt = 1.0 / 60.0,\n gravity = -9.81 m / s\n ccd_enabled,\n stabilization_enabled,\n gpu dynamics turned off,\n broadcast type is MBP,\n solver type is TGS]. Defaults to True.\n backend (str, optional): specifies the backend to be used (numpy or torch). Defaults to numpy.\n device (Optional[str], optional): specifies the device to be used if running on the gpu with torch backend.\n ", "snippet": "world = World(physics_dt=None, # typing.Union[float, NoneType]\n rendering_dt=None, # typing.Union[float, NoneType]\n stage_units_in_meters=None, # typing.Union[float, NoneType]\n physics_prim_path=\"/physicsScene\", # str\n sim_params=None, # dict\n set_defaults=True, # bool\n backend=\"numpy\", # str\n device=None) # typing.Union[str, NoneType]\n" }, { "title": "add_task", "description": "Tasks should have a unique name.\n\n\n Args:\n task (BaseTask): [description]\n ", "snippet": "world.add_task(task=task) # omni.isaac.core.tasks.base_task.BaseTask\n" }, { "title": "calculate_metrics", "description": "Gets metrics from all the tasks that were added\n\n Args:\n task_name (Optional[str], optional): [description]. Defaults to None.\n\n Returns:\n [type]: [description]\n ", "snippet": "world.calculate_metrics(task_name=None) # typing.Union[str, NoneType]\n" }, { "title": "clear", "description": "Clears the stage leaving the PhysicsScene only if under /World.\n ", "snippet": "world.clear()\n" }, { "title": "get_current_tasks", "description": "[summary]\n\n Returns:\n List[BaseTask]: [description]\n ", "snippet": "current_tasks = world.get_current_tasks()\n" }, { "title": "get_data_logger", "description": "Returns the data logger of the world.\n\n Returns:\n DataLogger: [description]\n ", "snippet": "data_logger = world.get_data_logger()\n" }, { "title": "get_observations", "description": "Gets observations from all the tasks that were added\n\n Args:\n task_name (Optional[str], optional): [description]. Defaults to None.\n\n Returns:\n dict: [description]\n ", "snippet": "observations = world.get_observations(task_name=None) # typing.Union[str, NoneType]\n" }, { "title": "get_task", "description": "", "snippet": "task = world.get_task(name=name) # str\n" }, { "title": "initialize_physics", "description": "_summary_\n ", "snippet": "world.initialize_physics()\n" }, { "title": "is_done", "description": "[summary]\n\n Args:\n task_name (Optional[str], optional): [description]. Defaults to None.\n\n Returns:\n [type]: [description]\n ", "snippet": "world.is_done(task_name=None) # typing.Union[str, NoneType]\n" }, { "title": "is_tasks_scene_built", "description": "", "snippet": "world.is_tasks_scene_built()\n" }, { "title": "reset", "description": " Resets the stage to its initial state and each object included in the Scene to its default state\n as specified by .set_default_state and the __init__ funcs. \n\n Note:\n - All tasks should be added before the first reset is called unless a .clear() was called. \n - All articulations should be added before the first reset is called unless a .clear() was called. \n - This method takes care of initializing articulation handles with the first reset called.\n - This will do one step internally regardless\n - calls post_reset on each object in the Scene\n - calls post_reset on each Task\n\n things like setting pd gains for instance should happend at a Task reset or a Robot reset since\n the defaults are restored after .stop() is called.\n\n Args:\n soft (bool, optional): if set to True simulation won't be stopped and start again. It only calls the reset on the scene objects. \n ", "snippet": "world.reset(soft=False) # bool\n" }, { "title": "reset_async", "description": "Resets the stage to its initial state and each object included in the Scene to its default state\n as specified by .set_default_state and the __init__ funcs. \n\n Note:\n - All tasks should be added before the first reset is called unless a .clear() was called. \n - All articulations should be added before the first reset is called unless a .clear() was called. \n - This method takes care of initializing articulation handles with the first reset called.\n - This will do one step internally regardless\n - calls post_reset on each object in the Scene\n - calls post_reset on each Task\n\n things like setting pd gains for instance should happend at a Task reset or a Robot reset since\n the defaults are restored after .stop() is called.\n\n Args:\n soft (bool, optional): if set to True simulation won't be stopped and start again. It only calls the reset on the scene objects. \n ", "snippet": "world.reset_async(soft=False) # bool\n" }, { "title": "step", "description": "Steps the physics simulation while rendering or without.\n\n - Note: task pre_step is called here.\n\n Args:\n render (bool, optional): Set to False to only do a physics simulation without rendering. Note:\n app UI will be frozen (since its not rendering) in this case. \n Defaults to True.\n\n ", "snippet": "world.step(render=True, # bool\n step_sim=True) # bool\n" }, { "title": "step_async", "description": "Calls all functions that should be called pre stepping the physics\n\n - Note: task pre_step is called here.\n\n Args:\n step_size (float): [description]\n\n Raises:\n Exception: [description]\n ", "snippet": "world.step_async(step_size=None) # typing.Union[float, NoneType]\n" }, { "title": "add_physics_callback", "description": "Adds a callback which will be called before each physics step.\n callback_fn should take an argument of step_size: float\n\n Args:\n callback_name (str): should be unique.\n callback_fn (Callable[[float], None]): [description]\n ", "snippet": "world.add_physics_callback(callback_name=callback_name, # str\n callback_fn=callback_fn) # typing.Callable[[float], NoneType]\n" }, { "title": "add_render_callback", "description": "Adds a callback which will be called after each rendering event such as .render().\n callback_fn should take an argument of event\n\n Args:\n callback_name (str): [description]\n callback_fn (Callable): [description]\n ", "snippet": "world.add_render_callback(callback_name=callback_name, # str\n callback_fn=callback_fn) # typing.Callable\n" }, { "title": "add_stage_callback", "description": "Adds a callback which will be called after each stage event such as open/close.\n callback_fn should take an argument of event\n\n Args:\n callback_name (str): [description]\n callback_fn (Callable[[omni.usd.StageEvent], None]): [description]\n ", "snippet": "world.add_stage_callback(callback_name=callback_name, # str\n callback_fn=callback_fn) # typing.Callable\n" }, { "title": "add_timeline_callback", "description": "Adds a callback which will be called after each timeline event such as play/pause.\n callback_fn should take an argument of event\n\n Args:\n callback_name (str): [description]\n callback_fn (Callable[[omni.timeline.TimelineEvent], None]): [description]\n ", "snippet": "world.add_timeline_callback(callback_name=callback_name, # str\n callback_fn=callback_fn) # typing.Callable\n" }, { "title": "clear", "description": "Clears the current stage leaving the PhysicsScene only if under /World.", "snippet": "world.clear()\n" }, { "title": "clear_all_callbacks", "description": "Clears all callbacks which were added using add_*_callback fn.\n ", "snippet": "world.clear_all_callbacks()\n" }, { "title": "clear_physics_callbacks", "description": "[summary]\n ", "snippet": "world.clear_physics_callbacks()\n" }, { "title": "clear_render_callbacks", "description": "[summary]\n ", "snippet": "world.clear_render_callbacks()\n" }, { "title": "clear_stage_callbacks", "description": "[summary]\n ", "snippet": "world.clear_stage_callbacks()\n" }, { "title": "clear_timeline_callbacks", "description": "[summary]\n ", "snippet": "world.clear_timeline_callbacks()\n" }, { "title": "get_physics_context", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n PhysicsContext: [description]\n ", "snippet": "physics_context = world.get_physics_context()\n" }, { "title": "get_physics_dt", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n float: current physics dt of the PhysicsContext\n ", "snippet": "physics_dt = world.get_physics_dt()\n" }, { "title": "get_rendering_dt", "description": "[summary]\n\n Raises:\n Exception: [description]\n\n Returns:\n float: current rendering dt\n ", "snippet": "rendering_dt = world.get_rendering_dt()\n" }, { "title": "initialize_physics", "description": "", "snippet": "world.initialize_physics()\n" }, { "title": "initialize_simulation_context_async", "description": "", "snippet": "world.initialize_simulation_context_async()\n" }, { "title": "is_playing", "description": "Returns: True if the simulator is playing.", "snippet": "world.is_playing()\n" }, { "title": "is_simulating", "description": "Returns: True if physics simulation is happening.\n\n Note:\n Can return True if start_simulation is called even if play was pressed/ called.\n\n Deprecated:\n With deprecation of Dynamic Control Toolbox, this function is not needed.\n ", "snippet": "world.is_simulating()\n" }, { "title": "is_stopped", "description": "Returns: True if the simulator is stopped.", "snippet": "world.is_stopped()\n" }, { "title": "pause", "description": "Pauses the physics simulation", "snippet": "world.pause()\n" }, { "title": "pause_async", "description": "Pauses the physics simulation", "snippet": "world.pause_async()\n" }, { "title": "physics_callback_exists", "description": "[summary]\n\n Args:\n callback_name (str): [description]\n\n Returns:\n bool: [description]\n ", "snippet": "world.physics_callback_exists(callback_name=callback_name) # str\n" }, { "title": "play", "description": "Start playing simulation.\n\n Note:\n it does one step internally to propagate all physics handles properly.\n ", "snippet": "world.play()\n" }, { "title": "play_async", "description": "Starts playing simulation.", "snippet": "world.play_async()\n" }, { "title": "remove_physics_callback", "description": "[summary]\n\n Args:\n callback_name (str): [description]\n ", "snippet": "world.remove_physics_callback(callback_name=callback_name) # str\n" }, { "title": "remove_render_callback", "description": "[summary]\n\n Args:\n callback_name (str): [description]\n ", "snippet": "world.remove_render_callback(callback_name=callback_name) # str\n" }, { "title": "remove_stage_callback", "description": "[summary]\n\n Args:\n callback_name (str): [description]\n ", "snippet": "world.remove_stage_callback(callback_name=callback_name) # str\n" }, { "title": "remove_timeline_callback", "description": "[summary]\n\n Args:\n callback_name (str): [description]\n ", "snippet": "world.remove_timeline_callback(callback_name=callback_name) # str\n" }, { "title": "render", "description": "Refreshes the Isaac Sim app rendering components including UI elements and view ports..etc.\n ", "snippet": "world.render()\n" }, { "title": "render_callback_exists", "description": "[summary]\n\n Args:\n callback_name (str): [description]\n\n Returns:\n bool: [description]\n ", "snippet": "world.render_callback_exists(callback_name=callback_name) # str\n" }, { "title": "reset", "description": "Resets the physics simulation view.\n\n Args:\n soft (bool, optional): if set to True simulation won't be stopped and start again. It only calls the reset on the scene objects. \n ", "snippet": "world.reset(soft=False) # bool\n" }, { "title": "reset_async", "description": "Resets the physics simulation view (asynchornous version).\n\n Args:\n soft (bool, optional): if set to True simulation won't be stopped and start again. It only calls the reset on the scene objects. \n ", "snippet": "world.reset_async(soft=False) # bool\n" }, { "title": "set_simulation_dt", "description": "Specify the physics step and rendering step size to use when stepping and rendering. It is recommended that the two values are divisible. \n\n Args:\n physics_dt (float): The physics time-step. None means it won't change the current setting. (default: None).\n rendering_dt (float): The rendering time-step. None means it won't change the current setting. (default: None)\n ", "snippet": "world.set_simulation_dt(physics_dt=None, # typing.Union[float, NoneType]\n rendering_dt=None) # typing.Union[float, NoneType]\n" }, { "title": "stage_callback_exists", "description": "[summary]\n\n Args:\n callback_name (str): [description]\n\n Returns:\n bool: [description]\n ", "snippet": "world.stage_callback_exists(callback_name=callback_name) # str\n" }, { "title": "step", "description": "Steps the physics simulation while rendering or without.\n\n Args:\n render (bool, optional): Set to False to only do a physics simulation without rendering. Note:\n app UI will be frozen (since its not rendering) in this case.\n Defaults to True.\n\n Raises:\n Exception: [description]\n ", "snippet": "world.step(render=True) # bool\n" }, { "title": "stop", "description": "Stops the physics simulation", "snippet": "world.stop()\n" }, { "title": "stop_async", "description": "Stops the physics simulation", "snippet": "world.stop_async()\n" }, { "title": "timeline_callback_exists", "description": "[summary]\n\n Args:\n callback_name (str): [description]\n\n Returns:\n bool: [description]\n ", "snippet": "world.timeline_callback_exists(callback_name=callback_name) # str\n" } ] }, { "title": "Tasks", "snippets": [ { "title": "BaseTask", "snippets": [ { "title": "BaseTask", "description": "This class provides a way to set up a task in a scene and modularize adding objects to stage,\n getting observations needed for the behavioral layer, caclulating metrics needed about the task,\n calling certain things pre-stepping, creating multiple tasks at the same time and much more.\n\n Checkout the required tutorials at \n https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/overview.html\n\n Args:\n name (str): needs to be unique if added to the World.\n offset (Optional[np.ndarray], optional): offset applied to all assets of the task.\n ", "snippet": "base_task = BaseTask(name=name, # str\n offset=None) # typing.Union[numpy.ndarray, NoneType]\n" }, { "title": "calculate_metrics", "description": "[summary]\n\n Raises:\n NotImplementedError: [description]\n ", "snippet": "base_task.calculate_metrics()\n" }, { "title": "cleanup", "description": "Called before calling a reset() on the world to removed temporarly objects that were added during\n simulation for instance.\n ", "snippet": "base_task.cleanup()\n" }, { "title": "get_description", "description": "[summary]\n\n Returns:\n str: [description]\n ", "snippet": "description = base_task.get_description()\n" }, { "title": "get_observations", "description": "Returns current observations from the objects needed for the behavioral layer.\n\n Raises:\n NotImplementedError: [description]\n\n Returns:\n dict: [description]\n ", "snippet": "observations = base_task.get_observations()\n" }, { "title": "get_params", "description": "Gets the parameters of the task.\n This is defined differently for each task in order to access the task's objects and values.\n Note that this is different from get_observations. \n Things like the robot name, block name..etc can be defined here for faster retrieval. \n should have the form of params_representation[\"param_name\"] = {\"value\": param_value, \"modifiable\": bool}\n\n Raises:\n NotImplementedError: [description]\n\n Returns:\n dict: defined parameters of the task.\n ", "snippet": "params = base_task.get_params()\n" }, { "title": "get_task_objects", "description": "[summary]\n\n Returns:\n dict: [description]\n ", "snippet": "task_objects = base_task.get_task_objects()\n" }, { "title": "is_done", "description": "Returns True of the task is done.\n\n Raises:\n NotImplementedError: [description]\n ", "snippet": "base_task.is_done()\n" }, { "title": "post_reset", "description": "Calls while doing a .reset() on the world.\n ", "snippet": "base_task.post_reset()\n" }, { "title": "pre_step", "description": "called before stepping the physics simulation.\n\n Args:\n time_step_index (int): [description]\n simulation_time (float): [description]\n ", "snippet": "base_task.pre_step(time_step_index=time_step_index, # int\n simulation_time=simulation_time) # float\n" }, { "title": "set_params", "description": "Changes the modifiable paramateres of the task\n\n Raises:\n NotImplementedError: [description]\n ", "snippet": "base_task.set_params()\n" }, { "title": "set_up_scene", "description": "Adding assets to the stage as well as adding the encapsulated objects such as XFormPrim..etc\n to the task_objects happens here.\n\n Args:\n scene (Scene): [description]\n ", "snippet": "base_task.set_up_scene(scene=scene) # omni.isaac.core.scenes.scene.Scene\n" } ] }, { "title": "FollowTarget", "snippets": [ { "title": "FollowTarget", "description": "[summary]\n\n Args:\n name (str): [description]\n target_prim_path (Optional[str], optional): [description]. Defaults to None.\n target_name (Optional[str], optional): [description]. Defaults to None.\n target_position (Optional[np.ndarray], optional): [description]. Defaults to None.\n target_orientation (Optional[np.ndarray], optional): [description]. Defaults to None.\n offset (Optional[np.ndarray], optional): [description]. Defaults to None.\n ", "snippet": "follow_target = FollowTarget(name=name, # str\n target_prim_path=None, # typing.Union[str, NoneType]\n target_name=None, # typing.Union[str, NoneType]\n target_position=None, # typing.Union[numpy.ndarray, NoneType]\n target_orientation=None, # typing.Union[numpy.ndarray, NoneType]\n offset=None) # typing.Union[numpy.ndarray, NoneType]\n" }, { "title": "add_obstacle", "description": "[summary]\n\n Args:\n position (np.ndarray, optional): [description]. Defaults to np.array([0.1, 0.1, 1.0]).\n ", "snippet": "follow_target.add_obstacle(position=None) # numpy.ndarray\n" }, { "title": "calculate_metrics", "description": "[summary]\n ", "snippet": "follow_target.calculate_metrics()\n" }, { "title": "cleanup", "description": "[summary]\n ", "snippet": "follow_target.cleanup()\n" }, { "title": "get_observations", "description": "[summary]\n\n Returns:\n dict: [description]\n ", "snippet": "observations = follow_target.get_observations()\n" }, { "title": "get_obstacle_to_delete", "description": "[summary]\n\n Returns:\n [type]: [description]\n ", "snippet": "obstacle_to_delete = follow_target.get_obstacle_to_delete()\n" }, { "title": "get_params", "description": "[summary]\n\n Returns:\n dict: [description]\n ", "snippet": "params = follow_target.get_params()\n" }, { "title": "is_done", "description": "[summary]\n ", "snippet": "follow_target.is_done()\n" }, { "title": "obstacles_exist", "description": "[summary]\n\n Returns:\n bool: [description]\n ", "snippet": "follow_target.obstacles_exist()\n" }, { "title": "post_reset", "description": "[summary]\n ", "snippet": "follow_target.post_reset()\n" }, { "title": "pre_step", "description": "[summary]\n\n Args:\n time_step_index (int): [description]\n simulation_time (float): [description]\n ", "snippet": "follow_target.pre_step(time_step_index=time_step_index, # int\n simulation_time=simulation_time) # float\n" }, { "title": "remove_obstacle", "description": "[summary]\n\n Args:\n name (Optional[str], optional): [description]. Defaults to None.\n ", "snippet": "follow_target.remove_obstacle(name=None) # typing.Union[str, NoneType]\n" }, { "title": "set_params", "description": "[summary]\n\n Args:\n target_prim_path (Optional[str], optional): [description]. Defaults to None.\n target_name (Optional[str], optional): [description]. Defaults to None.\n target_position (Optional[np.ndarray], optional): [description]. Defaults to None.\n target_orientation (Optional[np.ndarray], optional): [description]. Defaults to None.\n ", "snippet": "follow_target.set_params(target_prim_path=None, # typing.Union[str, NoneType]\n target_name=None, # typing.Union[str, NoneType]\n target_position=None, # typing.Union[numpy.ndarray, NoneType]\n target_orientation=None) # typing.Union[numpy.ndarray, NoneType]\n" }, { "title": "set_robot", "description": "[summary]\n\n Raises:\n NotImplementedError: [description]\n ", "snippet": "follow_target.set_robot()\n" }, { "title": "set_up_scene", "description": "[summary]\n\n Args:\n scene (Scene): [description]\n ", "snippet": "follow_target.set_up_scene(scene=scene) # omni.isaac.core.scenes.scene.Scene\n" }, { "title": "target_reached", "description": "[summary]\n\n Returns:\n bool: [description]\n ", "snippet": "follow_target.target_reached()\n" }, { "title": "calculate_metrics", "description": "[summary]\n\n Raises:\n NotImplementedError: [description]\n ", "snippet": "follow_target.calculate_metrics()\n" }, { "title": "cleanup", "description": "Called before calling a reset() on the world to removed temporarly objects that were added during\n simulation for instance.\n ", "snippet": "follow_target.cleanup()\n" }, { "title": "get_description", "description": "[summary]\n\n Returns:\n str: [description]\n ", "snippet": "description = follow_target.get_description()\n" }, { "title": "get_observations", "description": "Returns current observations from the objects needed for the behavioral layer.\n\n Raises:\n NotImplementedError: [description]\n\n Returns:\n dict: [description]\n ", "snippet": "observations = follow_target.get_observations()\n" }, { "title": "get_params", "description": "Gets the parameters of the task.\n This is defined differently for each task in order to access the task's objects and values.\n Note that this is different from get_observations. \n Things like the robot name, block name..etc can be defined here for faster retrieval. \n should have the form of params_representation[\"param_name\"] = {\"value\": param_value, \"modifiable\": bool}\n\n Raises:\n NotImplementedError: [description]\n\n Returns:\n dict: defined parameters of the task.\n ", "snippet": "params = follow_target.get_params()\n" }, { "title": "get_task_objects", "description": "[summary]\n\n Returns:\n dict: [description]\n ", "snippet": "task_objects = follow_target.get_task_objects()\n" }, { "title": "is_done", "description": "Returns True of the task is done.\n\n Raises:\n NotImplementedError: [description]\n ", "snippet": "follow_target.is_done()\n" }, { "title": "post_reset", "description": "Calls while doing a .reset() on the world.\n ", "snippet": "follow_target.post_reset()\n" }, { "title": "pre_step", "description": "called before stepping the physics simulation.\n\n Args:\n time_step_index (int): [description]\n simulation_time (float): [description]\n ", "snippet": "follow_target.pre_step(time_step_index=time_step_index, # int\n simulation_time=simulation_time) # float\n" }, { "title": "set_params", "description": "Changes the modifiable paramateres of the task\n\n Raises:\n NotImplementedError: [description]\n ", "snippet": "follow_target.set_params()\n" }, { "title": "set_up_scene", "description": "Adding assets to the stage as well as adding the encapsulated objects such as XFormPrim..etc\n to the task_objects happens here.\n\n Args:\n scene (Scene): [description]\n ", "snippet": "follow_target.set_up_scene(scene=scene) # omni.isaac.core.scenes.scene.Scene\n" } ] }, { "title": "PickPlace", "snippets": [ { "title": "PickPlace", "description": "[summary]\n\nArgs:\n name (str): [description]\n cube_initial_position (Optional[np.ndarray], optional): [description]. Defaults to None.\n cube_initial_orientation (Optional[np.ndarray], optional): [description]. Defaults to None.\n target_position (Optional[np.ndarray], optional): [description]. Defaults to None.\n cube_size (Optional[np.ndarray], optional): [description]. Defaults to None.\n offset (Optional[np.ndarray], optional): [description]. Defaults to None.", "snippet": "pick_place = PickPlace(name=name, # str\n cube_initial_position=None, # typing.Union[numpy.ndarray, NoneType]\n cube_initial_orientation=None, # typing.Union[numpy.ndarray, NoneType]\n target_position=None, # typing.Union[numpy.ndarray, NoneType]\n cube_size=None, # typing.Union[numpy.ndarray, NoneType]\n offset=None) # typing.Union[numpy.ndarray, NoneType]\n" }, { "title": "calculate_metrics", "description": "[summary]\n ", "snippet": "pick_place.calculate_metrics()\n" }, { "title": "get_observations", "description": "[summary]\n\n Returns:\n dict: [description]\n ", "snippet": "observations = pick_place.get_observations()\n" }, { "title": "get_params", "description": "", "snippet": "params = pick_place.get_params()\n" }, { "title": "is_done", "description": "[summary]\n ", "snippet": "pick_place.is_done()\n" }, { "title": "post_reset", "description": "", "snippet": "pick_place.post_reset()\n" }, { "title": "pre_step", "description": "[summary]\n\n Args:\n time_step_index (int): [description]\n simulation_time (float): [description]\n ", "snippet": "pick_place.pre_step(time_step_index=time_step_index, # int\n simulation_time=simulation_time) # float\n" }, { "title": "set_params", "description": "", "snippet": "pick_place.set_params(cube_position=None, # typing.Union[numpy.ndarray, NoneType]\n cube_orientation=None, # typing.Union[numpy.ndarray, NoneType]\n target_position=None) # typing.Union[numpy.ndarray, NoneType]\n" }, { "title": "set_robot", "description": "", "snippet": "pick_place.set_robot()\n" }, { "title": "set_up_scene", "description": "[summary]\n\n Args:\n scene (Scene): [description]\n ", "snippet": "pick_place.set_up_scene(scene=scene) # omni.isaac.core.scenes.scene.Scene\n" }, { "title": "calculate_metrics", "description": "[summary]\n\n Raises:\n NotImplementedError: [description]\n ", "snippet": "pick_place.calculate_metrics()\n" }, { "title": "cleanup", "description": "Called before calling a reset() on the world to removed temporarly objects that were added during\n simulation for instance.\n ", "snippet": "pick_place.cleanup()\n" }, { "title": "get_description", "description": "[summary]\n\n Returns:\n str: [description]\n ", "snippet": "description = pick_place.get_description()\n" }, { "title": "get_observations", "description": "Returns current observations from the objects needed for the behavioral layer.\n\n Raises:\n NotImplementedError: [description]\n\n Returns:\n dict: [description]\n ", "snippet": "observations = pick_place.get_observations()\n" }, { "title": "get_params", "description": "Gets the parameters of the task.\n This is defined differently for each task in order to access the task's objects and values.\n Note that this is different from get_observations. \n Things like the robot name, block name..etc can be defined here for faster retrieval. \n should have the form of params_representation[\"param_name\"] = {\"value\": param_value, \"modifiable\": bool}\n\n Raises:\n NotImplementedError: [description]\n\n Returns:\n dict: defined parameters of the task.\n ", "snippet": "params = pick_place.get_params()\n" }, { "title": "get_task_objects", "description": "[summary]\n\n Returns:\n dict: [description]\n ", "snippet": "task_objects = pick_place.get_task_objects()\n" }, { "title": "is_done", "description": "Returns True of the task is done.\n\n Raises:\n NotImplementedError: [description]\n ", "snippet": "pick_place.is_done()\n" }, { "title": "post_reset", "description": "Calls while doing a .reset() on the world.\n ", "snippet": "pick_place.post_reset()\n" }, { "title": "pre_step", "description": "called before stepping the physics simulation.\n\n Args:\n time_step_index (int): [description]\n simulation_time (float): [description]\n ", "snippet": "pick_place.pre_step(time_step_index=time_step_index, # int\n simulation_time=simulation_time) # float\n" }, { "title": "set_params", "description": "Changes the modifiable paramateres of the task\n\n Raises:\n NotImplementedError: [description]\n ", "snippet": "pick_place.set_params()\n" }, { "title": "set_up_scene", "description": "Adding assets to the stage as well as adding the encapsulated objects such as XFormPrim..etc\n to the task_objects happens here.\n\n Args:\n scene (Scene): [description]\n ", "snippet": "pick_place.set_up_scene(scene=scene) # omni.isaac.core.scenes.scene.Scene\n" } ] }, { "title": "Stacking", "snippets": [ { "title": "Stacking", "description": "[summary]\n\nArgs:\n name (str): [description]\n cube_initial_positions (np.ndarray): [description]\n cube_initial_orientations (Optional[np.ndarray], optional): [description]. Defaults to None.\n stack_target_position (Optional[np.ndarray], optional): [description]. Defaults to None.\n cube_size (Optional[np.ndarray], optional): [description]. Defaults to None.\n offset (Optional[np.ndarray], optional): [description]. Defaults to None.", "snippet": "stacking = Stacking(name=name, # str\n cube_initial_positions=cube_initial_positions, # numpy.ndarray\n cube_initial_orientations=None, # typing.Union[numpy.ndarray, NoneType]\n stack_target_position=None, # typing.Union[numpy.ndarray, NoneType]\n cube_size=None, # typing.Union[numpy.ndarray, NoneType]\n offset=None) # typing.Union[numpy.ndarray, NoneType]\n" }, { "title": "calculate_metrics", "description": "[summary]\n\n Raises:\n NotImplementedError: [description]\n\n Returns:\n dict: [description]\n ", "snippet": "stacking.calculate_metrics()\n" }, { "title": "get_cube_names", "description": "[summary]\n\n Returns:\n List[str]: [description]\n ", "snippet": "cube_names = stacking.get_cube_names()\n" }, { "title": "get_observations", "description": "[summary]\n\n Returns:\n dict: [description]\n ", "snippet": "observations = stacking.get_observations()\n" }, { "title": "get_params", "description": "[summary]\n\n Returns:\n dict: [description]\n ", "snippet": "params = stacking.get_params()\n" }, { "title": "is_done", "description": "[summary]\n\n Raises:\n NotImplementedError: [description]\n\n Returns:\n bool: [description]\n ", "snippet": "stacking.is_done()\n" }, { "title": "post_reset", "description": "[summary]\n ", "snippet": "stacking.post_reset()\n" }, { "title": "pre_step", "description": "[summary]\n\n Args:\n time_step_index (int): [description]\n simulation_time (float): [description]\n ", "snippet": "stacking.pre_step(time_step_index=time_step_index, # int\n simulation_time=simulation_time) # float\n" }, { "title": "set_params", "description": "[summary]\n\n Args:\n cube_name (Optional[str], optional): [description]. Defaults to None.\n cube_position (Optional[str], optional): [description]. Defaults to None.\n cube_orientation (Optional[str], optional): [description]. Defaults to None.\n stack_target_position (Optional[str], optional): [description]. Defaults to None.\n ", "snippet": "stacking.set_params(cube_name=None, # typing.Union[str, NoneType]\n cube_position=None, # typing.Union[str, NoneType]\n cube_orientation=None, # typing.Union[str, NoneType]\n stack_target_position=None) # typing.Union[str, NoneType]\n" }, { "title": "set_robot", "description": "[summary]\n\n Raises:\n NotImplementedError: [description]\n ", "snippet": "stacking.set_robot()\n" }, { "title": "set_up_scene", "description": "[summary]\n\n Args:\n scene (Scene): [description]\n ", "snippet": "stacking.set_up_scene(scene=scene) # omni.isaac.core.scenes.scene.Scene\n" }, { "title": "calculate_metrics", "description": "[summary]\n\n Raises:\n NotImplementedError: [description]\n ", "snippet": "stacking.calculate_metrics()\n" }, { "title": "cleanup", "description": "Called before calling a reset() on the world to removed temporarly objects that were added during\n simulation for instance.\n ", "snippet": "stacking.cleanup()\n" }, { "title": "get_description", "description": "[summary]\n\n Returns:\n str: [description]\n ", "snippet": "description = stacking.get_description()\n" }, { "title": "get_observations", "description": "Returns current observations from the objects needed for the behavioral layer.\n\n Raises:\n NotImplementedError: [description]\n\n Returns:\n dict: [description]\n ", "snippet": "observations = stacking.get_observations()\n" }, { "title": "get_params", "description": "Gets the parameters of the task.\n This is defined differently for each task in order to access the task's objects and values.\n Note that this is different from get_observations. \n Things like the robot name, block name..etc can be defined here for faster retrieval. \n should have the form of params_representation[\"param_name\"] = {\"value\": param_value, \"modifiable\": bool}\n\n Raises:\n NotImplementedError: [description]\n\n Returns:\n dict: defined parameters of the task.\n ", "snippet": "params = stacking.get_params()\n" }, { "title": "get_task_objects", "description": "[summary]\n\n Returns:\n dict: [description]\n ", "snippet": "task_objects = stacking.get_task_objects()\n" }, { "title": "is_done", "description": "Returns True of the task is done.\n\n Raises:\n NotImplementedError: [description]\n ", "snippet": "stacking.is_done()\n" }, { "title": "post_reset", "description": "Calls while doing a .reset() on the world.\n ", "snippet": "stacking.post_reset()\n" }, { "title": "pre_step", "description": "called before stepping the physics simulation.\n\n Args:\n time_step_index (int): [description]\n simulation_time (float): [description]\n ", "snippet": "stacking.pre_step(time_step_index=time_step_index, # int\n simulation_time=simulation_time) # float\n" }, { "title": "set_params", "description": "Changes the modifiable paramateres of the task\n\n Raises:\n NotImplementedError: [description]\n ", "snippet": "stacking.set_params()\n" }, { "title": "set_up_scene", "description": "Adding assets to the stage as well as adding the encapsulated objects such as XFormPrim..etc\n to the task_objects happens here.\n\n Args:\n scene (Scene): [description]\n ", "snippet": "stacking.set_up_scene(scene=scene) # omni.isaac.core.scenes.scene.Scene\n" } ] } ] } ] }, { "title": "Core utils", "snippets": [ { "title": "Common imports", "description": "Common import statements (delete unnecessary)", "snippet": "import omni.isaac.core.utils.bounds as bounds_utils\nimport omni.isaac.core.utils.carb as carb_utils\nimport omni.isaac.core.utils.collisions as collisions_utils\nimport omni.isaac.core.utils.constants as constants_utils\nimport omni.isaac.core.utils.distance_metrics as distance_metrics_utils\nimport omni.isaac.core.utils.extensions as extensions_utils\nimport omni.isaac.core.utils.math as math_utils\nimport omni.isaac.core.utils.mesh as mesh_utils\nimport omni.isaac.core.utils.nucleus as nucleus_utils\nimport omni.isaac.core.utils.numpy as numpy_utils\nimport omni.isaac.core.utils.physics as physics_utils\nimport omni.isaac.core.utils.prims as prims_utils\nimport omni.isaac.core.utils.random as random_utils\nimport omni.isaac.core.utils.render_product as render_product_utils\nimport omni.isaac.core.utils.rotations as rotations_utils\nimport omni.isaac.core.utils.semantics as semantics_utils\nimport omni.isaac.core.utils.stage as stage_utils\nimport omni.isaac.core.utils.string as string_utils\nimport omni.isaac.core.utils.transformations as transformations_utils\nimport omni.isaac.core.utils.torch as torch_utils\nimport omni.isaac.core.utils.types as types_utils\nimport omni.isaac.core.utils.viewports as viewports_utils\nimport omni.isaac.core.utils.xforms as xforms_utils\n" }, { "title": "Bounds", "snippets": [ { "title": "compute_aabb", "description": "Compute an AABB for a given prim_path, a combined AABB is computed if include_children is True\n\nArgs:\n bbox_cache (UsdGeom.BboxCache): Existing Bounding box cache to use for computation\n prim_path (str): prim path to compute AABB for\n include_children (bool, optional): include children of specified prim in calculation. Defaults to False.\n\nReturns:\n np.array: Bounding box for this prim, [min x, min y, min z, max x, max y, max z]", "snippet": "value = bounds_utils.compute_aabb(bbox_cache=bbox_cache, # pxr.UsdGeom.BBoxCache\n prim_path=prim_path, # str\n include_children=False) # bool\n" }, { "title": "compute_combined_aabb", "description": "Computes a combined AABB given a list of prim paths\n\nArgs:\n bbox_cache (UsdGeom.BboxCache): Existing Bounding box cache to use for computation\n prim_paths (typing.List[str]): List of prim paths to compute combined AABB for\n\nReturns:\n np.array: Bounding box for input prims, [min x, min y, min z, max x, max y, max z]", "snippet": "value = bounds_utils.compute_combined_aabb(bbox_cache=bbox_cache, # pxr.UsdGeom.BBoxCache\n prim_paths=prim_paths) # typing.List[str]\n" }, { "title": "create_bbox_cache", "description": "Helper function to create a Bounding Box Cache object that can be used for computations\n\nArgs:\n time (Usd.TimeCode, optional): time at which cache should be initialized. Defaults to Usd.TimeCode.Default().\n use_extents_hint (bool, optional): Use existing extents attribute on prim to compute bounding box. Defaults to True.\n\nReturns:\n UsdGeom.BboxCache: Initialized bbox cache", "snippet": "value = bounds_utils.create_bbox_cache(time=DEFAULT, # pxr.Usd.TimeCode\n use_extents_hint=True) # bool\n" }, { "title": "recompute_extents", "description": "Recomputes and overwrites the extents attribute for a UsdGeom.Boundable prim\n\nArgs:\n prim (UsdGeom.Boundable): Input prim to recompute extents for\n time (Usd.TimeCode, optional): timecode to use for computing extents. Defaults to Usd.TimeCode.Default().\n include_children (bool, optional): include children of specified prim in calculation. Defaults to False.\n\nRaises:\n ValueError: If prim is not of UsdGeom.Boundable type", "snippet": "bounds_utils.recompute_extents(prim=prim, # pxr.UsdGeom.Boundable\n time=DEFAULT, # pxr.Usd.TimeCode\n include_children=False) # bool\n" } ] }, { "title": "Carb", "snippets": [ { "title": "get_carb_setting", "description": "Convenience function to get settings.\n\nArgs:\n carb_settings (carb.settings.ISettings): The interface to carb setttings.\n setting (str): Name of setting to change.\n\nReturns:\n Any: Value for the setting.", "snippet": "value = carb_utils.get_carb_setting(carb_settings=carb_settings, # carb.settings._settings.ISettings\n setting=setting) # str\n" }, { "title": "set_carb_setting", "description": "Convenience to set the carb settings.\n\nArgs:\n carb_settings (carb.settings.ISettings): The interface to carb setttings.\n setting (str): Name of setting to change.\n value (Any): New value for the setting.\n\nRaises:\n TypeError: If the type of value does not match setting type.", "snippet": "carb_utils.set_carb_setting(carb_settings=carb_settings, # carb.settings._settings.ISettings\n setting=setting, # str\n value=value) # typing.Any\n" } ] }, { "title": "Collisions", "snippets": [ { "title": "ray_cast", "description": "Projects a raycast forward along x axis with specified offset\n\nIf a hit is found within the maximum distance, then the object's prim path and distance to it is returned.\nOtherwise, a None and 10000 is returned.\n\nArgs:\n position (np.array): origin's position for ray cast\n orientation (np.array): origin's orientation for ray cast\n offset (np.array): offset for ray cast\n max_dist (float, optional): maximum distance to test for collisions in stage units. Defaults to 100.0.\n\nReturns:\n typing.Tuple[typing.Union[None, str], float]: path to geometry that was hit and hit distance, returns None, 10000 if no hit occurred", "snippet": "value = collisions_utils.ray_cast(position=position, # numpy.array\n orientation=orientation, # numpy.array\n offset=offset, # numpy.array\n max_dist=100.0) # float\n" } ] }, { "title": "Constants", "snippets": [ { "title": "AXES_INDICES", "description": "Mapping from axis name to axis ID", "snippet": "AXES_INDICES\n" }, { "title": "AXES_TOKEN", "description": "Mapping from axis name to axis USD token", "snippet": "AXES_TOKEN\n" } ] }, { "title": "Distance Metrics", "snippets": [ { "title": "rotational_distance_angle", "description": "Computes the weighted distance between two rotations using inner product.\n\nNote:\n If r1 and r2 are GfMatrix3d() objects, the transformation matrices will be transposed in the distance\n calculations.\n\nArgs:\n r1 (typing.Union[np.ndarray, Gf.Matrix3d, Gf.Matrix4d]): rotation matrices or 4x4 transformation matrices\n r2 (typing.Union[np.ndarray, Gf.Matrix3d, Gf.Matrix4d]): rotation matrices or 4x4 transformation matrices\n\nReturns:\n np.ndarray: the magnitude of the angle of rotation from r1 to r2", "snippet": "value = distance_metrics_utils.rotational_distance_angle(r1=r1, # typing.Union[numpy.ndarray, pxr.Gf.Matrix3d, pxr.Gf.Matrix4d]\n r2=r2) # typing.Union[numpy.ndarray, pxr.Gf.Matrix3d, pxr.Gf.Matrix4d]\n" }, { "title": "rotational_distance_identity_matrix_deviation", "description": "Computes the distance between two rotations using deviation from indentity matrix.\n\nNote:\n If r1 and r2 are GfMatrix3d() objects, the transformation matrices will be transposed in the distance\n calculations.\n\nArgs:\n r1 (typing.Union[np.ndarray, Gf.Matrix4d, Gf.Matrix3d]): rotation matrices or 4x4 transformation matrices\n r2 (typing.Union[np.ndarray, Gf.Matrix4d, Gf.Matrix3d]): rotation matrices or 4x4 transformation matrices\n\nReturns:\n np.ndarray: the Frobenius norm \\|I-r1*r2^T\\|, where I is the identity matrix", "snippet": "value = distance_metrics_utils.rotational_distance_identity_matrix_deviation(r1=r1, # typing.Union[numpy.ndarray, pxr.Gf.Matrix4d, pxr.Gf.Matrix3d]\n r2=r2) # typing.Union[numpy.ndarray, pxr.Gf.Matrix4d, pxr.Gf.Matrix3d]\n" }, { "title": "rotational_distance_single_axis", "description": "Computes the distance between two rotations w.r.t. input axis.\n\nNote:\n If r1 and r2 are GfMatrix3d() objects, the transformation matrices will be transposed in the distance\n calculations.\n\nUsage:\n If the robot were holding a cup aligned with its z-axis,\n it would be important to align the z-axis of the robot with\n the z-axis of the world frame. This could be accomplished by\n letting\n\n | -r1 be the rotation of the robot end effector\n | -r2 be any rotation matrix for a rotation about the z axis\n | -axis = [0,0,1]\n\nArgs:\n r1 (typing.Union[np.ndarray, Gf.Matrix4d, Gf.Matrix3d]): rotation matrices or 4x4 transformation matrices\n r2 (typing.Union[np.ndarray, Gf.Matrix4d, Gf.Matrix3d]): rotation matrices or 4x4 transformation matrices\n axis (np.ndarray): a 3d vector that will be rotated by r1 and r2\n\nReturns:\n np.ndarray: the angle between (r1 @ axis) and (r2 @ axis)", "snippet": "value = distance_metrics_utils.rotational_distance_single_axis(r1=r1, # typing.Union[numpy.ndarray, pxr.Gf.Matrix4d, pxr.Gf.Matrix3d]\n r2=r2, # typing.Union[numpy.ndarray, pxr.Gf.Matrix4d, pxr.Gf.Matrix3d]\n axis=axis) # numpy.ndarray\n" }, { "title": "weighted_translational_distance", "description": "Computes the weighted distance between two translation vectors.\n\nThe distance calculation has the form sqrt(x.T W x), where\n\n| - x is the vector difference between t1 and t2.\n| - W is a weight matrix.\n\nGiven the identity weight matrix, this is equivalent to the \\|t1-t2\\|.\n\nUsage:\n This formulation can be used to weight an arbitrary axis of the translation difference.\n Letting x = t1-t2 = a1*b1 + a2*b2 + a3*b3 (where b1,b2,b3 are column basis vectors, and a1,a2,a3 are constants),\n When W = I: x.T W x = sqrt(a1^2 + a2^2 + a3^2).\n To weight the b1 axis by 2, let W take the form (R.T @ ([4,1,1]@I) @ R) where:\n\n | - I is the identity matrix.\n | - R is a rotation matrix of the form [b1,b2,b3].T\n\n This is effectively equivalent to \\|[2*e1,e2,e3] @ [b1,b2,b3].T @ x\\| = sqrt(4*a1^2 + a2^2 + a3^2).\n\n | - e1,e2,e3 are the elementary basis vectors.\n\nArgs:\n t1 (typing.Union[np.ndarray, Gf.Matrix4d]): 3d translation vectors or 4x4 transformation matrices\n t2 (typing.Union[np.ndarray, Gf.Matrix4d]): 3d translation vectors or 4x4 transformation matrices\n weight_matrix (np.ndarray, optional): a 3x3 positive semidefinite matrix of weights. Defaults to np.eye(3).\n\nReturns:\n np.ndarray: the weighted norm of the difference (t1-t2)", "snippet": "value = distance_metrics_utils.weighted_translational_distance(t1=t1, # typing.Union[numpy.ndarray, pxr.Gf.Matrix4d]\n t2=t2, # typing.Union[numpy.ndarray, pxr.Gf.Matrix4d]\n weight_matrix=[[1. 0. 0.]\n [0. 1. 0.]\n [0. 0. 1.]]) # numpy.ndarray\n" } ] }, { "title": "Extensions", "snippets": [ { "title": "disable_extension", "description": "Unload an extension.\n\nArgs:\n extension_name (str): name of the extension\n\nReturns:\n bool: True if extension could be unloaded, False otherwise", "snippet": "value = extensions_utils.disable_extension(extension_name=extension_name) # str\n" }, { "title": "enable_extension", "description": "Load an extension from the extenstion manager.\n\nArgs:\n extension_name (str): name of the extension\n\nReturns:\n bool: True if extension could be loaded, False otherwise", "snippet": "value = extensions_utils.enable_extension(extension_name=extension_name) # str\n" }, { "title": "get_extension_id", "description": "Get extension id for a loaded extension\n\nArgs:\n extension_name (str): name of the extension\n\nReturns:\n int: Full extension id", "snippet": "value = extensions_utils.get_extension_id(extension_name=extension_name) # str\n" }, { "title": "get_extension_path", "description": "Get extension path for a loaded extension\n\nArgs:\n ext_id (id): full id of extension\n\nReturns:\n str: Path to loaded extension root directory", "snippet": "value = extensions_utils.get_extension_path(ext_id=ext_id) # int\n" }, { "title": "get_extension_path_from_name", "description": "Get extension path for a loaded extension\n\nArgs:\n extension_name (str): name of the extension\n\nReturns:\n str: Path to loaded extension root directory", "snippet": "value = extensions_utils.get_extension_path_from_name(extension_name=extension_name) # str\n" } ] }, { "title": "Math", "snippets": [ { "title": "cross", "description": "Computes the cross-product between two 3-dimensional vectors.\n\nArgs:\n a (np.ndarray, list): A 3-dimensional vector\n b (np.ndarray, list): A 3-dimensional vector\n\nReturns:\n np.ndarray: Cross product between input vectors.", "snippet": "value = math_utils.cross(a=a, # typing.Union[numpy.ndarray, list]\n b=b) # typing.Union[numpy.ndarray, list]\n" }, { "title": "normalize", "description": " Normalizes the vector inline (and also returns it). ", "snippet": "math_utils.normalize(v=v)\n" }, { "title": "normalized", "description": " Returns a normalized copy of the provided vector. ", "snippet": "math_utils.normalized(v=v)\n" }, { "title": "radians_to_degrees", "description": "Converts input angles from radians to degrees.\n\nArgs:\n rad_angles (np.ndarray): Input array of angles (in radians).\n\nReturns:\n np.ndarray: Array of angles in degrees.", "snippet": "value = math_utils.radians_to_degrees(rad_angles=rad_angles) # numpy.ndarray\n" } ] }, { "title": "Mesh", "snippets": [ { "title": "get_mesh_vertices_relative_to", "description": "Get vertices of the mesh prim in the coordinate system of the given prim.\n\nArgs:\n mesh_prim (UsdGeom.Mesh): mesh prim to get the vertice points.\n coord_prim (Usd.Prim): prim used as relative coordinate.\n\nReturns:\n np.ndarray: vertices of the mesh in the coordinate system of the given prim. Shape is (N, 3).", "snippet": "value = mesh_utils.get_mesh_vertices_relative_to(mesh_prim=mesh_prim, # pxr.UsdGeom.Mesh\n coord_prim=coord_prim) # pxr.Usd.Prim\n" } ] }, { "title": "Nucleus", "snippets": [ { "title": "build_server_list", "description": "Return list with all known servers to check\n\nReturns:\n all_servers (typing.List): List of servers found", "snippet": "value = nucleus_utils.build_server_list()\n" }, { "title": "check_server", "description": "Check a specific server for a path\n\nArgs:\n server (str): Name of Nucleus server\n path (str): Path to search\n\nReturns:\n bool: True if folder is found", "snippet": "value = nucleus_utils.check_server(server=server, # str\n path=path) # str\n" }, { "title": "check_server_async", "description": "Check a specific server for a path (asynchronous version).\n\nArgs:\n server (str): Name of Nucleus server\n path (str): Path to search\n\nReturns:\n bool: True if folder is found", "snippet": "value = nucleus_utils.check_server_async(server=server, # str\n path=path) # str\n" }, { "title": "create_folder", "description": "Create a folder on server\n\nArgs:\n server (str): Name of Nucleus server\n path (str): Path to folder\n\nReturns:\n bool: True if folder is created successfully", "snippet": "value = nucleus_utils.create_folder(server=server, # str\n path=path) # str\n" }, { "title": "delete_folder", "description": "Remove folder and all of its contents\n\nArgs:\n server (str): Name of Nucleus server\n path (str): Path to folder\n\nReturns:\n bool: True if folder is deleted successfully", "snippet": "value = nucleus_utils.delete_folder(server=server, # str\n path=path) # str\n" }, { "title": "download_assets_async", "description": "Download assets from S3 bucket\n\nArgs:\n src (str): URL of S3 bucket as source\n dst (str): URL of Nucleus server to copy assets to\n progress_callback: Callback function to keep track of progress of copy\n concurrency (int): Number of concurrent copy operations. Default value: 3\n copy_behaviour (omni.client._omniclient.CopyBehavior): Behavior if the destination exists. Default value: OVERWRITE\n copy_after_delete (bool): True if destination needs to be deleted before a copy. Default value: True\n timeout (float): Default value: 300 seconds\n\nReturns:\n Result (omni.client._omniclient.Result): Result of copy", "snippet": "value = nucleus_utils.download_assets_async(src=src, # str\n dst=dst, # str\n progress_callback=progress_callback,\n concurrency=10, # int\n copy_behaviour=CopyBehavior.OVERWRITE, # omni.client.CopyBehavior\n copy_after_delete=True, # bool\n timeout=300.0) # float\n" }, { "title": "find_nucleus_server", "description": "Attempts to determine best Nucleus server to use based on existing mountedDrives setting and the\ndefault server specified in json config at \"/persistent/isaac/asset_root/\". Call is blocking\n\nArgs:\n suffix (str): Path to folder to search for. Default value: /Isaac\n\nReturns:\n bool: True if Nucleus server with suffix is found\n url (str): URL of found Nucleus", "snippet": "value = nucleus_utils.find_nucleus_server(suffix=suffix) # str\n" }, { "title": "get_assets_root_path", "description": "Tries to find the root path to the Isaac Sim assets on a Nucleus server\n\nReturns:\n url (str): URL of Nucleus server with root path to assets folder.\n Returns None if Nucleus server not found.", "snippet": "value = nucleus_utils.get_assets_root_path()\n" }, { "title": "get_assets_server", "description": "Tries to find a server with the Isaac Sim assets\n\nReturns:\n url (str): URL of Nucleus server with the Isaac Sim assets\n Returns None if Nucleus server not found.", "snippet": "value = nucleus_utils.get_assets_server()\n" }, { "title": "get_full_asset_path", "description": "Tries to find the full asset path on connected servers\n\nArgs:\n path (str): Path of asset from root to verify\n\nReturns:\n url (str): URL or full path to assets.\n Returns None if assets not found.", "snippet": "value = nucleus_utils.get_full_asset_path(path=path) # str\n" }, { "title": "get_isaac_asset_root_path", "description": "Tries to find the root path to the Isaac Sim assets\n\nReturns:\n url (str): URL or root path to Isaac Sim assets folder.\n Returns None if Isaac Sim assets not found.", "snippet": "value = nucleus_utils.get_isaac_asset_root_path()\n" }, { "title": "get_nvidia_asset_root_path", "description": "Tries to find the root path to the NVIDIA assets\n\nReturns:\n url (str): URL or root path to NVIDIA assets folder.\n Returns None if NVIDIA assets not found.", "snippet": "value = nucleus_utils.get_nvidia_asset_root_path()\n" }, { "title": "get_server_path", "description": "Tries to find a Nucleus server with specific path\n\nArgs:\n suffix (str): Path to folder to search for.\n\nReturns:\n url (str): URL of Nucleus server with path to folder.\n Returns None if Nucleus server not found.", "snippet": "value = nucleus_utils.get_server_path(suffix=\"\") # str\n" }, { "title": "get_url_root", "description": "Get root from URL or path\nArgs:\n url (str): full http or omniverse path\n\nReturns:\n str: Root path or URL or Nucleus server", "snippet": "value = nucleus_utils.get_url_root(url=url) # str\n" }, { "title": "is_dir_async", "description": "Check if path is a folder\n\nArgs:\n path (str): Path to folder\n\nReturns:\n bool: True if path is a folder", "snippet": "value = nucleus_utils.is_dir_async(path=path) # str\n" }, { "title": "is_file", "description": "Check if path is a file\n\nArgs:\n path (str): Path to file\n\nReturns:\n bool: True if path is a file", "snippet": "value = nucleus_utils.is_file(path=path) # str\n" }, { "title": "is_file_async", "description": "Check if path is a file\n\nArgs:\n path (str): Path to file\n\nReturns:\n bool: True if path is a file", "snippet": "value = nucleus_utils.is_file_async(path=path) # str\n" }, { "title": "list_folder", "description": "List files and sub-folders from root path\n\nArgs:\n path (str): Path to root folder\n\nRaises:\n Exception: When unable to find files under the path.\n\nReturns:\n files (typing.List): List of path to each file\n dirs (typing.List): List of path to each sub-folder", "snippet": "value = nucleus_utils.list_folder(path=path) # str\n" }, { "title": "recursive_list_folder", "description": "Recursively list all files\n\nArgs:\n path (str): Path to folder\n\nReturns:\n paths (typing.List): List of path to each file", "snippet": "value = nucleus_utils.recursive_list_folder(path=path) # str\n" }, { "title": "verify_asset_root_path", "description": "Attempts to determine Isaac assets version and check if there are updates.\n(asynchronous version)\n\nArgs:\n path (str): URL or path of asset root to verify\n\nReturns:\n omni.client.Result: OK if Assets verified\n ver (str): Version of Isaac Sim assets", "snippet": "value = nucleus_utils.verify_asset_root_path(path=path) # str\n" } ] }, { "title": "Numpy", "snippets": [ { "title": "as_type", "description": "", "snippet": "numpy_utils.as_type(data=data,\n dtype=dtype)\n" }, { "title": "clone_tensor", "description": "", "snippet": "numpy_utils.clone_tensor(data=data,\n device=None)\n" }, { "title": "convert", "description": "", "snippet": "numpy_utils.convert(data=data,\n device=None)\n" }, { "title": "cos", "description": "", "snippet": "numpy_utils.cos(data=data)\n" }, { "title": "create_tensor_from_list", "description": "", "snippet": "numpy_utils.create_tensor_from_list(data=data,\n dtype=dtype,\n device=None)\n" }, { "title": "create_zeros_tensor", "description": "", "snippet": "numpy_utils.create_zeros_tensor(shape=shape,\n dtype=dtype,\n device=None)\n" }, { "title": "deg2rad", "description": "_summary_\n\nArgs:\n degree_value (np.ndarray): _description_\n device (_type_, optional): _description_. Defaults to None.\n\nReturns:\n np.ndarray: _description_", "snippet": "value = numpy_utils.deg2rad(degree_value=degree_value, # numpy.ndarray\n device=None)\n" }, { "title": "euler_angles_to_quats", "description": "Vectorized version of converting euler angles to quaternion (scalar first)\n\nArgs:\n euler_angles np.ndarray: euler angles with shape (N, 3) or (3,) representation XYZ in extrinsic coordinates\n degrees (bool, optional): True if degrees, False if radians. Defaults to False.\n\nReturns:\n np.ndarray: quaternions representation of the angles (N, 4) or (4,) - scalar first.", "snippet": "value = numpy_utils.euler_angles_to_quats(euler_angles=euler_angles, # numpy.ndarray\n degrees=False, # bool\n device=None)\n" }, { "title": "expand_dims", "description": "", "snippet": "numpy_utils.expand_dims(data=data,\n axis=axis)\n" }, { "title": "get_local_from_world", "description": "", "snippet": "numpy_utils.get_local_from_world(parent_transforms=parent_transforms,\n positions=positions,\n orientations=orientations,\n device=None)\n" }, { "title": "get_pose", "description": "", "snippet": "numpy_utils.get_pose(positions=positions,\n orientations=orientations,\n device=None)\n" }, { "title": "get_world_from_local", "description": "", "snippet": "numpy_utils.get_world_from_local(parent_transforms=parent_transforms,\n translations=translations,\n orientations=orientations,\n device=None)\n" }, { "title": "gf_quat_to_tensor", "description": "Converts a pxr Quaternion type to a numpy array following [w, x, y, z] convention.\n\nArgs:\n orientation (typing.Union[Gf.Quatd, Gf.Quatf, Gf.Quaternion]): [description]\n\nReturns:\n np.ndarray: [description]", "snippet": "value = numpy_utils.gf_quat_to_tensor(orientation=orientation, # typing.Union[pxr.Gf.Quatd, pxr.Gf.Quatf, pxr.Gf.Quaternion]\n device=None)\n" }, { "title": "inverse", "description": "", "snippet": "numpy_utils.inverse(data=data)\n" }, { "title": "matmul", "description": "", "snippet": "numpy_utils.matmul(matrix_a=matrix_a,\n matrix_b=matrix_b)\n" }, { "title": "move_data", "description": "", "snippet": "numpy_utils.move_data(data=data,\n device=None)\n" }, { "title": "pad", "description": "", "snippet": "numpy_utils.pad(data=data,\n pad_width=pad_width,\n mode=\"constant\",\n value=None)\n" }, { "title": "quats_to_euler_angles", "description": "Vectorized version of converting quaternions (scalar first) to euler angles\n\nArgs:\n quaternions (np.ndarray): quaternions with shape (N, 4) or (4,) - scalar first\n degrees (bool, optional): Return euler angles in degrees if True, radians if False. Defaults to False.\n\nReturns:\n np.ndarray: Euler angles in extrinsic coordinates XYZ order with shape (N, 3) or (3,) corresponding to the quaternion rotations", "snippet": "value = numpy_utils.quats_to_euler_angles(quaternions=quaternions, # numpy.ndarray\n degrees=False, # bool\n device=None)\n" }, { "title": "quats_to_rot_matrices", "description": "Vectorized version of converting quaternions to rotation matrices\n\nArgs:\n quaternions (np.ndarray): quaternions with shape (N, 4) or (4,) and scalar first\n\nReturns:\n np.ndarray: N Rotation matrices with shape (N, 3, 3) or (3, 3)", "snippet": "value = numpy_utils.quats_to_rot_matrices(quaternions=quaternions, # numpy.ndarray\n device=None)\n" }, { "title": "quats_to_rotvecs", "description": "Vectorized version of converting quaternions to rotation vectors\n\nArgs:\n quaternions (np.ndarray): quaternions with shape (N, 4) or (4,) and scalar first\n\nReturns:\n np.ndarray: N rotation vectors with shape (N,3) or (3,). The magnitude of the rotation vector describes the magnitude of the rotation.\n The normalized rotation vector represents the axis of rotation.", "snippet": "value = numpy_utils.quats_to_rotvecs(quaternions=quaternions, # numpy.ndarray\n device=None)\n" }, { "title": "rad2deg", "description": "_summary_\n\nArgs:\n radian_value (np.ndarray): _description_\n device (_type_, optional): _description_. Defaults to None.\n\nReturns:\n np.ndarray: _description_", "snippet": "value = numpy_utils.rad2deg(radian_value=radian_value, # numpy.ndarray\n device=None)\n" }, { "title": "resolve_indices", "description": "", "snippet": "numpy_utils.resolve_indices(indices=indices,\n count=count,\n device=None)\n" }, { "title": "rot_matrices_to_quats", "description": "Vectorized version of converting rotation matrices to quaternions\n\nArgs:\n rotation_matrices (np.ndarray): N Rotation matrices with shape (N, 3, 3) or (3, 3)\n\nReturns:\n np.ndarray: quaternion representation of the rotation matrices (N, 4) or (4,) - scalar first", "snippet": "value = numpy_utils.rot_matrices_to_quats(rotation_matrices=rotation_matrices, # numpy.ndarray\n device=None)\n" }, { "title": "rotvecs_to_quats", "description": "Vectorized version of converting rotation vectors to quaternions\n\nArgs:\n rotation_vectors (np.ndarray): N rotation vectors with shape (N, 3) or (3,). The magnitude of the rotation vector describes the magnitude of the rotation.\n The normalized rotation vector represents the axis of rotation.\n degrees (bool): The magnitude of the rotation vector will be interpretted as degrees if True, and radians if False. Defaults to False.\n\nReturns:\n np.ndarray: quaternion representation of the rotation matrices (N, 4) or (4,) - scalar first", "snippet": "value = numpy_utils.rotvecs_to_quats(rotation_vectors=rotation_vectors, # numpy.ndarray\n degrees=False, # bool\n device=None)\n" }, { "title": "sin", "description": "", "snippet": "numpy_utils.sin(data=data)\n" }, { "title": "tensor_cat", "description": "", "snippet": "numpy_utils.tensor_cat(data=data,\n dim=-1)\n" }, { "title": "tensor_stack", "description": "", "snippet": "numpy_utils.tensor_stack(data=data,\n dim=0)\n" }, { "title": "tf_matrices_from_poses", "description": "[summary]\n\nArgs:\n translations (Union[np.ndarray, torch.Tensor]): translations with shape (N, 3).\n orientations (Union[np.ndarray, torch.Tensor]): quaternion representation (scalar first) with shape (N, 4).\n\nReturns:\n Union[np.ndarray, torch.Tensor]: transformation matrices with shape (N, 4, 4)", "snippet": "value = numpy_utils.tf_matrices_from_poses(translations=translations, # numpy.ndarray\n orientations=orientations, # numpy.ndarray\n device=None)\n" }, { "title": "transpose_2d", "description": "", "snippet": "numpy_utils.transpose_2d(data=data)\n" } ] }, { "title": "Physics", "snippets": [ { "title": "get_rigid_body_enabled", "description": "Get the physics:rigidBodyEnabled attribute from the USD Prim at the given path\n\nArgs:\n prim_path (str): The path to the USD Prim\n\nReturns:\n Any: The value of physics:rigidBodyEnabled attribute if it exists, and None if it does not exist.", "snippet": "value = physics_utils.get_rigid_body_enabled(prim_path=prim_path) # str\n" }, { "title": "set_rigid_body_enabled", "description": "If it exists, set the physics:rigidBodyEnabled attribute on the USD Prim at the given path\n\nArgs:\n _value (Any): Value to set physics:rigidBodyEnabled attribute to\n prim_path (str): The path to the USD Prim", "snippet": "physics_utils.set_rigid_body_enabled(_value=_value,\n prim_path=prim_path)\n" }, { "title": "simulate_async", "description": "Helper function to simulate async for seconds * steps_per_sec frames.\n\nArgs:\n seconds (float): time in seconds to simulate for\n steps_per_sec (int, optional): steps per second. Defaults to 60.\n callback (Callable, optional): optional function to run every step. Defaults to None.", "snippet": "physics_utils.simulate_async(seconds=seconds, # float\n steps_per_sec=60, # int\n callback=None) # typing.Callable\n" } ] }, { "title": "Prims", "snippets": [ { "title": "create_prim", "description": "Create a prim into current USD stage.\n\nThe method applies specified transforms, the semantic label and set specified attributes.\n\nArgs:\n prim_path (str): The path of the new prim.\n prim_type (str): Prim type name\n position (typing.Sequence[float], optional): prim position (applied last)\n translation (typing.Sequence[float], optional): prim translation (applied last)\n orientation (typing.Sequence[float], optional): prim rotation as quaternion\n scale (np.ndarray (3), optional): scaling factor in x, y, z.\n usd_path (str, optional): Path to the USD that this prim will reference.\n semantic_label (str, optional): Semantic label.\n semantic_type (str, optional): set to \"class\" unless otherwise specified.\n attributes (dict, optional): Key-value pairs of prim attributes to set.\n\nRaises:\n Exception: If there is already a prim at the prim_path\n\nReturns:\n Usd.Prim: The created USD prim.", "snippet": "value = prims_utils.create_prim(prim_path=prim_path, # str\n prim_type=\"Xform\", # str\n position=None, # typing.Union[typing.Sequence[float], NoneType]\n translation=None, # typing.Union[typing.Sequence[float], NoneType]\n orientation=None, # typing.Union[typing.Sequence[float], NoneType]\n scale=None, # typing.Union[typing.Sequence[float], NoneType]\n usd_path=None, # typing.Union[str, NoneType]\n semantic_label=None, # typing.Union[str, NoneType]\n semantic_type=\"class\", # str\n attributes=None) # typing.Union[dict, NoneType]\n" }, { "title": "define_prim", "description": "Create a USD Prim at the given prim_path of type prim_type unless one already exists\n\nArgs:\n prim_path (str): path of the prim in the stage\n prim_type (str, optional): The type of the prim to create. Defaults to \"Xform\".\n\nRaises:\n Exception: If there is already a prim at the prim_path\n\nReturns:\n Usd.Prim: The created USD prim.", "snippet": "value = prims_utils.define_prim(prim_path=prim_path, # str\n prim_type=\"Xform\") # str\n" }, { "title": "delete_prim", "description": "Remove the USD Prim and its decendants from the scene if able\n\nArgs:\n prim_path (str): path of the prim in the stage", "snippet": "prims_utils.delete_prim(prim_path=prim_path) # str\n" }, { "title": "find_matching_prim_paths", "description": "Find all the matching prim paths in the stage based on Regex expression.\n\nArgs:\n prim_path_regex (str): The Regex expression for prim path.\n\nReturns:\n typing.List[str]: List of prim paths that match input expression.", "snippet": "value = prims_utils.find_matching_prim_paths(prim_path_regex=prim_path_regex) # str\n" }, { "title": "get_all_matching_child_prims", "description": "Performs a breadth-first search starting from the root and returns all the prims matching the predicate.\n\nArgs:\n prim_path (str): root prim path to start traversal from.\n predicate (typing.Callable[[str], bool]): predicate that checks the prim path of a prim and returns a boolean.\n depth (typing.Optional[int]): maximum depth for traversal, should be bigger than zero if specified.\n Defaults to None (i.e: traversal till the end of the tree).\n\nReturns:\n typing.List[Usd.Prim]: A list containing the root and children prims matching specified predicate.", "snippet": "value = prims_utils.get_all_matching_child_prims(prim_path=prim_path, # str\n predicate=<function <lambda> at 0x7ef4b8070050>, # typing.Callable[[str], bool]\n depth=None) # typing.Union[int, NoneType]\n" }, { "title": "get_first_matching_child_prim", "description": "Recursively get the first USD Prim at the path string that passes the predicate function\n\nArgs:\n prim_path (str): path of the prim in the stage\n predicate (typing.Callable[[str], bool]): Function to test the prims against\n\nReturns:\n Usd.Prim: The first prim or child of the prim, as defined by GetChildren, that passes the predicate", "snippet": "value = prims_utils.get_first_matching_child_prim(prim_path=prim_path, # str\n predicate=predicate) # typing.Callable[[str], bool]\n" }, { "title": "get_first_matching_parent_prim", "description": "Recursively get the first USD Prim at the parent path string that passes the predicate function\n\nArgs:\n prim_path (str): path of the prim in the stage\n predicate (typing.Callable[[str], bool]): Function to test the prims against\n\nReturns:\n str: The first prim on the parent path, as defined by GetParent, that passes the predicate", "snippet": "value = prims_utils.get_first_matching_parent_prim(prim_path=prim_path, # str\n predicate=predicate) # typing.Callable[[str], bool]\n" }, { "title": "get_prim_at_path", "description": "Get the USD Prim at a given path string\n\nArgs:\n prim_path (str): path of the prim in the stage\n\nReturns:\n Usd.Prim: USD Prim object at the given path in the current stage", "snippet": "value = prims_utils.get_prim_at_path(prim_path=prim_path) # str\n" }, { "title": "get_prim_children", "description": "Return the call of the USD Prim's GetChildren member function\n\nArgs:\n prim (Usd.Prim): The parent USD Prim\n\nReturns:\n typing.List[Usd.Prim]: A list of the prim's children.", "snippet": "value = prims_utils.get_prim_children(prim=prim) # pxr.Usd.Prim\n" }, { "title": "get_prim_object_type", "description": "Get the dynamic control Ooject type of the USD Prim at the given path.\n\nIf the prim at the path is of Dynamic Control type--i.e. rigid_body, joint, dof, articulation, attractor, d6joint,\nthen the correspodning string returned. If is an Xformable prim, then \"xform\" is returned. Otherwise None\nis returned.\n\nArgs:\n prim_path (str): path of the prim in the stage\n\nRaises:\n Exception: If the USD Prim is not a suppored type.\n\nReturns:\n str: String corresponding to the object type.", "snippet": "value = prims_utils.get_prim_object_type(prim_path=prim_path) # str\n" }, { "title": "get_prim_parent", "description": "Return the call of the USD Prim's GetChildren member function\n\nArgs:\n prim (Usd.Prim): The USD Prim to call GetParent on\n\nReturns:\n Usd.Prim: The prim's parent returned from GetParent", "snippet": "value = prims_utils.get_prim_parent(prim=prim) # pxr.Usd.Prim\n" }, { "title": "get_prim_path", "description": "Get the path of a given USD prim.\n\nArgs:\n prim (Usd.Prim): The input USD prim.\n\nReturns:\n str: The path to the input prim.", "snippet": "value = prims_utils.get_prim_path(prim=prim) # pxr.Usd.Prim\n" }, { "title": "get_prim_property", "description": "Get the attribute of the USD Prim at the given path\n\nArgs:\n prim_path (str): path of the prim in the stage\n property_name (str): name of the attribute to get\n\nReturns:\n typing.Any: The attribute if it exists, None otherwise", "snippet": "value = prims_utils.get_prim_property(prim_path=prim_path, # str\n property_name=property_name) # str\n" }, { "title": "get_prim_type_name", "description": "Get the TypeName of the USD Prim at the path if it is valid\n\nArgs:\n prim_path (str): path of the prim in the stage\n\nRaises:\n Exception: If there is not a valid prim at the given path\n\nReturns:\n str: The TypeName of the USD Prim at the path string", "snippet": "value = prims_utils.get_prim_type_name(prim_path=prim_path) # str\n" }, { "title": "is_prim_ancestral", "description": "Check if any of the prims ancestors were brought in as a reference\n\nArgs:\n prim_path (str): The path to the USD prim.\n\nReturns:\n True if prim is part of a referenced prim, false otherwise.", "snippet": "value = prims_utils.is_prim_ancestral(prim_path=prim_path) # str\n" }, { "title": "is_prim_hidden_in_stage", "description": "Checks if the prim is hidden in the USd stage or not.\n\nArgs:\n prim_path (str): The path to the USD prim.\n\nNote:\n This is not related to the prim visibility.\n\nReturns:\n True if prim is hidden from stage window, False if not hidden.", "snippet": "value = prims_utils.is_prim_hidden_in_stage(prim_path=prim_path) # str\n" }, { "title": "is_prim_no_delete", "description": "Checks whether a prim can be deleted or not from USD stage.\n\nArgs:\n prim_path (str): The path to the USD prim.\n\nReturns:\n True if prim cannot be deleted, False if it can", "snippet": "value = prims_utils.is_prim_no_delete(prim_path=prim_path) # str\n" }, { "title": "is_prim_non_root_articulation_link", "description": "Used to query if the prim_path corresponds to a link in an articulation which is a non root link.\n\nArgs:\n prim_path (str): prim_path to query\n\nReturns:\n bool: True if the prim path corresponds to a link in an articulation which is a non root link\n and can't have a transformation applied to it.", "snippet": "value = prims_utils.is_prim_non_root_articulation_link(prim_path=prim_path) # str\n" }, { "title": "is_prim_path_valid", "description": "Check if a path has a valid USD Prim at it\n\nArgs:\n prim_path (str): path of the prim in the stage\n\nReturns:\n bool: True if the path points to a valid prim", "snippet": "value = prims_utils.is_prim_path_valid(prim_path=prim_path) # str\n" }, { "title": "is_prim_root_path", "description": "Checks if the input prim path is root or not.\n\nArgs:\n prim_path (str): The path to the USD prim.\n\nReturns:\n True if the prim path is \"/\", False otherwise", "snippet": "value = prims_utils.is_prim_root_path(prim_path=prim_path) # str\n" }, { "title": "move_prim", "description": "Run the Move command to change a prims USD Path in the stage\n\nArgs:\n path_from (str): Path of the USD Prim you wish to move\n path_to (str): Final destination of the prim", "snippet": "prims_utils.move_prim(path_from=path_from, # str\n path_to=path_to) # str\n" }, { "title": "query_parent_path", "description": "Check if one of the ancestors of the prim at the prim_path can pass the predicate\n\nArgs:\n prim_path (str): path to the USD Prim for which to check the ancestors\n predicate (typing.Callable[[str], bool]): The condition that must be True about the ancestors\n\nReturns:\n bool: True if there is an ancestor that can pass the predicate, False otherwise", "snippet": "value = prims_utils.query_parent_path(prim_path=prim_path, # str\n predicate=predicate) # typing.Callable[[str], bool]\n" }, { "title": "set_prim_hide_in_stage_window", "description": "set hide_in_stage_window metadata for prim\n\nArgs:\n prim (Usd.Prim): Prim to set\n hide (bool): True to hide in stage window, false to show", "snippet": "prims_utils.set_prim_hide_in_stage_window(prim=prim, # pxr.Usd.Prim\n hide=hide) # bool\n" }, { "title": "set_prim_no_delete", "description": "set no_delete metadata for prim\n\nArgs:\n prim (Usd.Prim): Prim to set\n no_delete (bool):True to make prim undeletable in stage window, false to allow deletion", "snippet": "prims_utils.set_prim_no_delete(prim=prim, # pxr.Usd.Prim\n no_delete=no_delete) # bool\n" }, { "title": "set_prim_property", "description": "Set the attribute of the USD Prim at the path\n\nArgs:\n prim_path (str): path of the prim in the stage\n property_name (str): name of the attribute to set\n property_value (typing.Any): value to set the attribute to", "snippet": "prims_utils.set_prim_property(prim_path=prim_path, # str\n property_name=property_name, # str\n property_value=property_value) # typing.Any\n" }, { "title": "set_prim_visibility", "description": "Sets the visibility of the prim in the opened stage.\n\nThe method does this through the USD API.\n\nArgs:\n prim (Usd.Prim): the USD prim\n visible (bool): flag to set the visibility of the usd prim in stage.", "snippet": "prims_utils.set_prim_visibility(prim=prim, # pxr.Usd.Prim\n visible=visible) # bool\n" }, { "title": "set_targets", "description": "Set targets for a prim relationship attribute\n\nArgs:\n prim (Usd.Prim): Prim to create and set attribute on\n attribute (str): Relationship attribute to create\n target_prim_paths (list): list of targets to set", "snippet": "prims_utils.set_targets(prim=prim, # pxr.Usd.Prim\n attribute=attribute, # str\n target_prim_paths=target_prim_paths) # list\n" } ] }, { "title": "Random", "snippets": [ { "title": "get_random_translation_from_camera", "description": "Get a random translation from the camera, in the camera's frame, that's in view of the camera.\n\nArgs:\n min_distance (float): minimum distance away from the camera (along the optical axis) of the random\n translation.\n max_distance (float): maximum distance away from the camera (along the optical axis) of the random\n translation.\n fov_x (float): field of view of the camera in the x-direction in radians.\n fov_y (float): field of view of the camera in the y-direction in radians.\n fraction_to_screen_edge (float): maximum allowed fraction to the edge of the screen the translated point may\n appear when viewed from the camera. A value of 0 corresponds to the\n translated point being centered in the camera's view (on the optical axis),\n whereas a value of 1 corresponds to the translated point being on the edge\n of the screen in the camera's view.\n\nReturns:\n np.ndarray: random translation from the camera, in the camera's frame, that's in view of the camera. Shape\n is (3, ).", "snippet": "value = random_utils.get_random_translation_from_camera(min_distance=min_distance, # float\n max_distance=max_distance, # float\n fov_x=fov_x, # float\n fov_y=fov_y, # float\n fraction_to_screen_edge=fraction_to_screen_edge) # float\n" }, { "title": "get_random_values_in_range", "description": "Get an array of random values where each element is between the corresponding min_range and max_range element.\n\nArgs:\n min_range (np.ndarray): minimum values for each corresponding element of the array of random values. Shape is\n (num_values, ).\n max_range (np.ndarray): maximum values for each corresponding element of the array of random values. Shape is\n (num_values, ).\n\nReturns:\n np.ndarray: array of random values. Shape is (num_values, ).", "snippet": "value = random_utils.get_random_values_in_range(min_range=min_range, # numpy.ndarray\n max_range=max_range) # numpy.ndarray\n" }, { "title": "get_random_world_pose_in_view", "description": "Get a pose defined in the world frame that's in view of the camera.\n\nArgs:\n camera_prim (Usd.Prim): prim path of the camera.\n min_distance (float): minimum distance away from the camera (along the optical axis) of the random\n translation.\n max_distance (float): maximum distance away from the camera (along the optical axis) of the random\n translation.\n fov_x (float): field of view of the camera in the x-direction in radians.\n fov_y (float): field of view of the camera in the y-direction in radians.\n fraction_to_screen_edge (float): maximum allowed fraction to the edge of the screen the translated point may\n appear when viewed from the camera. A value of 0 corresponds to the\n translated point being centered in the camera's view (on the optical axis),\n whereas a value of 1 corresponds to the translated point being on the edge\n of the screen in the camera's view.\n coord_prim (Usd.Prim): prim whose frame the orientation is defined with respect to.\n min_rotation_range (np.ndarray): minimum XYZ Euler angles of the random pose, defined with respect to the\n frame of the prim at coord_prim. Shape is (3, ).\n max_rotation_range (np.ndarray): maximum XYZ Euler angles of the random pose, defined with respect to the\n frame of the prim at coord_prim.\n\nReturns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame. Shape is (3, ). Second index is\n quaternion orientation in the world frame. Quaternion is scalar-first\n (w, x, y, z). Shape is (4, ).", "snippet": "value = random_utils.get_random_world_pose_in_view(camera_prim=camera_prim, # pxr.Usd.Prim\n min_distance=min_distance, # float\n max_distance=max_distance, # float\n fov_x=fov_x, # float\n fov_y=fov_y, # float\n fraction_to_screen_edge=fraction_to_screen_edge, # float\n coord_prim=coord_prim, # pxr.Usd.Prim\n min_rotation_range=min_rotation_range, # numpy.ndarray\n max_rotation_range=max_rotation_range) # numpy.ndarray\n" } ] }, { "title": "Render Product", "snippets": [ { "title": "add_aov", "description": "Adds an AOV/Render Var to an existing render product\n\nArgs:\n render_product_path (str): path to the render product prim\n aov_name (str): Name of the render var we want to add to this render product\n\nRaises:\n RuntimeError: If the render product path is invalid\n RuntimeError: If the renderVar could not be created\n RuntimeError: If the renderVar could not be added to the render product\n", "snippet": "render_product_utils.add_aov(render_product_path=render_product_path, # str\n aov_name=aov_name) # str\n" }, { "title": "create_hydra_texture", "description": "Create a hydra texture and return the texture and the render product path\n\nArgs:\n resolution (Tuple[int]): Resolution used to create the render product\n camera_prim_path (str): Camera prim to attach to render product\n\nReturns:\n hydra_texture, str: returns the hydratexture and render product prim path", "snippet": "render_product_utils.create_hydra_texture(resolution=resolution, # typing.Tuple[int]\n camera_prim_path=camera_prim_path) # str\n" }, { "title": "get_camera_prim_path", "description": "Get the current camera for a render product\n\nArgs:\n render_product_path (str): path to the render product prim\n\nRaises:\n RuntimeError: If the render product path is invalid\n\nReturns:\n str : Path to the camera prim attached to this render product", "snippet": "render_product_utils.get_camera_prim_path(render_product_path=render_product_path) # str\n" }, { "title": "get_resolution", "description": "Get resolution for a render product\n\nArgs:\n render_product_path (str): path to the render product prim\n\nRaises:\n RuntimeError: If the render product path is invalid\n\nReturns:\n Tuple[int]: (width,height)", "snippet": "render_product_utils.get_resolution(render_product_path=render_product_path) # str\n" }, { "title": "set_camera_prim_path", "description": "Sets the camera prim path for a render product\n\nArgs:\n render_product_path (str): path to the render product prim\n camera_prim_path (str): path to the camera prim\n\nRaises:\n RuntimeError: If the render product path is invalid", "snippet": "render_product_utils.set_camera_prim_path(render_product_path=render_product_path, # str\n camera_prim_path=camera_prim_path) # str\n" }, { "title": "set_resolution", "description": "Set resolution for a render product\n\nArgs:\n render_product_path (str): path to the render product prim\n resolution (Tuple[float]): width,height for render product\n\nRaises:\n RuntimeError: If the render product path is invalid", "snippet": "render_product_utils.set_resolution(render_product_path=render_product_path, # str\n resolution=resolution) # typing.Tuple[int]\n" } ] }, { "title": "Rotations", "snippets": [ { "title": "euler_angles_to_quat", "description": "Convert Euler XYZ angles to quaternion.\n\nArgs:\n euler_angles (np.ndarray): Euler XYZ angles.\n degrees (bool, optional): Whether input angles are in degrees. Defaults to False.\n\nReturns:\n np.ndarray: quaternion (w, x, y, z).", "snippet": "value = rotations_utils.euler_angles_to_quat(euler_angles=euler_angles, # numpy.ndarray\n degrees=False) # bool\n" }, { "title": "euler_to_rot_matrix", "description": "Convert from Euler XYZ angles to rotation matrix.\n\nArgs:\n euler_angles (np.ndarray): Euler XYZ angles.\n degrees (bool, optional): Whether input angles are in degrees. Defaults to False.\n\nReturns:\n Gf.Rotation: Pxr rotation object.", "snippet": "value = rotations_utils.euler_to_rot_matrix(euler_angles=euler_angles, # numpy.ndarray\n degrees=False) # bool\n" }, { "title": "gf_quat_to_np_array", "description": "Converts a pxr Quaternion type to a numpy array following [w, x, y, z] convention.\n\nArgs:\n orientation (typing.Union[Gf.Quatd, Gf.Quatf, Gf.Quaternion]): Input quaternion object.\n\nReturns:\n np.ndarray: A (4,) quaternion array in (w, x, y, z).", "snippet": "value = rotations_utils.gf_quat_to_np_array(orientation=orientation) # typing.Union[pxr.Gf.Quatd, pxr.Gf.Quatf, pxr.Gf.Quaternion]\n" }, { "title": "gf_rotation_to_np_array", "description": "Converts a pxr Rotation type to a numpy array following [w, x, y, z] convention.\n\nArgs:\n orientation (Gf.Rotation): Pxr rotation object.\n\nReturns:\n np.ndarray: A (4,) quaternion array in (w, x, y, z).", "snippet": "value = rotations_utils.gf_rotation_to_np_array(orientation=orientation) # pxr.Gf.Rotation\n" }, { "title": "lookat_to_quatf", "description": "[summary]\n\nArgs:\n camera (Gf.Vec3f): [description]\n target (Gf.Vec3f): [description]\n up (Gf.Vec3f): [description]\n\nReturns:\n Gf.Quatf: Pxr quaternion object.", "snippet": "value = rotations_utils.lookat_to_quatf(camera=camera, # pxr.Gf.Vec3f\n target=target, # pxr.Gf.Vec3f\n up=up) # pxr.Gf.Vec3f\n" }, { "title": "matrix_to_euler_angles", "description": "Convert rotation matrix to Euler XYZ angles.\n\nArgs:\n mat (np.ndarray): A 3x3 rotation matrix.\n\nReturns:\n np.ndarray: Euler XYZ angles (in radians).", "snippet": "value = rotations_utils.matrix_to_euler_angles(mat=mat) # numpy.ndarray\n" }, { "title": "quat_to_euler_angles", "description": "Convert input quaternion to Euler XYZ matrix.\n\nArgs:\n quat (np.ndarray): Input quaternion (w, x, y, z).\n degrees (bool, optional): Whether returned angles should be in degrees.\n\nReturns:\n np.ndarray: Euler XYZ angles (in radians).", "snippet": "value = rotations_utils.quat_to_euler_angles(quat=quat, # numpy.ndarray\n degrees=False) # bool\n" }, { "title": "quat_to_rot_matrix", "description": "Convert input quaternion to rotation matrix.\n\nArgs:\n quat (np.ndarray): Input quaternion (w, x, y, z).\n\nReturns:\n np.ndarray: A 3x3 rotation matrix.", "snippet": "value = rotations_utils.quat_to_rot_matrix(quat=quat) # numpy.ndarray\n" } ] }, { "title": "Semantics", "snippets": [ { "title": "add_update_semantics", "description": "Apply a semantic label to a prim or update an existing label\n\nArgs:\n prim (Usd.Prim): Usd Prim to add or update semantics on\n semantic_label (str): The label we want to apply\n type_label (str): The type of semantic information we are specifying (default = \"class\")\n suffix (str): Additional suffix used to specify multiple semantic attribute names.\n By default the semantic attribute name is \"Semantics\", and to specify additional\n attributes a suffix can be provided. Simple string concatenation is used :\"Semantics\" + suffix (default = \"\")", "snippet": "semantics_utils.add_update_semantics(prim=prim, # pxr.Usd.Prim\n semantic_label=semantic_label, # str\n type_label=\"class\", # str\n suffix=\"\")\n" }, { "title": "get_semantics", "description": "Returns semantics that are applied to a prim\n\nArgs:\n prim (Usd.Prim): Prim to return semantics for\n\nReturns:\n Dict[str, Tuple[str,str]]: Dictionary containing the name of the applied semantic, and the type and data associated with that semantic. ", "snippet": "value = semantics_utils.get_semantics(prim=prim) # pxr.Usd.Prim\n" }, { "title": "remove_all_semantics", "description": "Removes all semantic tags from a given prim and its children\n\nArgs:\n prim (Usd.Prim): Prim to remove any applied semantic APIs on\n recursive (bool, optional): Also traverse children and remove semantics recursively. Defaults to False.", "snippet": "semantics_utils.remove_all_semantics(prim=prim, # pxr.Usd.Prim\n recursive=False) # bool\n" } ] }, { "title": "Stage", "snippets": [ { "title": "add_reference_to_stage", "description": "Add USD reference to the opened stage at specified prim path.\n\nArgs:\n usd_path (str): The path to USD file.\n prim_path (str): The prim path to attach reference.\n prim_type (str, optional): The type of prim. Defaults to \"Xform\".\n\nRaises:\n FileNotFoundError: When input USD file is found at specified path.\n\nReturns:\n Usd.Prim: The USD prim at specified prim path.", "snippet": "value = stage_utils.add_reference_to_stage(usd_path=usd_path, # str\n prim_path=prim_path, # str\n prim_type=\"Xform\") # str\n" }, { "title": "clear_stage", "description": "Deletes all prims in the stage without populating the undo command buffer\n\nArgs:\n predicate (typing.Optional[typing.Callable[[str], bool]], optional): user defined function that takes a prim_path (str) as input and returns True/False if the prim should/shouldn't be deleted. If predicate is None, a default is used that deletes all prims\n\nReturns:\n [type]: [description]", "snippet": "stage_utils.clear_stage(predicate=None) # typing.Union[typing.Callable[[str], bool], NoneType]\n" }, { "title": "close_stage", "description": "Closes the current opened USD stage.\n\nArgs:\n callback_fn (typing.Callable, optional): Callback function to call while closing. Defaults to None.\n\nReturns:\n bool: True if operation is successful, otherwise false.", "snippet": "value = stage_utils.close_stage(callback_fn=None) # typing.Callable\n" }, { "title": "create_new_stage", "description": "Create a new stage.\n\nReturns:\n Usd.Stage: The created USD stage.", "snippet": "value = stage_utils.create_new_stage()\n" }, { "title": "create_new_stage_async", "description": "Create a new stage (asynchronous version).", "snippet": "stage_utils.create_new_stage_async()\n" }, { "title": "get_current_stage", "description": "Get the current open USD stage.\n\nReturns:\n Usd.Stage: The USD stage.", "snippet": "value = stage_utils.get_current_stage()\n" }, { "title": "get_next_free_path", "description": "Returns the next free usd path for the current stage\n\nArgs:\n path (str): path we want to check\n parent (str, optional): Parent prim for the given path. Defaults to None.\n\nReturns:\n str: a new path that is guaranteed to not exist on the current stage", "snippet": "value = stage_utils.get_next_free_path(path=path, # str\n parent=None) # str\n" }, { "title": "get_stage_units", "description": "Get the stage meters per unit currently set\n\nReturns:\n float: current stage meters per unit", "snippet": "value = stage_utils.get_stage_units()\n" }, { "title": "get_stage_up_axis", "description": "Get the current up-axis of USD stage.\n\nReturns:\n str: The up-axis of the stage.", "snippet": "value = stage_utils.get_stage_up_axis()\n" }, { "title": "is_stage_loading", "description": "Convenience function to see if any files are being loaded.\n\nReturns:\n bool: True if loading, False otherwise", "snippet": "value = stage_utils.is_stage_loading()\n" }, { "title": "open_stage", "description": "Open the given usd file and replace currently opened stage.\n\nArgs:\n usd_path (str): Path to the USD file to open.\n\nRaises:\n ValueError: When input path is not a supported file type by USD.\n\nReturns:\n bool: True if operation is successful, otherwise false.", "snippet": "value = stage_utils.open_stage(usd_path=usd_path) # str\n" }, { "title": "open_stage_async", "description": "Open the given usd file and replace currently opened stage (asynchronous version).\n\nArgs:\n usd_path (str): Path to the USD file to open.\n\nRaises:\n ValueError: When input path is not a supported file type by USD.\n\nReturns:\n bool: True if operation is successful, otherwise false.", "snippet": "value = stage_utils.open_stage_async(usd_path=usd_path) # str\n" }, { "title": "print_stage_prim_paths", "description": "Traverses the stage and prints all prim paths.", "snippet": "stage_utils.print_stage_prim_paths()\n" }, { "title": "save_stage", "description": "Save usd file to path, it will be overwritten with the current stage\n\nArgs:\n usd_path (str): File path to save the current stage to\n save_and_reload_in_place (bool, optional): use save_as_stage to save and reload the root layer in place. Defaults to True.\n\nRaises:\n ValueError: When input path is not a supported file type by USD.\n\nReturns:\n bool: True if operation is successful, otherwise false.", "snippet": "value = stage_utils.save_stage(usd_path=usd_path, # str\n save_and_reload_in_place=True)\n" }, { "title": "set_livesync_stage", "description": "[summary]\n\nArgs:\n usd_path (str): path to enable live sync for, t will be overwritten with the current stage\n enable (bool): True to enable livesync, false to disable livesync\n\nReturns:\n bool: True if operation is successful, otherwise false.", "snippet": "value = stage_utils.set_livesync_stage(usd_path=usd_path, # str\n enable=enable) # bool\n" }, { "title": "set_stage_units", "description": "Set the stage meters per unit\n\nArgs:\n stage_units_in_meters (float): units for stage, 1.0 means meters, 0.01 mean centimeters", "snippet": "stage_utils.set_stage_units(stage_units_in_meters=stage_units_in_meters) # float\n" }, { "title": "set_stage_up_axis", "description": "Change the up axis of the current stage\n\nArgs:\n axis (UsdGeom.Tokens, optional): valid values are \"x\" and \"y\"", "snippet": "stage_utils.set_stage_up_axis(axis=\"z\") # str\n" }, { "title": "traverse_stage", "description": "Traverse through prims in the opened USd stage.\n\nReturns:\n typing.Iterable: Generator which yields prims from the stage in depth-first-traversal order.", "snippet": "value = stage_utils.traverse_stage()\n" }, { "title": "update_stage", "description": "Update the current USD stage.", "snippet": "stage_utils.update_stage()\n" }, { "title": "update_stage_async", "description": "Update the current USD stage (asynchronous version).", "snippet": "stage_utils.update_stage_async()\n" } ] }, { "title": "String", "snippets": [ { "title": "find_root_prim_path_from_regex", "description": "Find the first prim above the regex pattern prim and its position.\n\nArgs:\n prim_path_regex (str): full prim path including the regex pattern prim.\n\nReturns:\n Tuple[str, int]: First position is the prim path to the parent of the regex prim.\n Second position represents the level of the regex prim in the USD stage tree representation.\n", "snippet": "value = string_utils.find_root_prim_path_from_regex(prim_path_regex=prim_path_regex) # str\n" }, { "title": "find_unique_string_name", "description": "Find a unique string name based on the predicate function provided.\n\nThe string is appended with \"_N\", where N is a natural number till the resultant string \nis unique.\n\nArgs:\n initial_name (str): The initial string name.\n is_unique_fn (Callable[[str], bool]): The predicate function to validate against.\n\nReturns:\n str: A unique string based on input function.", "snippet": "value = string_utils.find_unique_string_name(initial_name=initial_name, # str\n is_unique_fn=is_unique_fn) # typing.Callable[[str], bool]\n" } ] }, { "title": "Transformations", "snippets": [ { "title": "get_relative_transform", "description": "Get the relative transformation matrix from the source prim to the target prim.\n\nArgs:\n source_prim (Usd.Prim): source prim from which frame to compute the relative transform.\n target_prim (Usd.Prim): target prim to which frame to compute the relative transform.\n\nReturns:\n np.ndarray: Column-major transformation matrix with shape (4, 4).", "snippet": "value = transformations_utils.get_relative_transform(source_prim=source_prim, # pxr.Usd.Prim\n target_prim=target_prim) # pxr.Usd.Prim\n" }, { "title": "get_translation_from_target", "description": "Get a translation with respect to the target's frame, from a translation in the source's frame.\n\nArgs:\n translation_from_source (np.ndarray): translation from the frame of the prim at source_path. Shape is (3, ).\n source_prim (Usd.Prim): prim path of the prim whose frame the original/untransformed translation\n (translation_from_source) is defined with respect to.\n target_prim (Usd.Prim): prim path of the prim whose frame corresponds to the target frame that the returned\n translation will be defined with respect to.\n\nReturns:\n np.ndarray: translation with respect to the target's frame. Shape is (3, ).", "snippet": "value = transformations_utils.get_translation_from_target(translation_from_source=translation_from_source, # numpy.ndarray\n source_prim=source_prim, # pxr.Usd.Prim\n target_prim=target_prim) # pxr.Usd.Prim\n" }, { "title": "get_world_pose_from_relative", "description": "Get a pose defined in the world frame from a pose defined relative to the frame of the coord_prim.\n\nArgs:\n coord_prim (Usd.Prim): path of the prim whose frame the relative pose is defined with respect to.\n relative_translation (np.ndarray): translation relative to the frame of the prim at prim_path. Shape is (3, ).\n relative_orientation (np.ndarray): quaternion orientation relative to the frame of the prim at prim_path.\n Quaternion is scalar-first (w, x, y, z). Shape is (4, ).\n\nReturns:\n Tuple[np.ndarray, np.ndarray]: first index is position in the world frame. Shape is (3, ). Second index is\n quaternion orientation in the world frame. Quaternion is scalar-first\n (w, x, y, z). Shape is (4, ).", "snippet": "value = transformations_utils.get_world_pose_from_relative(coord_prim=coord_prim, # pxr.Usd.Prim\n relative_translation=relative_translation, # numpy.ndarray\n relative_orientation=relative_orientation) # numpy.ndarray\n" }, { "title": "pose_from_tf_matrix", "description": "Gets pose corresponding to input transformation matrix.\n\nArgs:\n transformation (np.ndarray): Column-major transformation matrix. shape is (4, 4).\n\nReturns:\n Tuple[np.ndarray, np.ndarray]: first index is translation corresponding to transformation. shape is (3, ).\n second index is quaternion orientation corresponding to transformation.\n quaternion is scalar-first (w, x, y, z). shape is (4, ).", "snippet": "value = transformations_utils.pose_from_tf_matrix(transformation=transformation) # numpy.ndarray\n" }, { "title": "tf_matrices_from_poses", "description": "[summary]\n\nArgs:\n translations (Union[np.ndarray, torch.Tensor]): translations with shape (N, 3).\n orientations (Union[np.ndarray, torch.Tensor]): quaternion representation (scalar first) with shape (N, 4).\n\nReturns:\n Union[np.ndarray, torch.Tensor]: transformation matrices with shape (N, 4, 4)", "snippet": "value = transformations_utils.tf_matrices_from_poses(translations=translations, # typing.Union[numpy.ndarray, torch.Tensor]\n orientations=orientations) # typing.Union[numpy.ndarray, torch.Tensor]\n" }, { "title": "tf_matrix_from_pose", "description": "Compute input pose to transformation matrix.\n\nArgs:\n pos (Sequence[float]): The translation vector.\n rot (Sequence[float]): The orientation quaternion.\n\nReturns:\n np.ndarray: A 4x4 matrix.", "snippet": "value = transformations_utils.tf_matrix_from_pose(translation=translation, # typing.Sequence[float]\n orientation=orientation) # typing.Sequence[float]\n" } ] }, { "title": "Torch", "snippets": [ { "title": "as_type", "description": "", "snippet": "torch_utils.as_type(data=data,\n dtype=dtype)\n" }, { "title": "clone_tensor", "description": "", "snippet": "torch_utils.clone_tensor(data=data,\n device=device)\n" }, { "title": "convert", "description": "", "snippet": "torch_utils.convert(data=data,\n device=device)\n" }, { "title": "cos", "description": "", "snippet": "torch_utils.cos(data=data)\n" }, { "title": "create_tensor_from_list", "description": "", "snippet": "torch_utils.create_tensor_from_list(data=data,\n dtype=dtype,\n device=None)\n" }, { "title": "create_zeros_tensor", "description": "", "snippet": "torch_utils.create_zeros_tensor(shape=shape,\n dtype=dtype,\n device=None)\n" }, { "title": "deg2rad", "description": "_summary_\n\nArgs:\n degree_value (torch.Tensor): _description_\n device (_type_, optional): _description_. Defaults to None.\n\nReturns:\n torch.Tensor: _description_", "snippet": "value = torch_utils.deg2rad(degree_value=degree_value, # float\n device=None)\n" }, { "title": "euler_angles_to_quats", "description": "Vectorized version of converting euler angles to quaternion (scalar first)\n\nArgs:\n euler_angles (typing.Union[np.ndarray, torch.Tensor]): euler angles with shape (N, 3) representation XYZ\n degrees (bool, optional): True if degrees, False if radians. Defaults to False.\n\nReturns:\n typing.Union[np.ndarray, torch.Tensor]: quaternions representation of the angles (N, 4) - scalar first.", "snippet": "value = torch_utils.euler_angles_to_quats(euler_angles=euler_angles, # torch.Tensor\n degrees=False, # bool\n device=None)\n" }, { "title": "expand_dims", "description": "", "snippet": "torch_utils.expand_dims(data=data,\n axis=axis)\n" }, { "title": "get_local_from_world", "description": "", "snippet": "torch_utils.get_local_from_world(parent_transforms=parent_transforms,\n positions=positions,\n orientations=orientations,\n device=device)\n" }, { "title": "get_pose", "description": "", "snippet": "torch_utils.get_pose(positions=positions,\n orientations=orientations,\n device=device)\n" }, { "title": "get_world_from_local", "description": "", "snippet": "torch_utils.get_world_from_local(parent_transforms=parent_transforms,\n translations=translations,\n orientations=orientations,\n device=device)\n" }, { "title": "gf_quat_to_tensor", "description": "Converts a pxr Quaternion type to a torch array (scalar first).\n\nArgs:\n orientation (typing.Union[Gf.Quatd, Gf.Quatf, Gf.Quaternion]): [description]\n\nReturns:\n torch.Tensor: [description]", "snippet": "value = torch_utils.gf_quat_to_tensor(orientation=orientation, # typing.Union[pxr.Gf.Quatd, pxr.Gf.Quatf, pxr.Gf.Quaternion]\n device=None)\n" }, { "title": "inverse", "description": "", "snippet": "torch_utils.inverse(data=data)\n" }, { "title": "matmul", "description": "", "snippet": "torch_utils.matmul(matrix_a=matrix_a,\n matrix_b=matrix_b)\n" }, { "title": "move_data", "description": "", "snippet": "torch_utils.move_data(data=data,\n device=device)\n" }, { "title": "move_to_gpu", "description": "", "snippet": "torch_utils.move_to_gpu(data=data)\n" }, { "title": "normalise_quat_in_pose", "description": "Takes a pose and normalises the quaternion portion of it.\n\nArgs:\n pose: shape N, 7\nReturns:\n Pose with normalised quat. Shape N, 7", "snippet": "torch_utils.normalise_quat_in_pose(pose=pose)\n" }, { "title": "pad", "description": "", "snippet": "torch_utils.pad(data=data,\n pad_width=pad_width,\n mode=\"constant\",\n value=None)\n" }, { "title": "rad2deg", "description": "_summary_\n\nArgs:\n radian_value (torch.Tensor): _description_\n device (_type_, optional): _description_. Defaults to None.\n\nReturns:\n torch.Tensor: _description_", "snippet": "value = torch_utils.rad2deg(radian_value=radian_value, # torch.Tensor\n device=None)\n" }, { "title": "resolve_indices", "description": "", "snippet": "torch_utils.resolve_indices(indices=indices,\n count=count,\n device=device)\n" }, { "title": "set_seed", "description": " set seed across modules ", "snippet": "torch_utils.set_seed(seed=seed,\n torch_deterministic=False)\n" }, { "title": "sin", "description": "", "snippet": "torch_utils.sin(data=data)\n" }, { "title": "tensor_cat", "description": "", "snippet": "torch_utils.tensor_cat(data=data,\n dim=-1)\n" }, { "title": "tensor_stack", "description": "", "snippet": "torch_utils.tensor_stack(data=data,\n dim=0)\n" }, { "title": "tf_matrices_from_poses", "description": "[summary]\n\nArgs:\n translations (Union[np.ndarray, torch.Tensor]): translations with shape (N, 3).\n orientations (Union[np.ndarray, torch.Tensor]): quaternion representation (scalar first) with shape (N, 4).\n\nReturns:\n Union[np.ndarray, torch.Tensor]: transformation matrices with shape (N, 4, 4)", "snippet": "value = torch_utils.tf_matrices_from_poses(translations=translations, # torch.Tensor\n orientations=orientations, # torch.Tensor\n device=None)\n" }, { "title": "transpose_2d", "description": "", "snippet": "torch_utils.transpose_2d(data=data)\n" }, { "title": "unscale_np", "description": "", "snippet": "torch_utils.unscale_np(x=x,\n lower=lower,\n upper=upper)\n" } ] }, { "title": "Types", "snippets": [ { "title": "ArticulationAction", "snippets": [ { "title": "ArticulationAction", "description": "[summary]\n\n Args:\n joint_positions (Optional[Union[List, np.ndarray]], optional): [description]. Defaults to None.\n joint_velocities (Optional[Union[List, np.ndarray]], optional): [description]. Defaults to None.\n joint_efforts (Optional[Union[List, np.ndarray]], optional): [description]. Defaults to None.\n ", "snippet": "articulation_action = ArticulationAction(joint_positions=None, # typing.Union[typing.List, numpy.ndarray, NoneType]\n joint_velocities=None, # typing.Union[typing.List, numpy.ndarray, NoneType]\n joint_efforts=None, # typing.Union[typing.List, numpy.ndarray, NoneType]\n joint_indices=None) # typing.Union[typing.List, numpy.ndarray, NoneType]\n" }, { "title": "get_dict", "description": "[summary]\n\n Returns:\n dict: [description]\n ", "snippet": "dict = articulation_action.get_dict()\n" }, { "title": "get_dof_action", "description": "[summary]\n\n Args:\n index (int): [description]\n\n Returns:\n dict: [description]\n ", "snippet": "dof_action = articulation_action.get_dof_action(index=index) # int\n" }, { "title": "get_length", "description": "[summary]\n\n Returns:\n Optional[int]: [description]\n ", "snippet": "length = articulation_action.get_length()\n" } ] }, { "title": "ArticulationActions", "description": "[summary]\n\n Args:\n joint_positions (Optional[Union[List, np.ndarray]], optional): [description]. Defaults to None.\n joint_velocities (Optional[Union[List, np.ndarray]], optional): [description]. Defaults to None.\n joint_efforts (Optional[Union[List, np.ndarray]], optional): [description]. Defaults to None.\n ", "snippet": "articulation_actions = ArticulationActions(joint_positions=None, # typing.Union[typing.List, numpy.ndarray, NoneType]\n joint_velocities=None, # typing.Union[typing.List, numpy.ndarray, NoneType]\n joint_efforts=None, # typing.Union[typing.List, numpy.ndarray, NoneType]\n joint_indices=None) # typing.Union[typing.List, numpy.ndarray, NoneType]\n" }, { "title": "DataFrame", "snippets": [ { "title": "DataFrame", "description": "[summary]\n\n Args:\n current_time_step (int): [description]\n current_time (float): [description]\n data (dict): [description]\n ", "snippet": "data_frame = DataFrame(current_time_step=current_time_step, # int\n current_time=current_time, # float\n data=data) # dict\n" }, { "title": "get_dict", "description": "[summary]\n\n Returns:\n dict: [description]\n ", "snippet": "dict = data_frame.get_dict()\n" } ] }, { "title": "DOFInfo", "description": "[summary]\n\n Args:\n prim_path (str): [description]\n handle (int): [description]\n prim (Usd.Prim): [description]\n index (int): [description]\n ", "snippet": "dof_Info = DOFInfo(prim_path=prim_path, # str\n handle=handle, # int\n prim=prim, # pxr.Usd.Prim\n index=index) # int\n" }, { "title": "DynamicState", "description": "[summary]\n\n Args:\n position (np.ndarray): [description]\n orientation (np.ndarray): [description]\n ", "snippet": "dynamic_state = DynamicState(position=position, # numpy.ndarray\n orientation=orientation, # numpy.ndarray\n linear_velocity=linear_velocity, # numpy.ndarray\n angular_velocity=angular_velocity) # numpy.ndarray\n" }, { "title": "DynamicsViewState", "description": "[summary]\n\n Args:\n position (np.ndarray): [description]\n orientation (np.ndarray): [description]\n ", "snippet": "dynamics_view_state = DynamicsViewState(positions=positions, # typing.Union[numpy.ndarray, torch.Tensor]\n orientations=orientations, # typing.Union[numpy.ndarray, torch.Tensor]\n linear_velocities=linear_velocities, # typing.Union[numpy.ndarray, torch.Tensor]\n angular_velocities=angular_velocities) # typing.Union[numpy.ndarray, torch.Tensor]\n" }, { "title": "JointsState", "description": "[summary]\n\n Args:\n positions (np.ndarray): [description]\n velocities (np.ndarray): [description]\n efforts (np.ndarray): [description]\n ", "snippet": "joints_state = JointsState(positions=positions, # numpy.ndarray\n velocities=velocities, # numpy.ndarray\n efforts=efforts) # numpy.ndarray\n" }, { "title": "XFormPrimState", "description": "[summary]\n\n Args:\n position (np.ndarray): [description]\n orientation (np.ndarray): [description]\n ", "snippet": "xform_prim_state = XFormPrimState(position=position, # numpy.ndarray\n orientation=orientation) # numpy.ndarray\n" }, { "title": "XFormPrimViewState", "description": "[summary]\n\n Args:\n positions (Union[np.ndarray, torch.Tensor]): positions with shape of (N, 3).\n orientations (Union[np.ndarray, torch.Tensor]): quaternion representation of orientation (scalar first) with shape (N, 4).\n ", "snippet": "xform_prim_view_state = XFormPrimViewState(positions=positions, # typing.Union[numpy.ndarray, torch.Tensor]\n orientations=orientations) # typing.Union[numpy.ndarray, torch.Tensor]\n" } ] }, { "title": "Viewports", "snippets": [ { "title": "add_aov_to_viewport", "description": "", "snippet": "viewports_utils.add_aov_to_viewport(viewport_api=viewport_api,\n aov_name=aov_name) # str\n" }, { "title": "backproject_depth", "description": "Backproject depth image to image space\n\nArgs:\n depth_image (np.array): Depth image buffer\n viewport_api (Any): Handle to viewport api\n max_clip_depth (float): Depth values larger than this will be clipped\n\nReturns:\n np.array: [description]", "snippet": "value = viewports_utils.backproject_depth(depth_image=depth_image, # numpy.array\n viewport_api=viewport_api, # typing.Any\n max_clip_depth=max_clip_depth) # float\n" }, { "title": "get_id_from_index", "description": "Get the viewport id for a given index. \nThis function was added for backwards compatibility for VP2 as viewport IDs are not the same as the viewport index\n\nArgs:\n index (_type_): viewport index to retrieve ID for\n\nReturns:\n viewport id : Returns None if window index was not found", "snippet": "viewports_utils.get_id_from_index(index=index)\n" }, { "title": "get_intrinsics_matrix", "description": "Get intrinsic matrix for the camera attached to a specific viewport\n\nArgs:\n viewport (Any): Handle to viewport api\n\nReturns:\n np.ndarray: the intrinsic matrix associated with the specified viewport\n The following image convention is assumed:\n +x should point to the right in the image\n +y should point down in the image", "snippet": "value = viewports_utils.get_intrinsics_matrix(viewport_api=viewport_api) # typing.Any\n" }, { "title": "get_viewport_names", "description": "Get list of all viewport names\n\nArgs:\n usd_context_name (str, optional): usd context to use. Defaults to None.\n\nReturns:\n List[str]: List of viewport names", "snippet": "value = viewports_utils.get_viewport_names(usd_context_name=None) # str\n" }, { "title": "get_window_from_id", "description": "Find window that matches a given viewport id\n\nArgs:\n id (_type_): Viewport ID to get window for\n usd_context_name (str, optional): usd context to use. Defaults to None.\n\nReturns:\n Window : Returns None if window with matching ID was not found", "snippet": "viewports_utils.get_window_from_id(id=id,\n usd_context_name=None) # str\n" }, { "title": "project_depth_to_worldspace", "description": "Project depth image to world space\n\nArgs:\n depth_image (np.array): Depth image buffer\n viewport_api (Any): Handle to viewport api\n max_clip_depth (float): Depth values larger than this will be clipped\n\nReturns:\n List[carb.Float3]: List of points from depth in world space", "snippet": "value = viewports_utils.project_depth_to_worldspace(depth_image=depth_image, # numpy.array\n viewport_api=viewport_api, # typing.Any\n max_clip_depth=max_clip_depth) # float\n" }, { "title": "set_camera_view", "description": "Set the location and target for a camera prim in the stage given its path\n\nArgs:\n eye (np.ndarray): Location of camera.\n target (np.ndarray,): Location of camera target.\n camera_prim_path (str, optional): Path to camera prim being set. Defaults to \"/OmniverseKit_Persp\".", "snippet": "viewports_utils.set_camera_view(eye=eye, # numpy.array\n target=target, # numpy.array\n camera_prim_path=\"/OmniverseKit_Persp\", # str\n viewport_api=None)\n" }, { "title": "set_intrinsics_matrix", "description": "Set intrinsic matrix for the camera attached to a specific viewport\n\nNote:\n We assume cx and cy are centered in the camera\n horizontal_aperture_offset and vertical_aperture_offset are computed and set on the camera prim but are not used\n\nArgs:\n viewport (Any): Handle to viewport api\n intrinsics_matrix (np.ndarray): A 3x3 intrinsic matrix\n focal_length (float, optional): Default focal length to use when computing aperture values. Defaults to 1.0.\n\nRaises:\n ValueError: If intrinsic matrix is not a 3x3 matrix.\n ValueError: If camera prim is not valid", "snippet": "viewports_utils.set_intrinsics_matrix(viewport_api=viewport_api, # typing.Any\n intrinsics_matrix=intrinsics_matrix, # numpy.ndarray\n focal_length=1.0) # float\n" } ] }, { "title": "XForms", "snippets": [ { "title": "clear_xform_ops", "description": " Remove all xform ops from input prim.\n\nArgs:\n prim (Usd.Prim): The input USD prim.", "snippet": "xforms_utils.clear_xform_ops(prim=prim) # pxr.Usd.Prim\n" }, { "title": "reset_and_set_xform_ops", "description": "Reset xform ops to isaac sim defaults, and set their values\n\nArgs:\n prim (Usd.Prim): Prim to reset\n translation (Gf.Vec3d): translation to set\n orientation (Gf.Quatd): orientation to set\n scale (Gf.Vec3d, optional): scale to set. Defaults to Gf.Vec3d([1.0, 1.0, 1.0]).", "snippet": "xforms_utils.reset_and_set_xform_ops(prim=prim, # pxr.Usd.Prim\n translation=translation, # pxr.Gf.Vec3d\n orientation=orientation, # pxr.Gf.Quatd\n scale=(1, 1, 1)) # pxr.Gf.Vec3d\n" }, { "title": "reset_xform_ops", "description": "Reset xform ops for a prim to isaac sim defaults, \n\nArgs:\n prim (Usd.Prim): Prim to reset xform ops on", "snippet": "xforms_utils.reset_xform_ops(prim=prim) # pxr.Usd.Prim\n" } ] } ] } ] }
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/snippets/python-usd.json
{ "snippets": [ { "title": "Common import", "description": "Most common USD import statements", "snippet": "import omni.usd\nfrom pxr import Sdf, Gf, Tf\nfrom pxr import Usd, UsdGeom, UsdPhysics, UsdShade\n" }, { "title": "Stage", "snippets": [ { "title": "Get stage", "description": "Get the current stage", "snippet": "stage = omni.usd.get_context().get_stage()\n" }, { "title": "Get prim at path", "description": "Return the prim at path, or an invalid prim if none exists", "snippet": "prim = stage.GetPrimAtPath(${1:prim_path})\n" }, { "title": "Get stage linear units", "description": "Get the stage linear units (e.g. centimeters: 0.01, meters: 1.0)", "snippet": "stage_unit = UsdGeom.GetStageMetersPerUnit(stage)\n" }, { "title": "Get stage up axis", "description": "Get the stage up axis (\"Y\" or \"Z\")", "snippet": "UsdGeom.GetStageUpAxis(stage) # returns \"Y\" or \"Z\"\n" }, { "title": "Set default prim", "description": "Set the default prim if the stage's root layer may be used as a reference or payload", "snippet": "stage.SetDefaultPrim(prim) # the prim should be a top-level Usd.Prim object\n" }, { "title": "Set stage linear units", "description": "Set the stage linear units (e.g. centimeters, meters, etc.)", "snippet": "# available units: https://graphics.pixar.com/usd/release/api/class_usd_geom_linear_units.html\nUsdGeom.SetStageMetersPerUnit(stage, UsdGeom.LinearUnits.${1:meters})\n" }, { "title": "Set stage up axis", "description": "Set the stage up axis (y or z)", "snippet": "UsdGeom.SetStageUpAxis(stage, UsdGeom.Tokens.${1:z})\n" }, { "title": "Traverse prims on the stage", "description": "Traverse the active, loaded, defined, non-abstract prims on this stage depth-first", "snippet": "for prim in stage.Traverse():\n prim\n" }, { "title": "Find prims by name", "description": "Find all of the prims with the same name", "snippet": "prims = [x for x in stage.Traverse() if x.GetName() == \"${1:prim_name}\"]\n" }, { "title": "Find prims by type", "description": "Find all of the prims with a certain type", "snippet": "prims = [x for x in stage.Traverse() if x.IsA(${1:UsdGeom.Mesh})]\n" }, { "title": "Add subLayer", "description": "Add a subLayer (composition arc used to build layer stacks)", "snippet": "root_layer = stage.GetRootLayer()\nsub_layer = Sdf.Layer.CreateNew(\"${1:path/to/sublayer.usd}\")\n\n# you can use standard python list.insert to add the subLayer to any position in the list\nroot_layer.subLayerPaths.append(sub_layer.identifier)\n" } ] }, { "title": "Prims", "snippets": [ { "title": "Check if a prim is valid (exists)", "description": "Check if a prim exists", "snippet": "if prim.IsValid(): # also, if prim:\n print(\"Prim exists!\")\n" }, { "title": "Get child prim by name", "description": "Get the prim's direct child named name if it has one, otherwise return an invalid prim", "snippet": "child_prim = prim.GetChild(\"${1:child_name}\")\n" }, { "title": "Get active children", "description": "Return the prim's active, loaded, defined, non-abstract children", "snippet": "children = prim.GetChildren()\n" }, { "title": "Get all prim children", "description": "Return all the prim's children", "snippet": "children = prim.GetAllChildren()\n" }, { "title": "Add inherit", "description": "Add an inherit (composition arc that enables a prim to contain all of the scene description contained in the base prim it inherits)", "snippet": "# the base prim typically uses the \"class\" specifier to designate that it \n# is meant to be inherited and skipped in standard stage traversals\nbase_prim = stage.CreateClassPrim(\"${1:/_class_name}\")\ninherits = prim.GetInherits()\ninherits.AddInherit(base_prim.GetPath())\n" }, { "title": "Add payload", "description": "Add a payload (composition arc to enable users to aggregate layers or assets onto a stage)", "snippet": "payloads = prim.GetPayloads()\npayloads.AddPayload(assetPath=\"${1:path/to/file.usd}\",\n primPath=\"${2:/World/target}\") # OPTIONAL: Uses a specific target prim. Otherwise, uses the payload layer's defaultPrim\n" }, { "title": "Add reference", "description": "Add a reference (composition arc that enables users to aggregate layers or assets onto a stage)", "snippet": "references = prim.GetReferences()\nreferences.AddReference(assetPath=\"${1:path/to/file.usd}\",\n primPath=\"${2:/World/target}\") # OPTIONAL: Reference a specific target prim. Otherwise, uses the referenced layer's defaultPrim.\n" }, { "title": "Add specialize", "description": "Add a specialize (composition arc that enables a prim to contain all of the scene description contained in the base prim it specializes)", "snippet": "specializes = prim.GetSpecializes()\nspecializes.AddSpecialize(base_prim.GetPath())\n" }, { "title": "Compute world-space transform", "description": "Compute the transformation matrix for a prim at the given time", "snippet": "# compute world-space transform\ntransform = Gf.Transform()\ntransform.SetMatrix(UsdGeom.Xformable(prim).ComputeLocalToWorldTransform(Usd.TimeCode.Default()))\n\n# get translation, rotation and scale\ntranslation = transform.GetTranslation()\nrotation = transform.GetRotation().GetQuat()\nscale = transform.GetScale()\n" }, { "title": "Compute local-space transform", "description": "Computes the fully-combined, local-to-parent transformation for a prim", "snippet": "# compute local-space transform\ntransform = Gf.Transform()\ntransform.SetMatrix(UsdGeom.Xformable(prim).GetLocalTransformation()\n\n# get translation, rotation and scale\ntranslation = transform.GetTranslation()\nrotation = transform.GetRotation().GetQuat()\nscale = transform.GetScale()\n" }, { "title": "Compute bounding box", "description": "Compute the bounding box for a prim and all of its descendants", "snippet": "bound = UsdGeom.Imageable(prim).ComputeWorldBound(Usd.TimeCode.Default(), UsdGeom.Tokens.default_)\nbound_range = bound.ComputeAlignedBox()\n" } ] }, { "title": "Prim properties", "snippets": [ { "title": "Check if a property is valid (exists)", "description": "Check if a property exists. Properties consist of Usd.Attribute and Usd.Relationship", "snippet": "attribute = prim.GetAttribute(\"${1:attribute_name}\")\nif attribute.IsValid():\n print(\"Attribute exists!\")\n" }, { "title": "Create attribute", "description": "Create a prim attribute", "snippet": "# USD data types: https://docs.omniverse.nvidia.com/prod_usd/prod_usd/quick-start/usd-types.html\nattribute = prim.CreateAttribute(${1:attribute_name}, Sdf.ValueTypeNames.${2:Float})\n" }, { "title": "Get prim attribute", "description": "Return the attribute value of a prim given its name", "snippet": "value = prim.GetAttribute(\"${1:attribute_name}\").Get()\n" }, { "title": "Set prim attribute", "description": "Set the attribute value of a prim given its name", "snippet": "prim.GetAttribute(\"${1:attribute_name}\").Set(${2:value})\n" }, { "title": "Create relationship", "description": "Create a relationship", "snippet": "relationship = prim.CreateRelationship(\"${1:relationship_name}\")\n" }, { "title": "Add relationship target", "description": "Add relationship target", "snippet": "relationship.AddTarget(\"${1:/World/Target}\")\n" }, { "title": "Set relationship targets", "description": "Set relationship targets", "snippet": "relationship.SetTargets([\"${1:/World/Target}\"])\n" }, { "title": "Get relationship targets", "description": "Get relationship targets", "snippet": "proxy_prim_rel = UsdGeom.Imageable(prim).GetProxyPrimRel()\ntargets = proxy_prim_rel.GetForwardedTargets()\n" } ] }, { "title": "Cameras", "snippets": [ { "title": "Create orthographic camera", "description": "Create an orthographic camera", "snippet": "camera_path = Sdf.Path(\"${1:/World/OrthographicCamera}\")\nusd_camera = UsdGeom.Camera.Define(stage, camera_path)\nusd_camera.CreateProjectionAttr().Set(UsdGeom.Tokens.orthographic)\n" }, { "title": "Create perspective camera", "description": "Create an perspective camera", "snippet": "camera_path = Sdf.Path(\"${1:/World/PerspectiveCamera}\")\nusd_camera = UsdGeom.Camera.Define(stage, camera_path)\nusd_camera.CreateProjectionAttr().Set(UsdGeom.Tokens.perspective)\n\n# set some other common attributes on the camera\nusd_camera.CreateFocalLengthAttr().Set(35)\nusd_camera.CreateHorizontalApertureAttr().Set(20.955)\nusd_camera.CreateVerticalApertureAttr().Set(15.2908)\nusd_camera.CreateClippingRangeAttr().Set((0.1,100000))\n" } ] }, { "title": "Materials", "snippets": [ { "title": "Create MDL material", "description": "Create an MDL material", "snippet": "mtl_path = Sdf.Path(\"${1:/World/Looks/OmniPBR}\")\nmtl = UsdShade.Material.Define(stage, mtl_path)\nshader = UsdShade.Shader.Define(stage, mtl_path.AppendPath(\"Shader\"))\nshader.CreateImplementationSourceAttr(UsdShade.Tokens.sourceAsset)\n# MDL shaders should use \"mdl\" sourceType\nshader.SetSourceAsset(\"OmniPBR.mdl\", \"mdl\")\nshader.SetSourceAssetSubIdentifier(\"OmniPBR\", \"mdl\")\n# MDL materials should use \"mdl\" renderContext\nmtl.CreateSurfaceOutput(\"mdl\").ConnectToSource(shader.ConnectableAPI(), \"out\")\nmtl.CreateDisplacementOutput(\"mdl\").ConnectToSource(shader.ConnectableAPI(), \"out\")\nmtl.CreateVolumeOutput(\"mdl\").ConnectToSource(shader.ConnectableAPI(), \"out\")\n" }, { "title": "Create UsdPreviewSurface material", "description": "Create a UsdPreviewSurface material", "snippet": "mtl_path = Sdf.Path(\"${1:/World/Looks/PreviewSurface}\")\nmtl = UsdShade.Material.Define(stage, mtl_path)\nshader = UsdShade.Shader.Define(stage, mtl_path.AppendPath(\"Shader\"))\nshader.CreateIdAttr(\"UsdPreviewSurface\")\nshader.CreateInput(\"diffuseColor\", Sdf.ValueTypeNames.Color3f).Set([1.0, 0.0, 0.0])\nshader.CreateInput(\"roughness\", Sdf.ValueTypeNames.Float).Set(0.5)\nshader.CreateInput(\"metallic\", Sdf.ValueTypeNames.Float).Set(0.0)\nmtl.CreateSurfaceOutput().ConnectToSource(shader.ConnectableAPI(), \"surface\")\n" }, { "title": "Create UsdPreviewSurface material (with UsdUVTexture)", "description": "Create a UsdPreviewSurface material and a UsdUVTexture to read from a texture file and connect it to the first", "snippet": "mtl_path = Sdf.Path(\"${1:/World/Looks/PreviewSurface}\")\nmtl = UsdShade.Material.Define(stage, mtl_path)\nshader = UsdShade.Shader.Define(stage, mtl_path.AppendPath(\"Shader\"))\nshader.CreateIdAttr(\"UsdPreviewSurface\")\nshader.CreateInput(\"diffuseColor\", Sdf.ValueTypeNames.Color3f).Set((1.0, 0.0, 0.0))\nshader.CreateInput(\"roughness\", Sdf.ValueTypeNames.Float).Set(0.5)\nshader.CreateInput(\"metallic\", Sdf.ValueTypeNames.Float).Set(0.0)\n\ndiffuse_tx = UsdShade.Shader.Define(stage,mtl_path.AppendPath(\"DiffuseColorTx\"))\ndiffuse_tx.CreateIdAttr('UsdUVTexture')\ndiffuse_tx.CreateInput('file', Sdf.ValueTypeNames.Asset).Set(\"${2:path/to/texture.png}\")\ndiffuse_tx.CreateOutput('rgb', Sdf.ValueTypeNames.Float3)\nshader.CreateInput(\"diffuseColor\", Sdf.ValueTypeNames.Color3f).ConnectToSource(diffuse_tx.ConnectableAPI(), 'rgb')\nmtl.CreateSurfaceOutput().ConnectToSource(shader.ConnectableAPI(), \"surface\")\n" } ] } ] }
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/snippets/generate_commands_app.py
import json import inspect import collections count = 0 snippets = [] snippets_by_extensions_depth = 2 snippets_by_extensions = collections.defaultdict(list) def class_fullname(c): try: module = c.__module__ if module == 'builtins': return c.__name__ return module + '.' + c.__name__ except: return str(c) from pxr import Sdf commands = omni.kit.commands.get_commands() for k, v in commands.items(): # count += 1 # print() # if count > 20: # break if v: command_class = list(v.values())[0] command_extension = list(v.keys())[0] spec = inspect.getfullargspec(command_class.__init__) signature = inspect.signature(command_class.__init__) command = command_class.__qualname__ command_args = [] command_annotations = [] for parameter in signature.parameters.values(): if parameter.name in ["self", "args", "kwargs"]: continue # arg if type(parameter.default) == type(inspect.Parameter.empty): command_args.append("{}={}".format(parameter.name, parameter.name)) else: default_value = parameter.default if type(parameter.default) is str: default_value = '"{}"'.format(parameter.default) elif type(parameter.default) is Sdf.Path: if parameter.default == Sdf.Path.emptyPath: default_value = "Sdf.Path.emptyPath" else: default_value = 'Sdf.Path("{}")'.format(parameter.default) elif inspect.isclass(parameter.default): default_value = class_fullname(parameter.default) command_args.append("{}={}".format(parameter.name, default_value)) # annotation if parameter.annotation == inspect.Parameter.empty: command_annotations.append("") else: command_annotations.append(class_fullname(parameter.annotation)) # build snippet arguments_as_string = '")' if command_args: arguments_as_string = '",\n' for i, arg, annotation in zip(range(len(command_args)), command_args, command_annotations): is_last = i >= len(command_args) - 1 if annotation: arguments_as_string += " " * 26 + "{}{}".format(arg, ") # {}".format(annotation) if is_last else ", # {}\n".format(annotation)) else: arguments_as_string += " " * 26 + "{}{}".format(arg, ")" if is_last else ",\n") title = command try: description = command_class.__doc__.replace("\n ", "\n").replace(" **Command**", "") if description.startswith("\n"): description = description[1:] if description.endswith("\n"): description = description[:-1] while " " in description: description = description.replace(" ", " ") description = "[{}]\n\n".format(command_extension) + description except Exception as e: description = None if not description: description = "[{}]".format(command_extension) snippet = 'omni.kit.commands.execute("{}{}'.format(command, arguments_as_string) + "\n" # storage snippet (all) snippets.append({"title": title, "description": description, "snippet": snippet}) # storage snippet (by extension) command_extension = ".".join(command_extension.split(".")[:snippets_by_extensions_depth]) snippets_by_extensions[command_extension].append({"title": title, "description": description, "snippet": snippet}) snippets = [] for title, snippets_by_extension in snippets_by_extensions.items(): snippets.append({"title": title, "snippets": snippets_by_extension}) with open("kit-commands.json", "w") as f: json.dump({"snippets": snippets}, f, indent=0) print("done")
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/resources/isaac-sim_extensions.json
{ "resources": [ { "internal": true, "title": "Extensions API (homepage)", "description": "Isaac Sim: Extensions API", "url": "https://docs.omniverse.nvidia.com/py/isaacsim/index.html" }, { "internal": true, "title": "Core", "description": "Core [omni.isaac.core]", "url": "https://docs.omniverse.nvidia.com/py/isaacsim/source/extensions/omni.isaac.core/docs/index.html" }, { "internal": true, "title": "Dynamic Control", "description": "The Dynamic Control extension provides a set of utilities to control physics objects. It provides opaque handles for different physics objects that remain valid between PhysX scene resets, which occur whenever play or stop is pressed", "url": "https://docs.omniverse.nvidia.com/py/isaacsim/source/extensions/omni.isaac.dynamic_control/docs/index.html" }, { "internal": true, "title": "Simulation Application", "description": "This extension provides convenience functions when running in pure python mode", "url": "https://docs.omniverse.nvidia.com/py/isaacsim/source/extensions/omni.isaac.kit/docs/index.html" } ] }
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/resources/forums.json
{ "resources": [ { "internal": false, "title": "[Omniverse]", "description": "Omniverse announcements and discussions", "url": "https://forums.developer.nvidia.com/c/omniverse/300" }, { "internal": false, "title": "Announcements", "description": "Look for Omniverse announcements and updates here", "url": "https://forums.developer.nvidia.com/c/omniverse/announcements/302" }, { "title": "Apps", "resources": [ { "internal": false, "title": "Audio2Face", "description": "Audio2Face is a combination of AI based technologies that generates facial motion and lip sync that is derived entirely from an audio source", "url": "https://forums.developer.nvidia.com/c/omniverse/apps/audio2face/404" }, { "internal": false, "title": "Code", "description": "Omniverse Code is an Omniverse App that serves as an integrated development environment (IDE) for developers and power users to easily build their Omniverse extensions, apps, or microservices", "url": "https://forums.developer.nvidia.com/c/omniverse/apps/code/519" }, { "internal": false, "title": "Create", "description": "NVIDIA Omniverse Create is an Omniverse app for world-building that allows users to assemble, light, simulate and render large scale scenes", "url": "https://forums.developer.nvidia.com/c/omniverse/apps/create/405" }, { "internal": false, "title": "Kaolin", "description": "Omniverse Kaolin is an interactive application for researchers working on 3D Deep Learning. This application leverages the Omniverse platform, USD format and RTX rendering to provide interactive tools that allow visualizing 3D outputs of any Deep Learning model as it is training, inspecting 3D datas…", "url": "https://forums.developer.nvidia.com/c/omniverse/apps/kaolin/406" }, { "internal": false, "title": "Machinima", "description": "NVIDIA Omniverse Machinima gives you the power to remix, recreate, and redefine animated video game storytelling. Powered by NVIDIA RTX and your imagination", "url": "https://forums.developer.nvidia.com/c/omniverse/apps/machinima/407" }, { "internal": false, "title": "Nucleus Navigator", "description": "Nucleus Navigator is an Omniverse app that gives you the ability to manage files and folders on your local workstation, Omniverse Enterprise Servers, and Nucleus Cloud environments", "url": "https://forums.developer.nvidia.com/c/omniverse/apps/nucleus-navigator/633" }, { "internal": false, "title": "Omniverse Drive", "description": "The Omniverse Drive software mounts the whole Omniverse server repo to your Windows system, such that you can manipulate server files the same way as your local files", "url": "https://forums.developer.nvidia.com/c/omniverse/apps/drive/381" }, { "internal": false, "title": "Omniverse Isaac Sim", "description": "Discussions, news and information about the NVIDIA Isaac Sim", "url": "https://forums.developer.nvidia.com/c/agx-autonomous-machines/isaac/simulation/69" }, { "internal": false, "title": "Omniverse XR", "description": "Omniverse Create XR is a spatial computing app that enables users to interactively and immersively assemble, light, and navigate Omniverse scenes in real-time - alone, or collaboratively", "url": "https://forums.developer.nvidia.com/c/omniverse/apps/omniverse-xr/587" }, { "internal": false, "title": "Showroom", "description": "We are excited to share more news about Omniverse Showroom, which was recently added to the Launcher and will updated with more tech demos regularly", "url": "https://forums.developer.nvidia.com/c/omniverse/apps/omniverse-showroom/510" }, { "internal": false, "title": "View", "description": "NVIDIA Omniverse View is an Omniverse App that offers a simple, yet powerful toolkit designed to visualize architectural and engineering projects with stunning, physically accurate rendering output", "url": "https://forums.developer.nvidia.com/c/omniverse/apps/view/408" } ] }, { "internal": false, "title": "Connectors", "description": "NVIDIA has built extensions and additional software layers on top of the open-source USD distribution that allow DCC tools and compute services to communicate easily with each other through the Omniverse Nucleus DB", "url": "https://forums.developer.nvidia.com/c/omniverse/connectors/380" }, { "internal": false, "title": "Developer", "description": "Discussions around extension, kit, scripting and customization", "url": "https://forums.developer.nvidia.com/c/omniverse/developer/330" }, { "internal": false, "title": "Digital Humans", "description": "Digital human models represent variations of body shapes for the target end-user population. They can simulate human motions, evaluate workloads, and are utilized to assess safety and usability of products and environments in a virtual space with computer-aided design", "url": "https://forums.developer.nvidia.com/c/omniverse/digital-humans/485" }, { "internal": false, "title": "Extension Exchange", "description": "Create and Share your Extensions with the Omniverse Community!", "url": "https://forums.developer.nvidia.com/c/omniverse/extension/399" }, { "internal": false, "title": "General Discussion", "description": "Discussions for all aspects of the Omniverse Platform", "url": "https://forums.developer.nvidia.com/c/omniverse/general-discussion/329" }, { "internal": false, "title": "Platform", "description": "NVIDIA Omniverse is a powerful, multi-GPU, real-time simulation and collaboration platform for 3D production pipelines based on Pixar's Universal Scene Description and NVIDIA RTX", "url": "https://forums.developer.nvidia.com/c/omniverse/platform/397" }, { "internal": false, "title": "Services", "description": "A forum area to discuss Omniverse platform services", "url": "https://forums.developer.nvidia.com/c/omniverse/services/608" }, { "internal": false, "title": "Showcase", "description": "Share your creations with the community", "url": "https://forums.developer.nvidia.com/c/omniverse/showcase/362" }, { "internal": false, "title": "Synthetic Data Generation (SDG)", "description": "Omniverse replicator is in beta and ready for experimentation", "url": "https://forums.developer.nvidia.com/c/omniverse/synthetic-data-generation-sdg/595" } ] }
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/resources/documentation.json
{ "resources": [ { "internal": true, "title": "Platform Overview", "description": "A high level review of the platform", "url": "https://docs.omniverse.nvidia.com/platform/index.html" }, { "title": "Apps", "resources": [ { "internal": true, "title": "Audio2Face", "description": "Audio driven face and lip sync", "url": "https://docs.omniverse.nvidia.com/audio2face/index.html" }, { "internal": true, "title": "Code", "description": "A developer focused Omniverse App", "url": "https://docs.omniverse.nvidia.com/code/index.html" }, { "internal": true, "title": "Create", "description": "Developing and rendering 3D worlds", "url": "https://docs.omniverse.nvidia.com/create/index.html" }, { "internal": true, "title": "Farm", "description": "Distribute your tasks over multiple computers", "url": "https://docs.omniverse.nvidia.com/farm/index.html" }, { "internal": true, "title": "Isaac Sim", "description": "Simulation tools for tomorrow's solutions", "url": "https://docs.omniverse.nvidia.com/isaacsim/index.html" }, { "internal": true, "title": "Kaolin", "description": "Powerful 3D accelerated deep learning", "url": "https://docs.omniverse.nvidia.com/kaolin/index.html" }, { "internal": true, "title": "Machinima", "description": "Tell your story", "url": "https://docs.omniverse.nvidia.com/machinima/index.html" }, { "internal": true, "title": "Navigator", "description": "Convenient Nucleus Content Management", "url": "https://docs.omniverse.nvidia.com/navigator/index.html" }, { "internal": true, "title": "Omniverse Streaming Client", "description": "Remote access for KIT-based Apps", "url": "https://docs.omniverse.nvidia.com/streaming-client/index.html" }, { "internal": true, "title": "Showroom", "description": "Explore what's possible", "url": "https://docs.omniverse.nvidia.com/showroom/index.html" }, { "internal": true, "title": "USDView", "description": "View and introspect USD stages", "url": "https://docs.omniverse.nvidia.com/usdview/index.html" }, { "internal": true, "title": "View", "description": "World class architectural visualization", "url": "https://docs.omniverse.nvidia.com/view/index.html" }, { "internal": true, "title": "XR", "description": "Step inside the Omniverse", "url": "https://docs.omniverse.nvidia.com/xr/index.html" } ] }, { "title": "Platform", "resources": [ { "internal": true, "title": "Connectors", "description": "Connect your favorite applications to the Omniverse", "url": "https://docs.omniverse.nvidia.com/connect/index.html" }, { "internal": true, "title": "Extensions", "description": "Extended capabilities for Omniverse Apps", "url": "https://docs.omniverse.nvidia.com/extensions/index.html" }, { "internal": true, "title": "Kit", "description": "The primary building block of all Omniverse Apps", "url": "https://docs.omniverse.nvidia.com/kit/index.html" }, { "internal": true, "title": "Materials and Rendering", "description": "Make the most of your visuals", "url": "https://docs.omniverse.nvidia.com/rtx/index.html" }, { "internal": true, "title": "Nucleus", "description": "The core of an Omniverse network", "url": "https://docs.omniverse.nvidia.com/nucleus/index.html" }, { "internal": true, "title": "USD", "description": "Learn about the Universal Scene Description", "url": "https://docs.omniverse.nvidia.com/usd/index.html" } ] }, { "title": "Additional resources", "resources": [ { "internal": true, "title": "Omniverse Developer Documentation", "description": "API Documentation for Omniverse KIT", "url": "https://docs.omniverse.nvidia.com/py/kit/index.html" }, { "internal": true, "title": "Omniverse Digital Twins", "description": "Replicate your factory", "url": "https://docs.omniverse.nvidia.com/digital-twins/index.html" }, { "internal": true, "title": "Omniverse Services", "description": "Extend Omniverse using its microservice framework", "url": "https://docs.omniverse.nvidia.com/services/index.html" }, { "internal": true, "title": "Omniverse SimReady", "description": "Specification for creating simulation-ready assets", "url": "https://docs.omniverse.nvidia.com/simready/index.html" }, { "internal": true, "title": "Omniverse Utilities", "description": "Helpful utilities in the Omniverse", "url": "https://docs.omniverse.nvidia.com/utilities/index.html" }, { "internal": true, "title": "Omniverse Workflows", "description": "Objective based tutorials using Omniverse", "url": "https://docs.omniverse.nvidia.com/workflows/index.html" } ] } ] }
Toni-SM/semu.misc.vscode/exts-vscode/embedded-vscode-for-nvidia-omniverse/resources/developer.json
{ "resources": [ { "internal": true, "title": "Extensions", "description": "Extensions", "url": "https://docs.omniverse.nvidia.com/kit/docs/kit-manual/latest/guide/extensions_basic.html" }, { "internal": true, "title": "Kit programming manual", "description": "Kit programming manual", "url": "https://docs.omniverse.nvidia.com/kit/docs/kit-manual/latest/guide/kit_overview.html" }, { "internal": true, "title": "Kit Python snippets", "description": "Kit Python snippets", "url": "https://docs.omniverse.nvidia.com/prod_kit/prod_kit/python-snippets.html" }, { "internal": true, "title": "OmniGraph", "description": "OmniGraph framework", "url": "https://docs.omniverse.nvidia.com/kit/docs/omni.graph.core/latest/index.html" }, { "internal": true, "title": "Omni::UI", "description": "Omniverse's UI toolkit for creating beautiful and flexible graphical user interfaces", "url": "https://docs.omniverse.nvidia.com/kit/docs/omni.ui/latest/index.html" }, { "internal": true, "title": "PhysX 5 SDK", "description": "NVIDIA PhysX SDK version 5", "url": "https://nvidia-omniverse.github.io/PhysX/physx" }, { "internal": true, "title": "Python scripting component", "description": "Python scripting component", "url": "https://docs.omniverse.nvidia.com/prod_extensions/prod_extensions/ext_python-scripting-component.html" }, { "internal": true, "title": "SceneUI", "description": "SceneUI helps build great-looking 3d manipulators and 3d helpers", "url": "https://docs.omniverse.nvidia.com/kit/docs/omni.ui.scene/latest/index.html" }, { "internal": true, "title": "USD API reference", "description": "Universal Scene Description (USD) API reference", "url": "https://graphics.pixar.com/usd/dev/api/index.html" }, { "internal": true, "title": "USD data types", "description": " USD basic data types", "url": "https://docs.omniverse.nvidia.com/prod_usd/prod_usd/quick-start/usd-types.html" }, { "internal": true, "title": "USD Python snippets", "description": "Universal Scene Description (USD) Python snippets", "url": "https://docs.omniverse.nvidia.com/prod_usd/prod_usd/python-snippets.html" }, { "internal": true, "title": "VS Code link", "description": "VS Code link", "url": "https://docs.omniverse.nvidia.com/prod_extensions/prod_extensions/ext_vs-code-link.html" } ] }
Toni-SM/semu.xr.openxr/README.md
## OpenXR compact binding for creating extended reality applications on NVIDIA Omniverse > This extension provides a compact python binding (on top of the open standard [OpenXR](https://www.khronos.org/openxr/) for augmented reality (AR) and virtual reality (VR)) to create extended reality applications taking advantage of NVIDIA Omniverse rendering capabilities. In addition to updating views (e.g., head-mounted display), it enables subscription to any input event (e.g., controller buttons and triggers) and execution of output actions (e.g., haptic vibration) through a simple and efficient API for accessing conformant devices such as HTC Vive, Oculus and others... <br> **Target applications:** Any NVIDIA Omniverse app with the `omni.syntheticdata` extension installed (e.g., Isaac Sim, Code, etc.) - *Tested in Ubuntu 18.04/20.04, STEAMVR beta 1.24.3, Omniverse Code 2022.1.3 and Isaac Sim 2022.1.1* **Supported OS:** Linux **Changelog:** [CHANGELOG.md](exts/semu.xr.openxr/docs/CHANGELOG.md) **Table of Contents:** - [Extension setup](#setup) - [Diagrams](#diagrams) - [Sample code](#sample) - [GUI launcher](#gui) - [Extension API](#api) - [Acquiring extension interface](#api-interface) - [API](#api-functions) - [```init```](#method-init) - [```is_session_running```](#method-is_session_running) - [```create_instance```](#method-create_instance) - [```get_system```](#method-get_system) - [```create_session```](#method-create_session) - [```poll_events```](#method-poll_events) - [```poll_actions```](#method-poll_actions) - [```render_views```](#method-render_views) - [```subscribe_action_event```](#method-subscribe_action_event) - [```apply_haptic_feedback```](#method-apply_haptic_feedback) - [```stop_haptic_feedback```](#method-stop_haptic_feedback) - [```setup_mono_view```](#method-setup_mono_view) - [```setup_stereo_view```](#method-setup_stereo_view) - [```get_recommended_resolutions```](#method-get_recommended_resolutions) - [```set_reference_system_pose```](#method-set_reference_system_pose) - [```set_stereo_rectification```](#method-set_stereo_rectification) - [```set_meters_per_unit```](#method-set_meters_per_unit) - [```set_frame_transformations```](#method-set_frame_transformations) - [```teleport_prim```](#method-teleport_prim) - [```subscribe_render_event```](#method-subscribe_render_event) - [```set_frames```](#method-set_frames) - [Available enumerations](#api-enumerations) - [Available constants](#api-constants) <br> ![showcase](exts/semu.xr.openxr/data/preview.png) <hr> <a name="setup"></a> ### Extension setup 1. Add the extension using the [Extension Manager](https://docs.omniverse.nvidia.com/prod_extensions/prod_extensions/ext_extension-manager.html) or by following the steps in [Extension Search Paths](https://docs.omniverse.nvidia.com/py/kit/docs/guide/extensions.html#extension-search-paths) * Git url (git+https) as extension search path ``` git+https://github.com/Toni-SM/semu.xr.openxr.git?branch=main&dir=exts ``` * Compressed (.zip) file for import [semu.xr.openxr.zip](https://github.com/Toni-SM/semu.xr.openxr/releases) 2. Enable the extension using the [Extension Manager](https://docs.omniverse.nvidia.com/prod_extensions/prod_extensions/ext_extension-manager.html) or by following the steps in [Extension Enabling/Disabling](https://docs.omniverse.nvidia.com/py/kit/docs/guide/extensions.html#extension-enabling-disabling) 3. Import the extension into any python code and use it... ```python from semu.xr.openxr import _openxr ``` 4. Or use the [GUI launcher](#gui) to directly dislpay the current stage in the HMD <hr> <a name="diagrams"></a> ### Diagrams High-level overview of extension usage, including the order of function calls, callbacks and the action and rendering loop <p align="center"> <img src="https://user-images.githubusercontent.com/22400377/190011524-27ae7023-6c49-4e00-986f-03e087bd9ac1.png" width="55%"> </p> Typical OpenXR application showing the grouping of the standard functions under the compact binding provided by the extension (adapted from [openxr-10-reference-guide.pdf](https://www.khronos.org/registry/OpenXR/specs/1.0/refguide/openxr-10-reference-guide.pdf)) ![openxr-application](https://user-images.githubusercontent.com/22400377/136704215-5507bbee-666a-42da-b692-cbf8c08a749b.png) <hr> <a name="sample"></a> ### Sample code The following sample code shows a typical workflow that configures and renders on a stereo headset the view generated in an Omniverse application. It configures and subscribes two input actions to the left controller to 1) mirror on a simulated sphere the pose of the controller and 2) change the dimensions of the sphere based on the position of the trigger. In addition, an output action, a haptic vibration, is configured and executed when the controller trigger reaches its maximum position A short video, after the code, shows a test of the OpenXR application from the Script Editor using an HTC Vive Pro ```python import omni from pxr import UsdGeom from semu.xr.openxr import _openxr # get stage unit stage = omni.usd.get_context().get_stage() meters_per_unit = UsdGeom.GetStageMetersPerUnit(stage) # create a sphere (1 centimeter radius) to mirror the controller's pose sphere_prim = omni.usd.get_context().get_stage().DefinePrim("/sphere", "Sphere") sphere_prim.GetAttribute("radius").Set(0.01 / meters_per_unit) # acquire interface xr = _openxr.acquire_openxr_interface() # setup OpenXR application using default parameters xr.init() xr.create_instance() xr.get_system() # action callback def on_action_event(path, value): # process controller's trigger if path == "/user/hand/left/input/trigger/value": # modify the sphere's radius (from 1 to 10 centimeters) according to the controller's trigger position sphere_prim.GetAttribute("radius").Set((value * 9 + 1) * 0.01 / meters_per_unit) # apply haptic vibration when the controller's trigger is fully depressed if value == 1: xr.apply_haptic_feedback("/user/hand/left/output/haptic", {"duration": _openxr.XR_MIN_HAPTIC_DURATION}) # mirror the controller's pose on the sphere (cartesian position and rotation as quaternion) elif path == "/user/hand/left/input/grip/pose": xr.teleport_prim(sphere_prim, value[0], value[1]) # subscribe controller actions (haptic actions don't require callbacks) xr.subscribe_action_event("/user/hand/left/input/grip/pose", callback=on_action_event, reference_space=_openxr.XR_REFERENCE_SPACE_TYPE_LOCAL) xr.subscribe_action_event("/user/hand/left/input/trigger/value", callback=on_action_event) xr.subscribe_action_event("/user/hand/left/output/haptic") # create session and define interaction profiles xr.create_session() # setup cameras and viewports and prepare rendering using the internal callback xr.set_meters_per_unit(meters_per_unit) xr.setup_stereo_view() xr.set_frame_transformations(flip=0) xr.set_stereo_rectification(y=0.05) # execute action and rendering loop on each simulation step def on_simulation_step(step): if xr.poll_events() and xr.is_session_running(): xr.poll_actions() xr.render_views(_openxr.XR_REFERENCE_SPACE_TYPE_LOCAL) physx_subs = omni.physx.get_physx_interface().subscribe_physics_step_events(on_simulation_step) ``` [Watch the sample video](https://user-images.githubusercontent.com/22400377/190255669-d1e05833-e7c0-4ec7-9bd8-956188fe7053.mp4) <hr> <a name="gui"></a> ### GUI launcher The extension also provides a graphical user interface that helps to launch a partially configurable OpenXR application form a window. This interface is located in the *Add-ons > OpenXR UI* menu The first four options (Graphics API, Form factor, Blend mode, View configuration type) cannot be modified once the OpenXR application is running. They are used to create and configure the OpenXR instance, system and session The other options (under the central separator) can be modified while the application is running. They help to modify the pose of the reference system, or to perform transformations on the images to be rendered, for example. <p align="center"> <img src="https://user-images.githubusercontent.com/22400377/190108800-c5b701cd-05ea-41d5-9e5d-726049021eb8.png" width="65%"> </p> <hr> <a name="api"></a> ### Extension API <a name="api-interface"></a> #### Acquiring extension interface * Acquire OpenXR interface ```python _openxr.acquire_openxr_interface() -> semu::xr::openxr::OpenXR ``` * Release OpenXR interface ```python _openxr.release_openxr_interface(xr: semu::xr::openxr::OpenXR) -> None ``` <a name="api-functions"></a> #### API The following functions are provided on the OpenXR interface: <a name="method-init"></a> - Init OpenXR application by loading the necessary libraries ```python init(graphics: str = "OpenGL", use_ctypes: bool = False) -> bool ``` Parameters: - graphics: ```str``` OpenXR graphics API supported by the runtime (OpenGL, OpenGLES, Vulkan, D3D11, D3D12). **Note:** At the moment only OpenGL is available - use_ctypes: ```bool```, optional If true, use ctypes as C/C++ interface instead of pybind11 (default) Returns: - ```bool``` ```True``` if initialization was successful, otherwise ```False``` <a name="method-is_session_running"></a> - Get OpenXR session's running status ```python is_session_running() -> bool ``` Returns: - ```bool``` Return ```True``` if the OpenXR session is running, ```False``` otherwise <a name="method-create_instance"></a> - Create an OpenXR instance to allow communication with an OpenXR runtime ```python create_instance(application_name: str = "Omniverse (XR)", engine_name: str = "", api_layers: list = [], extensions: list = []) -> bool ``` Parameters: - application_name: ```str```, optional Name of the OpenXR application (default: *Omniverse (XR)*) - engine_name: ```str```, optional Name of the engine (if any) used to create the application (empty by default) - api_layers: ```list``` of ```str```, optional [API layers](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#api-layers) to be inserted between the OpenXR application and the runtime implementation - extensions: ```list``` of ```str```, optional [Extensions](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#extensions) to be loaded. **Note:** The graphics API selected during initialization (init) is automatically included in the extensions to be loaded. At the moment only the graphic extensions are configured Returns: - ```bool``` ```True``` if the instance has been created successfully, otherwise ```False``` <a name="method-get_system"></a> - Obtain the system represented by a collection of related devices at runtime ```python get_system(form_factor: int = XR_FORM_FACTOR_HEAD_MOUNTED_DISPLAY, blend_mode: int = XR_ENVIRONMENT_BLEND_MODE_OPAQUE, view_configuration_type: int = XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO) -> bool ``` Parameters: - form_factor: {```XR_FORM_FACTOR_HEAD_MOUNTED_DISPLAY```, ```XR_FORM_FACTOR_HANDHELD_DISPLAY```}, optional Desired [form factor](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#form_factor_description) from ```XrFormFactor``` enum (default: ```XR_FORM_FACTOR_HEAD_MOUNTED_DISPLAY```) - blend_mode: {```XR_ENVIRONMENT_BLEND_MODE_OPAQUE```, ```XR_ENVIRONMENT_BLEND_MODE_ADDITIVE```, ```XR_ENVIRONMENT_BLEND_MODE_ALPHA_BLEND```}, optional Desired environment [blend mode](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#environment_blend_mode) from ```XrEnvironmentBlendMode``` enum (default: ```XR_ENVIRONMENT_BLEND_MODE_OPAQUE```) - view_configuration_type: {```XR_VIEW_CONFIGURATION_TYPE_PRIMARY_MONO```, ```XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO```}, optional Primary [view configuration](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#view_configurations) type from ```XrViewConfigurationType``` enum (default: ```XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO```) Returns: - ```bool``` ```True``` if the system has been obtained successfully, otherwise ```False``` <a name="method-create_session"></a> - Create an OpenXR session that represents an application's intention to display XR content ```python create_session() -> bool ``` Returns: - ```bool``` ```True``` if the session has been created successfully, otherwise ```False``` <a name="method-poll_events"></a> - [Event polling](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#event-polling) and processing ```python poll_events() -> bool ``` Returns: - ```bool``` ```False``` if the running session needs to end (due to the user closing or switching the application, etc.), otherwise ```False``` <a name="method-poll_actions"></a> - [Action](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#_action_overview) polling ```python poll_actions() -> bool ``` Returns: - ```bool``` ```True``` if there is no error during polling, otherwise ```False``` <a name="method-render_views"></a> - Present rendered images to the user's views according to the selected reference space ```python render_views(reference_space: int = XR_REFERENCE_SPACE_TYPE_LOCAL) -> bool ``` Parameters: - reference_space: {```XR_REFERENCE_SPACE_TYPE_VIEW```, ```XR_REFERENCE_SPACE_TYPE_LOCAL```, ```XR_REFERENCE_SPACE_TYPE_STAGE```}, optional Desired [reference space](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#reference-spaces) type from ```XrReferenceSpaceType``` enum used to render the images (default: ```XR_REFERENCE_SPACE_TYPE_LOCAL```) Returns: - ```bool``` ```True``` if there is no error during rendering, otherwise ```False``` <a name="method-subscribe_action_event"></a> - Create an action given a path and subscribe a callback function to the update event of this action ```python subscribe_action_event(path: str, callback: Union[Callable[[str, object], None], None] = None, action_type: Union[int, None] = None, reference_space: Union[int, None] = XR_REFERENCE_SPACE_TYPE_LOCAL) -> bool ``` If ```action_type``` is ```None``` the action type will be automatically defined by parsing the last segment of the path according to the following policy: | Action type (```XrActionType```) | Last segment of the path | |----------------------------------|--------------------------| | ```XR_ACTION_TYPE_BOOLEAN_INPUT``` | */click*, */touch* | | ```XR_ACTION_TYPE_FLOAT_INPUT``` | */value*, */force* | | ```XR_ACTION_TYPE_VECTOR2F_INPUT``` | */x*, */y* | | ```XR_ACTION_TYPE_POSE_INPUT``` | */pose* | | ```XR_ACTION_TYPE_VIBRATION_OUTPUT``` | */haptic*, */haptic_left*, */haptic_right*, */haptic_left_trigger*, */haptic_right_trigger* | The callback function (a callable object) should have only the following 2 parameters: - path: ```str``` The complete path (user path and subpath) of the action that invokes the callback - value: ```bool```, ```float```, ```tuple(float, float)```, ```tuple(pxr.Gf.Vec3d, pxr.Gf.Quatd)``` The current state of the action according to its type | Action type (```XrActionType```) | python type | |----------------------------------|-------------| | ```XR_ACTION_TYPE_BOOLEAN_INPUT``` | ```bool``` | | ```XR_ACTION_TYPE_FLOAT_INPUT``` | ```float``` | | ```XR_ACTION_TYPE_VECTOR2F_INPUT``` (x, y) | ```tuple(float, float)``` | | ```XR_ACTION_TYPE_POSE_INPUT``` (position (in stage unit), rotation as quaternion) | ```tuple(pxr.Gf.Vec3d, pxr.Gf.Quatd)``` | ```XR_ACTION_TYPE_VIBRATION_OUTPUT``` actions will not invoke their callback function. In this case the callback must be None ```XR_ACTION_TYPE_POSE_INPUT``` also specifies, through the definition of the reference_space parameter, the reference space used to retrieve the pose The collection of available paths corresponds to the following [interaction profiles](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#semantic-path-interaction-profiles): - [Khronos Simple Controller](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#_khronos_simple_controller_profile) - [Google Daydream Controller](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#_google_daydream_controller_profile) - [HTC Vive Controller](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#_htc_vive_controller_profile) - [HTC Vive Pro](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#_htc_vive_pro_profile) - [Microsoft Mixed Reality Motion Controller](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#_microsoft_mixed_reality_motion_controller_profile) - [Microsoft Xbox Controller](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#_microsoft_xbox_controller_profile) - [Oculus Go Controller](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#_oculus_go_controller_profile) - [Oculus Touch Controller](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#_oculus_touch_controller_profile) - [Valve Index Controller](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#_valve_index_controller_profile) Parameters: - path: ```str``` Complete [path](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#semantic-path-reserved) (user path and subpath) referring to the action - callback: callable object (2 parameters) or ```None``` for ```XR_ACTION_TYPE_VIBRATION_OUTPUT``` Callback invoked when the state of the action changes - action_type: {```XR_ACTION_TYPE_BOOLEAN_INPUT```, ```XR_ACTION_TYPE_FLOAT_INPUT```, ```XR_ACTION_TYPE_VECTOR2F_INPUT```, ```XR_ACTION_TYPE_POSE_INPUT```, ```XR_ACTION_TYPE_VIBRATION_OUTPUT```} or ```None```, optional Action [type](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrActionType) from ```XrActionType``` enum (default: ```None```) - reference_space: {```XR_REFERENCE_SPACE_TYPE_VIEW```, ```XR_REFERENCE_SPACE_TYPE_LOCAL```, ```XR_REFERENCE_SPACE_TYPE_STAGE```}, optional Desired [reference space](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#reference-spaces) type from ```XrReferenceSpaceType``` enum used to retrieve the pose (default: ```XR_REFERENCE_SPACE_TYPE_LOCAL```) Returns - ```bool``` ```True``` if there is no error during action creation, otherwise ```False``` <a name="method-apply_haptic_feedback"></a> - Apply a [haptic feedback](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#_output_actions_and_haptics) to a device defined by a path (user path and subpath) ```python apply_haptic_feedback(path: str, haptic_feedback: dict) -> bool ``` Parameters: - path: ```str``` Complete [path](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#semantic-path-reserved) (user path and subpath) referring to the action - haptic_feedback: ```dict``` A python dictionary containing the field names and value of a ```XrHapticBaseHeader```-based structure. **Note:** At the moment the only haptics type supported is the unextended OpenXR [XrHapticVibration](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrHapticVibration) Returns: - ```bool``` ```True``` if there is no error during the haptic feedback application, otherwise ```False``` <a name="method-stop_haptic_feedback"></a> - Stop a [haptic feedback](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#_output_actions_and_haptics) applied to a device defined by a path (user path and subpath) ```python stop_haptic_feedback(path: str) -> bool ``` Parameters: - path: ```str``` Complete [path](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#semantic-path-reserved) (user path and subpath) referring to the action Returns: - ```bool``` ```True``` if there is no error during the haptic feedback stop, otherwise ```False``` <a name="method-setup_mono_view"></a> - Setup Omniverse viewport and camera for monoscopic rendering ```python setup_mono_view(camera: Union[str, pxr.Sdf.Path, pxr.Usd.Prim] = "/OpenXR/Cameras/camera", camera_properties: dict = {"focalLength": 10}) -> None ``` This method obtains the viewport window for the given camera. If the viewport window does not exist, a new one is created and the camera is set as active. If the given camera does not exist, a new camera is created with the same path and set to the recommended resolution of the display device Parameters: - camera: ```str```, ```pxr.Sdf.Path``` or ```pxr.Usd.Prim```, optional Omniverse camera prim or path (default: */OpenXR/Cameras/camera*) - camera_properties: ```dict``` Dictionary containing the [camera properties](https://docs.omniverse.nvidia.com/app_create/prod_materials-and-rendering/cameras.html#camera-properties) supported by the Omniverse kit to be set (default: ```{"focalLength": 10}```) <a name="method-setup_stereo_view"></a> - Setup Omniverse viewports and cameras for stereoscopic rendering ```python setup_stereo_view(left_camera: Union[str, pxr.Sdf.Path, pxr.Usd.Prim] = "/OpenXR/Cameras/left_camera", right_camera: Union[str, pxr.Sdf.Path, pxr.Usd.Prim, None] = "/OpenXR/Cameras/right_camera", camera_properties: dict = {"focalLength": 10}) -> None ``` This method obtains the viewport window for each camera. If the viewport window does not exist, a new one is created and the camera is set as active. If the given cameras do not exist, new cameras are created with the same path and set to the recommended resolution of the display device Parameters: - left_camera: ```str```, ```pxr.Sdf.Path``` or ```pxr.Usd.Prim```, optional Omniverse left camera prim or path (default: */OpenXR/Cameras/left_camera*) - right_camera: ```str```, ```pxr.Sdf.Path``` or ```pxr.Usd.Prim```, optional Omniverse right camera prim or path (default: */OpenXR/Cameras/right_camera*) - camera_properties: ```dict``` Dictionary containing the [camera properties](https://docs.omniverse.nvidia.com/app_create/prod_materials-and-rendering/cameras.html#camera-properties) supported by the Omniverse kit to be set (default: ```{"focalLength": 10}```) <a name="method-get_recommended_resolutions"></a> - Get the recommended resolution of the display device ```python get_recommended_resolutions() -> tuple ``` Returns: - ```tuple``` Tuple containing the recommended resolutions (width, height) of each device view. If the tuple length is 2, index 0 represents the left eye and index 1 represents the right eye <a name="method-set_reference_system_pose"></a> - Set the pose of the origin of the reference system ```python set_reference_system_pose(position: Union[pxr.Gf.Vec3d, None] = None, rotation: Union[pxr.Gf.Vec3d, None] = None) -> None ``` Parameters: - position: ```pxr.Gf.Vec3d``` or ```None```, optional Cartesian position (in stage unit) (default: ```None```) - rotation: ```pxr.Gf.Vec3d``` or ```None```, optional Rotation (in degress) on each axis (default: ```None```) <a name="method-set_stereo_rectification"></a> - Set the angle (in radians) of the rotation axes for stereoscopic view rectification ```python set_stereo_rectification(x: float = 0, y: float = 0, z: float = 0) -> None ``` Parameters: - x: ```float```, optional Angle (in radians) of the X-axis (default: 0) - y: ```float```, optional Angle (in radians) of the Y-axis (default: 0) - x: ```float```, optional Angle (in radians) of the Z-axis (default: 0) <a name="method-set_meters_per_unit"></a> - Specify the meters per unit to be applied to transformations (default: 1.0) ```python set_meters_per_unit(meters_per_unit: float) -> None ``` Parameters: - meters_per_unit: ```float``` Meters per unit. E.g.: 1 meter is 1.0, 1 centimeter is 0.01 <a name="method-set_frame_transformations"></a> - Specify the transformations to be applied to the rendered images ```python set_frame_transformations(fit: bool = False, flip: Union[int, tuple, None] = None) -> None ``` Parameters: - fit: ```bool```, optionl Adjust each rendered image to the recommended resolution of the display device by cropping and scaling the image from its center (default: ```False```). OpenCV ```resize``` method with ```INTER_LINEAR``` interpolation will be used to scale the image to the recommended resolution - flip: ```int```, ```tuple``` or ```None```, optionl Flip each image around vertical (0), horizontal (1), or both axes (0,1) (default: ```None```) <a name="method-teleport_prim"></a> - Teleport the prim specified by the given transformation (position and rotation) ```python teleport_prim(prim: pxr.Usd.Prim, position: pxr.Gf.Vec3d, rotation: pxr.Gf.Quatd, reference_position: Union[pxr.Gf.Vec3d, None] = None, reference_rotation: Union[pxr.Gf.Vec3d, None] = None) -> None ``` Parameters: - prim: ```pxr.Usd.Prim``` Target prim - position: ```pxr.Gf.Vec3d``` Cartesian position (in stage unit) used to transform the prim - rotation: ```pxr.Gf.Quatd``` Rotation (as quaternion) used to transform the prim - reference_position: ```pxr.Gf.Vec3d``` or ```None```, optional Cartesian position (in stage unit) used as reference system (default: ```None```) - reference_rotation: ```pxr.Gf.Vec3d``` or ```None```, optional Rotation (in degress) on each axis used as reference system (default: ```None```) <a name="method-subscribe_render_event"></a> - Subscribe a callback function to the render event ```python subscribe_render_event(callback=None) -> None ``` The callback function (a callable object) should have only the following 3 parameters: - num_views: ```int``` The number of views to render: mono (1), stereo (2) - views: ```tuple``` of ```XrView``` structure A [XrView](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrView) structure contains the view pose and projection state necessary to render a image. The length of the tuple corresponds to the number of views (if the tuple length is 2, index 0 represents the left eye and index 1 represents the right eye) - configuration_views: ```tuple``` of ```XrViewConfigurationView``` structure A [XrViewConfigurationView](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrViewConfigurationView) structure specifies properties related to rendering of a view (e.g. the optimal width and height to be used when rendering the view). The length of the tuple corresponds to the number of views (if the tuple length is 2, index 0 represents the left eye and index 1 represents the right eye) The callback function must call the ```set_frames``` function to pass to the selected graphics API the image or images to be rendered If the callback is None, an internal callback will be used to render the views. This internal callback updates the pose of the cameras according to the specified reference system, gets the images from the previously configured viewports and invokes the ```set_frames``` function to render the views Parameters: - callback: callable object (3 parameters) or ```None```, optional Callback invoked on each render event (default: ```None```) <a name="method-set_frames"></a> - Pass to the selected graphics API the images to be rendered in the views ```python set_frames(configuration_views: list, left: numpy.ndarray, right: numpy.ndarray = None) -> bool ``` In the case of stereoscopic devices, the parameters left and right represent the left eye and right eye respectively. To pass an image to the graphic API of monoscopic devices only the parameter left should be used (the parameter right must be ```None```) This function will apply to each image the transformations defined by the ```set_frame_transformations``` function if they were specified Parameters: - configuration_views: ```tuple``` of ```XrViewConfigurationView``` structure A [XrViewConfigurationView](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrViewConfigurationView) structure specifies properties related to rendering of a view (e.g. the optimal width and height to be used when rendering the view) - left: ```numpy.ndarray``` RGB or RGBA image (```numpy.uint8```) - right: ```numpy.ndarray``` or ```None``` RGB or RGBA image (```numpy.uint8```) Returns: - ```bool``` ```True``` if there is no error during the passing to the selected graphics API, otherwise ```False``` <a name="api-enumerations"></a> #### Available enumerations - Form factors supported by OpenXR runtimes ([```XrFormFactor```](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrFormFactor)) - ```XR_FORM_FACTOR_HEAD_MOUNTED_DISPLAY``` = 1 - ```XR_FORM_FACTOR_HANDHELD_DISPLAY``` = 2 - Environment blend mode ([```XrEnvironmentBlendMode```](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrEnvironmentBlendMode)) - ```XR_ENVIRONMENT_BLEND_MODE_OPAQUE``` = 1 - ```XR_ENVIRONMENT_BLEND_MODE_ADDITIVE``` = 2 - ```XR_ENVIRONMENT_BLEND_MODE_ALPHA_BLEND``` = 3 - Primary view configuration type ([```XrViewConfigurationType```](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrViewConfigurationType)) - ```XR_VIEW_CONFIGURATION_TYPE_PRIMARY_MONO``` = 1 - ```XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO``` = 2 - Reference spaces ([```XrReferenceSpaceType```](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrReferenceSpaceType)) - ```XR_REFERENCE_SPACE_TYPE_VIEW``` = 1 - ```XR_REFERENCE_SPACE_TYPE_LOCAL``` = 2 - ```XR_REFERENCE_SPACE_TYPE_STAGE``` = 3 - Action type ([```XrActionType```](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrActionType)) - ```XR_ACTION_TYPE_BOOLEAN_INPUT``` = 1 - ```XR_ACTION_TYPE_FLOAT_INPUT``` = 2 - ```XR_ACTION_TYPE_VECTOR2F_INPUT``` = 3 - ```XR_ACTION_TYPE_POSE_INPUT``` = 4 - ```XR_ACTION_TYPE_VIBRATION_OUTPUT``` = 100 <a name="api-constants"></a> #### Available constants - Graphics API extension names - ```XR_KHR_OPENGL_ENABLE_EXTENSION_NAME``` = "XR_KHR_opengl_enable" - ```XR_KHR_OPENGL_ES_ENABLE_EXTENSION_NAME``` = "XR_KHR_opengl_es_enable" - ```XR_KHR_VULKAN_ENABLE_EXTENSION_NAME``` = "XR_KHR_vulkan_enable" - ```XR_KHR_D3D11_ENABLE_EXTENSION_NAME``` = "XR_KHR_D3D11_enable" - ```XR_KHR_D3D12_ENABLE_EXTENSION_NAME``` = "XR_KHR_D3D12_enable" - Useful constants for applying haptic feedback - ```XR_NO_DURATION``` = 0 - ```XR_INFINITE_DURATION``` = 0x7fffffffffffffff - ```XR_MIN_HAPTIC_DURATION``` = -1 - ```XR_FREQUENCY_UNSPECIFIED``` = 0
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/clean_extension.bash
#!/bin/bash # delete old files rm -r build rm *.so rm semu/xr/openxr/*.c rm semu/xr/openxr/*.so
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/BUILD.md
## Building from source ### Linux ```bash cd src/semu.xr.openxr bash compile_extension.bash ``` ## Removing old compiled files Get a fresh clone of the repository and follow the next steps ```bash # remove compiled files _openxr.cpython-37m-x86_64-linux-gnu.so git filter-repo --invert-paths --path exts/semu.xr.openxr/semu/xr/openxr/_openxr.cpython-37m-x86_64-linux-gnu.so # add origin git remote add origin [email protected]:Toni-SM/semu.xr.openxr.git # push changes git push origin --force --all git push origin --force --tags ``` ## Packaging the extension ```bash cd src/semu.xr.openxr bash package_extension.bash ```
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/compile_extension.py
import os import sys from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext # OV python (kit\python\include) if sys.platform == 'win32': python_library_dir = os.path.join(os.path.dirname(sys.executable), "include") elif sys.platform == 'linux': python_library_dir = os.path.join(os.path.dirname(sys.executable), "..", "include") if not os.path.exists(python_library_dir): raise Exception("OV Python library directory not found: {}".format(python_library_dir)) ext_modules = [ Extension("_openxr", [os.path.join("semu", "xr", "openxr", "openxr.py")], library_dirs=[python_library_dir]), ] for ext in ext_modules: ext.cython_directives = {'language_level': "3"} setup( name = 'semu.xr.openxr', cmdclass = {'build_ext': build_ext}, ext_modules = ext_modules )
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/package_extension.bash
#!/bin/bash extension_dir=../../exts/semu.xr.openxr extension_tree=semu/xr/openxr extension_ui_tree=semu/xr/openxr_ui # delete old files rm -r $extension_dir mkdir -p $extension_dir/$extension_tree mkdir -p $extension_dir/$extension_tree/scripts mkdir -p $extension_dir/$extension_tree/tests mkdir -p $extension_dir/$extension_ui_tree cp -r bin $extension_dir cp -r config $extension_dir cp -r data $extension_dir cp -r docs $extension_dir # ui cp -r $extension_ui_tree/* $extension_dir/$extension_ui_tree # scripts folder cp $extension_tree/scripts/extension.py $extension_dir/$extension_tree/scripts # tests folder cp $extension_tree/tests/__init__.py $extension_dir/$extension_tree/tests cp $extension_tree/tests/test_openxr.py $extension_dir/$extension_tree/tests # single files cp $extension_tree/__init__.py $extension_dir/$extension_tree/ cp $extension_tree/*.so $extension_dir/$extension_tree/
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/compile_extension.bash
#!/bin/bash export LIBRARY_PATH=~/.local/share/ov/pkg/code-2022.1.0/kit/python/include # delete old files . clean_extension.bash # compile code ~/.local/share/ov/pkg/code-2022.1.0/kit/python/bin/python3 compile_extension.py build_ext --inplace # move compiled file mv *.so semu/xr/openxr/ # delete temporal data rm -r build rm semu/xr/openxr/*.c
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/sources/pybind11_wrapper.cpp
#include <pybind11/pybind11.h> #include <pybind11/functional.h> #include <pybind11/numpy.h> #include <pybind11/stl.h> #include "xr.cpp" namespace py = pybind11; namespace pybind11 { namespace detail { template <> struct type_caster<XrView>{ public: PYBIND11_TYPE_CASTER(XrView, _("XrView")); // conversion from C++ to Python static handle cast(XrView src, return_value_policy /* policy */, handle /* parent */){ PyObject * fov = PyDict_New(); PyDict_SetItemString(fov, "angleLeft", PyFloat_FromDouble(src.fov.angleLeft)); PyDict_SetItemString(fov, "angleRight", PyFloat_FromDouble(src.fov.angleRight)); PyDict_SetItemString(fov, "angleUp", PyFloat_FromDouble(src.fov.angleUp)); PyDict_SetItemString(fov, "angleDown", PyFloat_FromDouble(src.fov.angleDown)); PyObject * position = PyDict_New(); PyDict_SetItemString(position, "x", PyFloat_FromDouble(src.pose.position.x)); PyDict_SetItemString(position, "y", PyFloat_FromDouble(src.pose.position.y)); PyDict_SetItemString(position, "z", PyFloat_FromDouble(src.pose.position.z)); PyObject * orientation = PyDict_New(); PyDict_SetItemString(orientation, "x", PyFloat_FromDouble(src.pose.orientation.x)); PyDict_SetItemString(orientation, "y", PyFloat_FromDouble(src.pose.orientation.y)); PyDict_SetItemString(orientation, "z", PyFloat_FromDouble(src.pose.orientation.z)); PyDict_SetItemString(orientation, "w", PyFloat_FromDouble(src.pose.orientation.w)); PyObject * pose = PyDict_New(); PyDict_SetItemString(pose, "position", position); PyDict_SetItemString(pose, "orientation", orientation); PyObject * view = PyDict_New(); PyDict_SetItemString(view, "type", PyLong_FromLong(src.type)); PyDict_SetItemString(view, "next", Py_None); PyDict_SetItemString(view, "pose", pose); PyDict_SetItemString(view, "fov", fov); return view; } }; template <> struct type_caster<XrViewConfigurationView>{ public: PYBIND11_TYPE_CASTER(XrViewConfigurationView, _("XrViewConfigurationView")); // conversion from C++ to Python static handle cast(XrViewConfigurationView src, return_value_policy /* policy */, handle /* parent */){ PyObject * configurationView = PyDict_New(); PyDict_SetItemString(configurationView, "type", PyLong_FromLong(src.type)); PyDict_SetItemString(configurationView, "next", Py_None); PyDict_SetItemString(configurationView, "recommendedImageRectWidth", PyLong_FromLong(src.recommendedImageRectWidth)); PyDict_SetItemString(configurationView, "maxImageRectWidth", PyLong_FromLong(src.maxImageRectWidth)); PyDict_SetItemString(configurationView, "recommendedImageRectHeight", PyLong_FromLong(src.recommendedImageRectHeight)); PyDict_SetItemString(configurationView, "maxImageRectHeight", PyLong_FromLong(src.maxImageRectHeight)); PyDict_SetItemString(configurationView, "recommendedSwapchainSampleCount", PyLong_FromLong(src.recommendedSwapchainSampleCount)); PyDict_SetItemString(configurationView, "maxSwapchainSampleCount", PyLong_FromLong(src.maxSwapchainSampleCount)); return configurationView; } }; template <> struct type_caster<ActionState>{ public: PYBIND11_TYPE_CASTER(ActionState, _("ActionState")); // conversion from C++ to Python static handle cast(ActionState src, return_value_policy /* policy */, handle /* parent */){ PyObject * state = PyDict_New(); PyDict_SetItemString(state, "type", PyLong_FromLong(src.type)); PyDict_SetItemString(state, "path", PyUnicode_FromString(src.path)); PyDict_SetItemString(state, "isActive", PyBool_FromLong(src.isActive)); PyDict_SetItemString(state, "stateBool", PyBool_FromLong(src.stateBool)); PyDict_SetItemString(state, "stateFloat", PyFloat_FromDouble(src.stateFloat)); PyDict_SetItemString(state, "stateVectorX", PyFloat_FromDouble(src.stateVectorX)); PyDict_SetItemString(state, "stateVectorY", PyFloat_FromDouble(src.stateVectorY)); return state; } }; template <> struct type_caster<ActionPoseState>{ public: PYBIND11_TYPE_CASTER(ActionPoseState, _("ActionPoseState")); // conversion from C++ to Python static handle cast(ActionPoseState src, return_value_policy /* policy */, handle /* parent */){ PyObject * state = PyDict_New(); PyDict_SetItemString(state, "type", PyLong_FromLong(src.type)); PyDict_SetItemString(state, "path", PyUnicode_FromString(src.path)); PyDict_SetItemString(state, "isActive", PyBool_FromLong(src.isActive)); PyObject * position = PyDict_New(); PyDict_SetItemString(position, "x", PyFloat_FromDouble(src.pose.position.x)); PyDict_SetItemString(position, "y", PyFloat_FromDouble(src.pose.position.y)); PyDict_SetItemString(position, "z", PyFloat_FromDouble(src.pose.position.z)); PyObject * orientation = PyDict_New(); PyDict_SetItemString(orientation, "x", PyFloat_FromDouble(src.pose.orientation.x)); PyDict_SetItemString(orientation, "y", PyFloat_FromDouble(src.pose.orientation.y)); PyDict_SetItemString(orientation, "z", PyFloat_FromDouble(src.pose.orientation.z)); PyDict_SetItemString(orientation, "w", PyFloat_FromDouble(src.pose.orientation.w)); PyObject * pose = PyDict_New(); PyDict_SetItemString(pose, "position", position); PyDict_SetItemString(pose, "orientation", orientation); PyDict_SetItemString(state, "pose", pose); return state; } }; }} PYBIND11_MODULE(xrlib_p, m){ py::class_<OpenXrApplication>(m, "OpenXrApplication") .def(py::init<>()) // utils .def("destroy", &OpenXrApplication::destroy) .def("isSessionRunning", &OpenXrApplication::isSessionRunning) .def("getViewConfigurationViews", &OpenXrApplication::getViewConfigurationViews) .def("getViewConfigurationViewsSize", &OpenXrApplication::getViewConfigurationViewsSize) // setup app .def("createInstance", &OpenXrApplication::createInstance) .def("getSystem", [](OpenXrApplication &m, int formFactor, int blendMode, int configurationType){ return m.getSystem(XrFormFactor(formFactor), XrEnvironmentBlendMode(blendMode), XrViewConfigurationType(configurationType)); }) .def("createSession", &OpenXrApplication::createSession) // actions .def("addAction", [](OpenXrApplication &m, string stringPath, int actionType, int referenceSpaceType){ return m.addAction(stringPath, XrActionType(actionType), XrReferenceSpaceType(referenceSpaceType)); }) .def("applyHapticFeedback", [](OpenXrApplication &m, string stringPath, float amplitude, int64_t duration, float frequency){ XrHapticVibration vibration = {XR_TYPE_HAPTIC_VIBRATION}; vibration.amplitude = amplitude; vibration.duration = XrDuration(duration); vibration.frequency = frequency; return m.applyHapticFeedback(stringPath, (XrHapticBaseHeader*)&vibration); }) .def("stopHapticFeedback", &OpenXrApplication::stopHapticFeedback) // poll data .def("pollEvents", [](OpenXrApplication &m){ bool exitLoop = true; bool returnValue = m.pollEvents(&exitLoop); return std::make_tuple(returnValue, exitLoop); }) .def("pollActions", [](OpenXrApplication &m){ vector<ActionState> actionStates; bool returnValue = m.pollActions(actionStates); return std::make_tuple(returnValue, actionStates); }) // render .def("renderViews", [](OpenXrApplication &m, int referenceSpaceType){ vector<ActionPoseState> actionPoseState; bool returnValue = m.renderViews(XrReferenceSpaceType(referenceSpaceType), actionPoseState); return std::make_tuple(returnValue, actionPoseState); }) // render utilities .def("setRenderCallback", &OpenXrApplication::setRenderCallbackFromFunction) .def("setFrames", [](OpenXrApplication &m, py::array_t<uint8_t> left, py::array_t<uint8_t> right, bool rgba){ py::buffer_info leftInfo = left.request(); if(m.getViewConfigurationViewsSize() == 1) return m.setFrameByIndex(0, leftInfo.shape[1], leftInfo.shape[0], leftInfo.ptr, rgba); else if(m.getViewConfigurationViewsSize() == 2){ py::buffer_info rightInfo = right.request(); bool status = m.setFrameByIndex(0, leftInfo.shape[1], leftInfo.shape[0], leftInfo.ptr, rgba); return status && m.setFrameByIndex(1, rightInfo.shape[1], rightInfo.shape[0], rightInfo.ptr, rgba); } return false; }); }
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/sources/compile_pybind11.bash
#!/bin/bash # delete old files . clean_compiled_files.bash rm ../bin/xrlib_p* # compile code python pybind11_ext.py build_ext --inplace # copy compiled file cp xrlib_p* ../bin/xrlib_p.so
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/sources/xr.cpp
#define XR_USE_PLATFORM_XLIB // #define XR_USE_GRAPHICS_API_VULKAN #define XR_USE_GRAPHICS_API_OPENGL // Vulkan libraries #ifdef XR_USE_GRAPHICS_API_VULKAN #define APP_USE_VULKAN2 #define STB_IMAGE_IMPLEMENTATION #include <vulkan/vulkan.h> #include "stb_image.h" #endif // OpenGL libraries #ifdef XR_USE_GRAPHICS_API_OPENGL #define GL_GLEXT_PROTOTYPES #define GL3_PROTOTYPES #include <GL/gl.h> #include <GL/glext.h> #include <GL/glx.h> #include <X11/Xlib.h> #include <SDL2/SDL.h> #include <SDL2/SDL_opengl.h> #ifdef APPLICATION_IMAGE #include <SDL2/SDL_image.h> #endif #endif #include <vector> #include <stdio.h> #include <string.h> #include <iostream> #include <algorithm> #include <functional> using namespace std; #include <openxr/openxr.h> #include <openxr/openxr_platform.h> #include <openxr/openxr_reflection.h> #ifndef _countof #define _countof(x) (sizeof(x)/sizeof((x)[0])) #endif // generate stringify functions for OpenXR enumerations #define ENUM_CASE_STR(name, val) case name: return #name; #define MAKE_TO_STRING_FUNC(enumType) \ inline const char* _enum_to_string(enumType e) { \ switch (e) { \ XR_LIST_ENUM_##enumType(ENUM_CASE_STR) \ default: return "Unknown " #enumType; \ } \ } MAKE_TO_STRING_FUNC(XrReferenceSpaceType); MAKE_TO_STRING_FUNC(XrViewConfigurationType); MAKE_TO_STRING_FUNC(XrEnvironmentBlendMode); MAKE_TO_STRING_FUNC(XrSessionState); MAKE_TO_STRING_FUNC(XrResult); MAKE_TO_STRING_FUNC(XrFormFactor); struct ActionState{ XrActionType type; const char * path; bool isActive; bool stateBool; // XR_TYPE_ACTION_STATE_BOOLEAN float stateFloat; // XR_TYPE_ACTION_STATE_FLOAT float stateVectorX; // XR_TYPE_ACTION_STATE_VECTOR2F float stateVectorY; // XR_TYPE_ACTION_STATE_VECTOR2F }; struct ActionPoseState{ XrActionType type; const char * path; bool isActive; XrPosef pose; // XR_TYPE_ACTION_STATE_POSE }; struct Action{ XrAction action; XrPath path; string stringPath; }; struct ActionPose{ XrReferenceSpaceType referenceSpaceType; XrSpace space; XrAction action; XrPath path; string stringPath; }; struct Actions{ vector<Action> aBoolean; vector<Action> aFloat; vector<Action> aVector2f; vector<ActionPose> aPose; vector<Action> aVibration; }; struct SwapchainHandler{ XrSwapchain handle; int32_t width; int32_t height; uint32_t length; #ifdef XR_USE_GRAPHICS_API_VULKAN vector<XrSwapchainImageVulkan2KHR> images; #endif #ifdef XR_USE_GRAPHICS_API_OPENGL vector<XrSwapchainImageOpenGLKHR> images; #endif }; vector<const char*> cast_to_vector_char_p(const vector<string> & input_list){ vector<const char*> output_list; for (size_t i = 0; i < input_list.size(); i++) output_list.push_back(input_list[i].data()); return output_list; } bool xrCheckResult(const XrInstance & xr_instance, const XrResult & xr_result, const string & message = ""){ if(XR_SUCCEEDED(xr_result)) return true; if(xr_instance != NULL){ char xr_result_as_string[XR_MAX_RESULT_STRING_SIZE]; xrResultToString(xr_instance, xr_result, xr_result_as_string); if(!message.empty()) std::cout << "[ERROR] " << message << " failed with code: " << xr_result << " (" << xr_result_as_string << "). " << message << std::endl; else std::cout << "[ERROR] code: " << xr_result << " (" << xr_result_as_string << ")" << std::endl; } else{ if(!message.empty()) std::cout << "[ERROR] " << message << " failed with code: " << xr_result << " (" << _enum_to_string(xr_result) << ")" << std::endl; else std::cout << "[ERROR] code: " << xr_result << " (" << _enum_to_string(xr_result) << ")" << std::endl; } return false; } // Vulkan graphics API #ifdef XR_USE_GRAPHICS_API_VULKAN class VulkanHandler{ private: XrResult xr_result; VkResult vk_result; VkInstance vk_instance; VkPhysicalDevice vk_physicalDevice = VK_NULL_HANDLE; VkDevice vk_logicalDevice; uint32_t vk_queueFamilyIndex; VkQueue vk_graphicsQueue; VkCommandPool vk_cmdPool; VkPipelineCache vk_pipelineCache; bool getRequirements(XrInstance xr_instance, XrSystemId xr_system_id); bool defineLayers(vector<const char*> requestedLayers, vector<const char*> & enabledLayers); bool defineExtensions(vector<const char*> requestedExtensions, vector<const char*> & enabledExtensions); public: VulkanHandler(); ~VulkanHandler(); void createInstance(XrInstance xr_instance, XrSystemId xr_system_id); void getPhysicalDevice(XrInstance xr_instance, XrSystemId xr_system_id); void createLogicalDevice(XrInstance xr_instance, XrSystemId xr_system_id); VkInstance getInstance(){ return vk_instance; } VkPhysicalDevice getPhysicalDevice(){ return vk_physicalDevice; } VkDevice getLogicalDevice(){ return vk_logicalDevice; } uint32_t getQueueFamilyIndex(){ return vk_queueFamilyIndex; } void renderView(const XrCompositionLayerProjectionView &, const XrSwapchainImageBaseHeader *, int64_t); uint32_t getSupportedSwapchainSampleCount(XrViewConfigurationView){ return VK_SAMPLE_COUNT_1_BIT; } void loadImageFromFile(); }; VulkanHandler::VulkanHandler(){ loadImageFromFile(); } VulkanHandler::~VulkanHandler(){ // vkDestroyInstance(vk_instance, nullptr); // vkDestroyDevice(vk_logicalDevice, nullptr); } void VulkanHandler::loadImageFromFile(){ int texWidth, texHeight, texChannels; stbi_uc* pixels = stbi_load("texture.jpg", &texWidth, &texHeight, &texChannels, STBI_rgb_alpha); VkDeviceSize imageSize = texWidth * texHeight * 4; if (!pixels) { throw std::runtime_error("failed to load texture image!"); } } bool VulkanHandler::getRequirements(XrInstance xr_instance, XrSystemId xr_system_id){ #ifdef APP_USE_VULKAN2 PFN_xrGetVulkanGraphicsRequirements2KHR pfn_xrGetVulkanGraphicsRequirements2KHR = nullptr; xrGetInstanceProcAddr(xr_instance, "xrGetVulkanGraphicsRequirements2KHR", reinterpret_cast<PFN_xrVoidFunction*>(&pfn_xrGetVulkanGraphicsRequirements2KHR)); XrGraphicsRequirementsVulkan2KHR graphicsRequirement = {XR_TYPE_GRAPHICS_REQUIREMENTS_VULKAN2_KHR}; xr_result = pfn_xrGetVulkanGraphicsRequirements2KHR(xr_instance, xr_system_id, &graphicsRequirement); if(!xrCheckResult(NULL, xr_result, "PFN_xrGetVulkanGraphicsRequirementsKHR")) return false; std::cout << "Vulkan (Vulkan2) requirements" << std::endl; #else PFN_xrGetVulkanGraphicsRequirementsKHR pfn_xrGetVulkanGraphicsRequirementsKHR = nullptr; xrGetInstanceProcAddr(xr_instance, "xrGetVulkanGraphicsRequirementsKHR", reinterpret_cast<PFN_xrVoidFunction*>(&pfn_xrGetVulkanGraphicsRequirementsKHR)); XrGraphicsRequirementsVulkanKHR graphicsRequirement = {XR_TYPE_GRAPHICS_REQUIREMENTS_VULKAN_KHR}; xr_result = pfn_xrGetVulkanGraphicsRequirementsKHR(xr_instance, xr_system_id, &graphicsRequirement); if(!xrCheckResult(NULL, xr_result, "PFN_xrGetVulkanGraphicsRequirementsKHR")) return false; std::cout << "Vulkan (Vulkan) requirements" << std::endl; #endif std::cout << " |-- min API version: " << XR_VERSION_MAJOR(graphicsRequirement.minApiVersionSupported) << "." << XR_VERSION_MINOR(graphicsRequirement.minApiVersionSupported) << "." << XR_VERSION_PATCH(graphicsRequirement.minApiVersionSupported) << std::endl; std::cout << " |-- max API version: " << XR_VERSION_MAJOR(graphicsRequirement.maxApiVersionSupported) << "." << XR_VERSION_MINOR(graphicsRequirement.maxApiVersionSupported) << "." << XR_VERSION_PATCH(graphicsRequirement.maxApiVersionSupported) << std::endl; return true; } bool VulkanHandler::defineLayers(vector<const char*> requestedLayers, vector<const char*> & enabledLayers){ uint32_t propertyCount = 0; vkEnumerateInstanceLayerProperties(&propertyCount, nullptr); std::vector<VkLayerProperties> layerProperties(propertyCount); vkEnumerateInstanceLayerProperties(&propertyCount, layerProperties.data()); std::cout << "Vulkan layers available (" << layerProperties.size() << ")" << std::endl; for (size_t i = 0; i < layerProperties.size(); i++){ std::cout << " |-- " << layerProperties[i].layerName << std::endl; for (size_t j = 0; j < requestedLayers.size(); j++) if (strcmp(layerProperties[i].layerName, requestedLayers[j]) == 0){ enabledLayers.push_back(requestedLayers[j]); std::cout << " | (requested)" << std::endl; break; } } return true; } bool VulkanHandler::defineExtensions(vector<const char*> requestedExtensions, vector<const char*> & enabledExtensions){ uint32_t propertyCount = 0; vkEnumerateInstanceExtensionProperties(nullptr, &propertyCount, nullptr); vector<VkExtensionProperties> extensionsProperties(propertyCount); vkEnumerateInstanceExtensionProperties(nullptr, &propertyCount, extensionsProperties.data()); std::cout << "Vulkan extension properties (" << extensionsProperties.size() << ")" << std::endl; for (size_t i = 0; i < extensionsProperties.size(); i++){ std::cout << " |-- " << extensionsProperties[i].extensionName << std::endl; for (size_t j = 0; j < requestedExtensions.size(); j++) if (strcmp(extensionsProperties[i].extensionName, requestedExtensions[j]) == 0){ enabledExtensions.push_back(requestedExtensions[j]); std::cout << " | (requested)" << std::endl; break; } } return true; } void VulkanHandler::createInstance(XrInstance xr_instance, XrSystemId xr_system_id){ // requirements getRequirements(xr_instance, xr_system_id); // layers vector<const char*> enabledLayers; vector<const char*> requestedLayers = { "VK_LAYER_LUNARG_core_validation" }; // TODO: see why it crashes the application // defineLayers(requestedLayers, enabledLayers); // extensions vector<const char*> enabledExtensions; vector<const char*> requestedExtensions = { "VK_EXT_debug_report" }; defineExtensions(requestedExtensions, enabledExtensions); VkApplicationInfo appInfo = {VK_STRUCTURE_TYPE_APPLICATION_INFO}; appInfo.pApplicationName = "Isaac Sim (VR)"; appInfo.applicationVersion = 1; appInfo.pEngineName = "Isaac Sim (VR)"; appInfo.engineVersion = 1; appInfo.apiVersion = VK_API_VERSION_1_0; VkInstanceCreateInfo instanceInfo = {VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO}; instanceInfo.pApplicationInfo = &appInfo; instanceInfo.enabledLayerCount = (uint32_t)enabledLayers.size(); instanceInfo.ppEnabledLayerNames = enabledLayers.empty() ? nullptr : enabledLayers.data(); instanceInfo.enabledExtensionCount = (uint32_t)enabledExtensions.size(); instanceInfo.ppEnabledExtensionNames = enabledExtensions.empty() ? nullptr : enabledExtensions.data(); XrVulkanInstanceCreateInfoKHR createInfo = {XR_TYPE_VULKAN_INSTANCE_CREATE_INFO_KHR}; createInfo.systemId = xr_system_id; createInfo.pfnGetInstanceProcAddr = vkGetInstanceProcAddr; createInfo.vulkanCreateInfo = &instanceInfo; createInfo.vulkanAllocator = nullptr; PFN_xrCreateVulkanInstanceKHR pfn_xrCreateVulkanInstanceKHR = nullptr; xr_result = xrGetInstanceProcAddr(xr_instance, "xrCreateVulkanInstanceKHR", reinterpret_cast<PFN_xrVoidFunction*>(&pfn_xrCreateVulkanInstanceKHR)); xr_result = pfn_xrCreateVulkanInstanceKHR(xr_instance, &createInfo, &vk_instance, &vk_result); } void VulkanHandler::getPhysicalDevice(XrInstance xr_instance, XrSystemId xr_system_id){ // enumerate device uint32_t propertyCount = 0; vkEnumeratePhysicalDevices(vk_instance, &propertyCount, nullptr); if(!propertyCount) throw std::runtime_error("Failed to find GPUs with Vulkan support"); vector<VkPhysicalDevice> devices(propertyCount); vkEnumeratePhysicalDevices(vk_instance, &propertyCount, devices.data()); // get physical device XrVulkanGraphicsDeviceGetInfoKHR deviceGetInfo = {XR_TYPE_VULKAN_GRAPHICS_DEVICE_GET_INFO_KHR}; deviceGetInfo.systemId = xr_system_id; deviceGetInfo.vulkanInstance = vk_instance; deviceGetInfo.next = nullptr; PFN_xrGetVulkanGraphicsDevice2KHR pfn_xrGetVulkanGraphicsDevice2KHR = nullptr; xr_result = xrGetInstanceProcAddr(xr_instance, "xrGetVulkanGraphicsDevice2KHR", reinterpret_cast<PFN_xrVoidFunction*>(&pfn_xrGetVulkanGraphicsDevice2KHR)); xr_result = pfn_xrGetVulkanGraphicsDevice2KHR(xr_instance, &deviceGetInfo, &vk_physicalDevice); std::cout << "Vulkan physical devices (" << devices.size() << ")" << std::endl; for(const auto& device : devices){ if(device == vk_physicalDevice){ std::cout << " |-- handle: " << device << std::endl; std::cout << " | (selected)"<< std::endl; } else std::cout << " |-- handle: " << device << std::endl; } } void VulkanHandler::createLogicalDevice(XrInstance xr_instance, XrSystemId xr_system_id){ uint32_t propertyCount = 0; float queuePriorities = 0; VkDeviceQueueCreateInfo queueInfo = {VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO}; queueInfo.queueCount = 1; queueInfo.pQueuePriorities = &queuePriorities; // queue families index vkGetPhysicalDeviceQueueFamilyProperties(vk_physicalDevice, &propertyCount, nullptr); vector<VkQueueFamilyProperties> queueFamilyProps(propertyCount); vkGetPhysicalDeviceQueueFamilyProperties(vk_physicalDevice, &propertyCount, &queueFamilyProps[0]); for (uint32_t i = 0; i < propertyCount; ++i) if ((queueFamilyProps[i].queueFlags & VK_QUEUE_GRAPHICS_BIT) != 0u){ queueInfo.queueFamilyIndex = i; vk_queueFamilyIndex = queueInfo.queueFamilyIndex; break; } vector<const char*> deviceExtensions; deviceExtensions.push_back("VK_KHR_external_memory"); deviceExtensions.push_back("VK_KHR_external_memory_fd"); deviceExtensions.push_back("VK_KHR_external_semaphore"); deviceExtensions.push_back("VK_KHR_external_semaphore_fd"); deviceExtensions.push_back("VK_KHR_get_memory_requirements2"); VkPhysicalDeviceFeatures features = {}; features.samplerAnisotropy = true; VkDeviceCreateInfo deviceInfo = {VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO}; deviceInfo.queueCreateInfoCount = 1; deviceInfo.pQueueCreateInfos = &queueInfo; deviceInfo.enabledLayerCount = 0; deviceInfo.ppEnabledLayerNames = nullptr; deviceInfo.enabledExtensionCount = (uint32_t)deviceExtensions.size(); deviceInfo.ppEnabledExtensionNames = deviceExtensions.empty() ? nullptr : deviceExtensions.data(); deviceInfo.pEnabledFeatures = &features; XrVulkanDeviceCreateInfoKHR createInfo = {XR_TYPE_VULKAN_DEVICE_CREATE_INFO_KHR}; createInfo.systemId = xr_system_id; createInfo.pfnGetInstanceProcAddr = vkGetInstanceProcAddr; createInfo.vulkanCreateInfo = &deviceInfo; createInfo.vulkanPhysicalDevice = vk_physicalDevice; createInfo.vulkanAllocator = nullptr; createInfo.createFlags = 0; createInfo.next = nullptr; PFN_xrCreateVulkanDeviceKHR pfn_xrCreateVulkanDeviceKHR = nullptr; xr_result = xrGetInstanceProcAddr(xr_instance, "xrCreateVulkanDeviceKHR", reinterpret_cast<PFN_xrVoidFunction*>(&pfn_xrCreateVulkanDeviceKHR)); xr_result = pfn_xrCreateVulkanDeviceKHR(xr_instance, &createInfo, &vk_logicalDevice, &vk_result); // get queue vkGetDeviceQueue(vk_logicalDevice, vk_queueFamilyIndex, 0, &vk_graphicsQueue); // m_memAllocator.Init(m_vkPhysicalDevice, m_vkDevice); VkPipelineCacheCreateInfo info = {VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO}; vkCreatePipelineCache(vk_logicalDevice, &info, nullptr, &vk_pipelineCache); VkCommandPoolCreateInfo cmdPoolInfo = {VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO}; cmdPoolInfo.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT; cmdPoolInfo.queueFamilyIndex = vk_queueFamilyIndex; vk_result = vkCreateCommandPool(vk_logicalDevice, &cmdPoolInfo, nullptr, &vk_cmdPool); } void VulkanHandler::renderView(const XrCompositionLayerProjectionView & layerView, const XrSwapchainImageBaseHeader * swapchainImage, int64_t swapchainFormat){ std::cout << "layerView.subImage.imageArrayIndex: " << layerView.subImage.imageArrayIndex << std::endl; } #endif // OpenGL graphics API #ifdef XR_USE_GRAPHICS_API_OPENGL void GLAPIENTRY MessageCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam){ std::cout << "GL CALLBACK: " << (type == GL_DEBUG_TYPE_ERROR ? "** GL ERROR **" : "") << " type = 0x" << type << ", severity = 0x" << severity << ", message = " << message << std::endl; } static const char* glslShaderVertex = R"_( #version 410 out vec2 v_tex; const vec2 pos[4]=vec2[4](vec2(-1.0, 1.0), vec2(-1.0,-1.0), vec2( 1.0, 1.0), vec2( 1.0,-1.0)); void main(){ v_tex=0.5*pos[gl_VertexID] + vec2(0.5); gl_Position=vec4(pos[gl_VertexID], 0.0, 1.0); } )_"; static const char* glslShaderFragment = R"_( #version 410 in vec2 v_tex; uniform sampler2D texSampler; out vec4 color; void main(){ color=texture(texSampler, v_tex); } )_"; class OpenGLHandler{ private: XrResult xr_result; SDL_Window * sdl_window; SDL_GLContext gl_context; PFNGLBLITNAMEDFRAMEBUFFERPROC _glBlitNamedFramebuffer; GLuint vao; GLuint program; GLuint texture; GLuint swapchainFramebuffer; bool checkShader(GLuint); bool checkProgram(GLuint); void loadTexture(string, GLuint *); public: OpenGLHandler(); ~OpenGLHandler(); bool getRequirements(XrInstance xr_instance, XrSystemId xr_system_id); bool initGraphicsBinding(Display** xDisplay, uint32_t* visualid, GLXFBConfig* glxFBConfig, GLXDrawable* glxDrawable, GLXContext* glxContext, int witdh, int height); bool initResources(XrInstance xr_instance, XrSystemId xr_system_id); void acquireContext(XrGraphicsBindingOpenGLXlibKHR, string); void renderView(const XrCompositionLayerProjectionView &, const XrSwapchainImageBaseHeader *, int64_t); void renderViewFromImage(const XrCompositionLayerProjectionView &, const XrSwapchainImageBaseHeader *, int64_t, int, int, void *, bool); uint32_t getSupportedSwapchainSampleCount(XrViewConfigurationView){ return 1; } }; OpenGLHandler::OpenGLHandler() { } OpenGLHandler::~OpenGLHandler() { } void OpenGLHandler::loadTexture(string path, GLuint * textureId){ #ifdef APPLICATION_IMAGE int mode = GL_RGB; SDL_Surface *tex = IMG_Load(path.c_str()); if(tex->format->BitsPerPixel >= 4) mode = GL_RGBA; else mode = GL_RGB; glGenTextures(1, textureId); glBindTexture(GL_TEXTURE_2D, *textureId); glTexImage2D(GL_TEXTURE_2D, 0, mode, tex->w, tex->h, 0, mode, GL_UNSIGNED_BYTE, tex->pixels); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); #endif } bool OpenGLHandler::checkShader(GLuint shader){ GLint r = 0; glGetShaderiv(shader, GL_COMPILE_STATUS, &r); if(r == GL_FALSE){ GLchar msg[4096] = {}; GLsizei length; glGetShaderInfoLog(shader, sizeof(msg), &length, msg); std::cout << "GL SHADER: " << msg << std::endl; return false; } return true; } bool OpenGLHandler::checkProgram(GLuint prog) { GLint r = 0; glGetProgramiv(prog, GL_LINK_STATUS, &r); if(r == GL_FALSE){ GLchar msg[4096] = {}; GLsizei length; glGetProgramInfoLog(prog, sizeof(msg), &length, msg); std::cout << "GL SHADER: " << msg << std::endl; return false; } return true; } void OpenGLHandler::acquireContext(XrGraphicsBindingOpenGLXlibKHR graphicsBinding, string message){ GLXContext context = glXGetCurrentContext(); if(context != graphicsBinding.glxContext){ // std::cout << "glxContext changed (" << context << " != " << graphicsBinding.glxContext << ") in "<< message << std::endl; glXMakeCurrent(graphicsBinding.xDisplay, graphicsBinding.glxDrawable, graphicsBinding.glxContext); } } bool OpenGLHandler::initGraphicsBinding(Display** xDisplay, uint32_t* visualid, GLXFBConfig* glxFBConfig, GLXDrawable* glxDrawable, GLXContext* glxContext, int witdh, int height){ if(SDL_Init(SDL_INIT_VIDEO) < 0){ std::cout << "Unable to initialize SDL" << std::endl; return false; } SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2); SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 0); // create our window centered at half the VR resolution sdl_window = SDL_CreateWindow("Omniverse (VR)", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, witdh / 2, height / 2, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN); if (!sdl_window){ std::cout << "Unable to create SDL window" << std::endl; return false; } gl_context = SDL_GL_CreateContext(sdl_window); glEnable(GL_DEBUG_OUTPUT); glDebugMessageCallback(MessageCallback, 0); SDL_GL_SetSwapInterval(0); _glBlitNamedFramebuffer = (PFNGLBLITNAMEDFRAMEBUFFERPROC)glXGetProcAddressARB((GLubyte*)"glBlitNamedFramebuffer"); *xDisplay = XOpenDisplay(NULL); *glxContext = glXGetCurrentContext(); *glxDrawable = glXGetCurrentDrawable(); SDL_HideWindow(sdl_window); return true; } bool OpenGLHandler::getRequirements(XrInstance xr_instance, XrSystemId xr_system_id){ PFN_xrGetOpenGLGraphicsRequirementsKHR pfn_xrGetOpenGLGraphicsRequirementsKHR = nullptr; xr_result = xrGetInstanceProcAddr(xr_instance, "xrGetOpenGLGraphicsRequirementsKHR", reinterpret_cast<PFN_xrVoidFunction*>(&pfn_xrGetOpenGLGraphicsRequirementsKHR)); if(!xrCheckResult(NULL, xr_result, "xrGetOpenGLGraphicsRequirementsKHR (xrGetInstanceProcAddr)")) return false; XrGraphicsRequirementsOpenGLKHR graphicsRequirement = {XR_TYPE_GRAPHICS_REQUIREMENTS_OPENGL_KHR}; xr_result = pfn_xrGetOpenGLGraphicsRequirementsKHR(xr_instance, xr_system_id, &graphicsRequirement); if(!xrCheckResult(NULL, xr_result, "xrGetOpenGLGraphicsRequirementsKHR")) return false; std::cout << "OpenGL requirements" << std::endl; std::cout << " |-- min API version: " << XR_VERSION_MAJOR(graphicsRequirement.minApiVersionSupported) << "." << XR_VERSION_MINOR(graphicsRequirement.minApiVersionSupported) << "." << XR_VERSION_PATCH(graphicsRequirement.minApiVersionSupported) << std::endl; std::cout << " |-- max API version: " << XR_VERSION_MAJOR(graphicsRequirement.maxApiVersionSupported) << "." << XR_VERSION_MINOR(graphicsRequirement.maxApiVersionSupported) << "." << XR_VERSION_PATCH(graphicsRequirement.maxApiVersionSupported) << std::endl; return true; } bool OpenGLHandler::initResources(XrInstance xr_instance, XrSystemId xr_system_id){ glGenTextures(1, &texture); glGenVertexArrays(1, &vao); glGenFramebuffers(1, &swapchainFramebuffer); GLuint vertexShader = glCreateShader(GL_VERTEX_SHADER); glShaderSource(vertexShader, 1, &glslShaderVertex, nullptr); glCompileShader(vertexShader); if(!checkShader(vertexShader)) return false; GLuint fragmentShader = glCreateShader(GL_FRAGMENT_SHADER); glShaderSource(fragmentShader, 1, &glslShaderFragment, nullptr); glCompileShader(fragmentShader); if(!checkShader(fragmentShader)) return false; program = glCreateProgram(); glAttachShader(program, vertexShader); glAttachShader(program, fragmentShader); glLinkProgram(program); if(!checkProgram(program)) return false; glDeleteShader(vertexShader); glDeleteShader(fragmentShader); return true; } void OpenGLHandler::renderView(const XrCompositionLayerProjectionView & layerView, const XrSwapchainImageBaseHeader * swapchainImage, int64_t swapchainFormat){ glBindFramebuffer(GL_FRAMEBUFFER, swapchainFramebuffer); const uint32_t colorTexture = reinterpret_cast<const XrSwapchainImageOpenGLKHR*>(swapchainImage)->image; glViewport(static_cast<GLint>(layerView.subImage.imageRect.offset.x), static_cast<GLint>(layerView.subImage.imageRect.offset.y), static_cast<GLsizei>(layerView.subImage.imageRect.extent.width), static_cast<GLsizei>(layerView.subImage.imageRect.extent.height)); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colorTexture, 0); glUseProgram(program); glBindTexture(GL_TEXTURE_2D, texture); glBindVertexArray(vao); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); glBindTexture(GL_TEXTURE_2D, 0); glUseProgram(0); glBindFramebuffer(GL_FRAMEBUFFER, 0); // render to window int width, height; SDL_GetWindowSize(sdl_window, &width, &height); glViewport(0, 0, width, height); glUseProgram(program); glBindTexture(GL_TEXTURE_2D, texture); glBindVertexArray(vao); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); // swap window every other eye static int everyOther = 0; if((everyOther++ & 1) != 0) SDL_GL_SwapWindow(sdl_window); glBindTexture(GL_TEXTURE_2D, 0); glUseProgram(0); } void OpenGLHandler::renderViewFromImage(const XrCompositionLayerProjectionView & layerView, const XrSwapchainImageBaseHeader * swapchainImage, int64_t swapchainFormat, int frameWidth, int frameHeight, void * frameData, bool rgba){ // load texture glBindTexture(GL_TEXTURE_2D, texture); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, frameWidth, frameHeight, 0, rgba ? GL_RGBA : GL_RGB, GL_UNSIGNED_BYTE, frameData); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); // render to hmd glBindFramebuffer(GL_FRAMEBUFFER, swapchainFramebuffer); const uint32_t colorTexture = reinterpret_cast<const XrSwapchainImageOpenGLKHR*>(swapchainImage)->image; glViewport(static_cast<GLint>(layerView.subImage.imageRect.offset.x), static_cast<GLint>(layerView.subImage.imageRect.offset.y), static_cast<GLsizei>(layerView.subImage.imageRect.extent.width), static_cast<GLsizei>(layerView.subImage.imageRect.extent.height)); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colorTexture, 0); glUseProgram(program); glBindTexture(GL_TEXTURE_2D, texture); glBindVertexArray(vao); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); glBindTexture(GL_TEXTURE_2D, 0); glUseProgram(0); glBindFramebuffer(GL_FRAMEBUFFER, 0); // // render to window // int width, height; // SDL_GetWindowSize(sdl_window, &width, &height); // glViewport(0, 0, width, height); // glUseProgram(program); // glBindTexture(GL_TEXTURE_2D, texture); // glBindVertexArray(vao); // glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); // // swap window every other eye // static int everyOther = 0; // if((everyOther++ & 1) != 0) // SDL_GL_SwapWindow(sdl_window); // glBindTexture(GL_TEXTURE_2D, 0); // glUseProgram(0); } #endif class OpenXrApplication{ private: XrResult xr_result; XrInstance xr_instance = {}; XrSystemId xr_system_id = XR_NULL_SYSTEM_ID; XrSession xr_session = {}; XrSpace xr_space_view = {}; XrSpace xr_space_local = {}; XrSpace xr_space_stage = {}; // actions XrActionSet xr_action_set; Actions xr_actions; vector<SwapchainHandler> xr_swapchains_handlers; vector<XrViewConfigurationView> xr_view_configuration_views; bool xr_frames_is_rgba; vector<int> xr_frames_width; vector<int> xr_frames_height; vector<void*> xr_frames_data; void (*renderCallback)(int, XrView*, XrViewConfigurationView*); function<void(int, vector<XrView>, vector<XrViewConfigurationView>)> renderCallbackFunction; bool flagSessionRunning = false; // config XrEnvironmentBlendMode environmentBlendMode = XR_ENVIRONMENT_BLEND_MODE_MAX_ENUM; XrViewConfigurationType configViewConfigurationType = XR_VIEW_CONFIGURATION_TYPE_MAX_ENUM; #ifdef XR_USE_GRAPHICS_API_VULKAN XrGraphicsBindingVulkan2KHR xr_graphics_binding = {XR_TYPE_GRAPHICS_BINDING_VULKAN2_KHR}; VulkanHandler xr_graphics_handler; #endif #ifdef XR_USE_GRAPHICS_API_OPENGL XrGraphicsBindingOpenGLXlibKHR xr_graphics_binding = {XR_TYPE_GRAPHICS_BINDING_OPENGL_XLIB_KHR}; OpenGLHandler xr_graphics_handler; #endif bool defineLayers(const vector<string> &, vector<string> &); bool defineExtensions(const vector<string> &, vector<string> &); bool acquireInstanceProperties(); bool acquireSystemProperties(); bool acquireViewConfiguration(XrViewConfigurationType); bool acquireBlendModes(XrEnvironmentBlendMode); bool defineReferenceSpaces(); void defineInteractionProfileBindings(vector<XrActionSuggestedBinding> &, const vector<string> &); bool suggestInteractionProfileBindings(); bool defineSessionSpaces(); bool defineSwapchains(); void cleanFrames(){ // for(size_t i = 0; i < xr_frames_data.size(); i++){ // xr_frames_data[i] = nullptr; // xr_frames_width[i] = 0; // xr_frames_height[i] = 0; // } }; public: OpenXrApplication(); ~OpenXrApplication(); bool destroy(); bool createInstance(const string &, const string &, const vector<string> &, const vector<string> &); bool getSystem(XrFormFactor, XrEnvironmentBlendMode, XrViewConfigurationType); bool createSession(); bool pollEvents(bool *); bool pollActions(vector<ActionState> &); bool renderViews(XrReferenceSpaceType, vector<ActionPoseState> &); bool addAction(string, XrActionType, XrReferenceSpaceType); bool applyHapticFeedback(string, XrHapticBaseHeader *); bool stopHapticFeedback(string); bool setFrameByIndex(int, int, int, void *, bool); void setRenderCallbackFromPointer(void (*callback)(int, XrView*, XrViewConfigurationView*)){ renderCallback = callback; }; void setRenderCallbackFromFunction(function<void(int, vector<XrView>, vector<XrViewConfigurationView>)> &callback){ renderCallbackFunction = callback; }; bool isSessionRunning(){ return flagSessionRunning; } int getViewConfigurationViewsSize(){ return xr_view_configuration_views.size(); } vector<XrViewConfigurationView> getViewConfigurationViews(){ return xr_view_configuration_views; } }; OpenXrApplication::OpenXrApplication(){ renderCallback = nullptr; renderCallbackFunction = nullptr; } OpenXrApplication::~OpenXrApplication(){ destroy(); } bool OpenXrApplication::destroy(){ if(xr_instance != NULL){ std::cout << "Destroying OpenXR application" << std::endl; for(size_t i = 0; i < xr_actions.aPose.size(); i++) xrDestroySpace(xr_actions.aPose[i].space); xrDestroyActionSet(xr_action_set); for(size_t i = 0; i < xr_swapchains_handlers.size(); i++) xrDestroySwapchain(xr_swapchains_handlers[i].handle); xrDestroySpace(xr_space_view); xrDestroySpace(xr_space_local); xrDestroySpace(xr_space_stage); xrDestroySession(xr_session); xrDestroyInstance(xr_instance); xr_instance = {}; xr_system_id = XR_NULL_SYSTEM_ID; xr_session = {}; std::cout << "OpenXR application destroyed" << std::endl; } return true; } bool OpenXrApplication::defineLayers(const vector<string> & requestedApiLayers, vector<string> & enabledApiLayers){ uint32_t propertyCountOutput; xr_result = xrEnumerateApiLayerProperties(0, &propertyCountOutput, nullptr); if(!xrCheckResult(NULL, xr_result, "xrEnumerateApiLayerProperties")) return false; vector<XrApiLayerProperties> apiLayerProperties(propertyCountOutput, {XR_TYPE_API_LAYER_PROPERTIES}); xr_result = xrEnumerateApiLayerProperties(propertyCountOutput, &propertyCountOutput, apiLayerProperties.data()); if(!xrCheckResult(NULL, xr_result, "xrEnumerateApiLayerProperties")) return false; std::cout << "OpenXR API layers (" << apiLayerProperties.size() << ")" << std::endl; for(size_t i = 0; i < apiLayerProperties.size(); i++){ std::cout << " |-- " << apiLayerProperties[i].layerName << std::endl; for(size_t j = 0; j < requestedApiLayers.size(); j++) if(!requestedApiLayers[j].compare(apiLayerProperties[i].layerName)){ enabledApiLayers.push_back(requestedApiLayers[j]); std::cout << " | (requested)" << std::endl; break; } } // check for unavailable layers if(requestedApiLayers.size() != enabledApiLayers.size()){ bool used = false; std::cout << "Unavailable OpenXR API layers" << std::endl; for(size_t i = 0; i < requestedApiLayers.size(); i++){ used = false; for(size_t j = 0; j < enabledApiLayers.size(); j++) if(!requestedApiLayers[i].compare(enabledApiLayers[j])){ used = true; break; } if(!used) std::cout << " |-- " << requestedApiLayers[i] << std::endl; } return false; } return true; } bool OpenXrApplication::defineExtensions(const vector<string> & requestedExtensions, vector<string> & enabledExtensions){ uint32_t propertyCountOutput; xr_result = xrEnumerateInstanceExtensionProperties(nullptr, 0, &propertyCountOutput, nullptr); if(!xrCheckResult(NULL, xr_result, "xrEnumerateInstanceExtensionProperties")) return false; vector<XrExtensionProperties> extensionProperties(propertyCountOutput, {XR_TYPE_EXTENSION_PROPERTIES}); xr_result = xrEnumerateInstanceExtensionProperties(nullptr, propertyCountOutput, &propertyCountOutput, extensionProperties.data()); if(!xrCheckResult(NULL, xr_result, "xrEnumerateInstanceExtensionProperties")) return false; std::cout << "OpenXR extensions (" << extensionProperties.size() << ")" << std::endl; for(size_t i = 0; i < extensionProperties.size(); i++){ std::cout << " |-- " << extensionProperties[i].extensionName << std::endl; for(size_t j = 0; j < requestedExtensions.size(); j++) if(!requestedExtensions[j].compare(extensionProperties[i].extensionName)){ enabledExtensions.push_back(requestedExtensions[j]); std::cout << " | (requested)" << std::endl; break; } } // check for unavailable extensions if(requestedExtensions.size() != enabledExtensions.size()){ bool used = false; std::cout << "Unavailable OpenXR extensions" << std::endl; for(size_t i = 0; i < requestedExtensions.size(); i++){ used = false; for(size_t j = 0; j < enabledExtensions.size(); j++) if(!requestedExtensions[i].compare(enabledExtensions[j])){ used = true; break; } if(!used) std::cout << " |-- " << requestedExtensions[i] << std::endl; } return false; } return true; } bool OpenXrApplication::acquireInstanceProperties(){ XrInstanceProperties instanceProperties = {XR_TYPE_INSTANCE_PROPERTIES}; xr_result = xrGetInstanceProperties(xr_instance, &instanceProperties); if(!xrCheckResult(xr_instance, xr_result, "xrGetInstanceProperties")) return false; std::cout << "Runtime" << std::endl; std::cout << " |-- name: " << instanceProperties.runtimeName << std::endl; std::cout << " |-- version: " << XR_VERSION_MAJOR(instanceProperties.runtimeVersion) << "." << XR_VERSION_MINOR(instanceProperties.runtimeVersion) << "." << XR_VERSION_PATCH(instanceProperties.runtimeVersion) << std::endl; return true; } bool OpenXrApplication::acquireSystemProperties(){ XrSystemProperties systemProperties = {XR_TYPE_SYSTEM_PROPERTIES}; xr_result = xrGetSystemProperties(xr_instance, xr_system_id, &systemProperties); if(!xrCheckResult(xr_instance, xr_result, "xrGetSystemProperties")) return false; std::cout << "System" << std::endl; std::cout << " |-- system id: " << systemProperties.systemId << std::endl; std::cout << " |-- system name: " << systemProperties.systemName << std::endl; std::cout << " |-- vendor id: " << systemProperties.vendorId << std::endl; std::cout << " |-- max layers: " << systemProperties.graphicsProperties.maxLayerCount << std::endl; std::cout << " |-- max swapchain height: " << systemProperties.graphicsProperties.maxSwapchainImageHeight << std::endl; std::cout << " |-- max swapchain width: " << systemProperties.graphicsProperties.maxSwapchainImageWidth << std::endl; std::cout << " |-- orientation tracking: " << systemProperties.trackingProperties.orientationTracking << std::endl; std::cout << " |-- position tracking: " << systemProperties.trackingProperties.positionTracking << std::endl; return true; } bool OpenXrApplication::acquireViewConfiguration(XrViewConfigurationType configurationType){ uint32_t propertyCountOutput; xr_result = xrEnumerateViewConfigurations(xr_instance, xr_system_id, 0, &propertyCountOutput, nullptr); if(!xrCheckResult(xr_instance, xr_result, "xrEnumerateViewConfigurations")) return false; vector<XrViewConfigurationType> viewConfigurationTypes(propertyCountOutput); xr_result = xrEnumerateViewConfigurations(xr_instance, xr_system_id, propertyCountOutput, &propertyCountOutput, viewConfigurationTypes.data()); if(!xrCheckResult(xr_instance, xr_result, "xrEnumerateViewConfigurations")) return false; std::cout << "View configurations (" << viewConfigurationTypes.size() << ")" << std::endl; for(size_t i = 0; i < viewConfigurationTypes.size(); i++){ std::cout << " |-- type " << viewConfigurationTypes[i] << " (https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrViewConfigurationType)" << std::endl; if(viewConfigurationTypes[i] == configurationType){ std::cout << " | (requested)" << std::endl; configViewConfigurationType = configurationType; } } if(configViewConfigurationType == XR_VIEW_CONFIGURATION_TYPE_MAX_ENUM){ std::cout << "Unavailable view configuration type: " << configurationType << " (https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrViewConfigurationType)" << std::endl; return false; } // view configuration properties XrViewConfigurationProperties viewConfigurationProperties = {XR_TYPE_VIEW_CONFIGURATION_PROPERTIES}; xr_result = xrGetViewConfigurationProperties(xr_instance, xr_system_id, configViewConfigurationType, &viewConfigurationProperties); if(!xrCheckResult(xr_instance, xr_result, "xrGetViewConfigurationProperties")) return false; std::cout << "View configuration properties" << std::endl; std::cout << " |-- configuration type: " << viewConfigurationProperties.viewConfigurationType << " (https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrViewConfigurationType)" << std::endl; std::cout << " |-- fov mutable (bool): " << viewConfigurationProperties.fovMutable << std::endl; // view configuration views xr_result = xrEnumerateViewConfigurationViews(xr_instance, xr_system_id, configViewConfigurationType, 0, &propertyCountOutput, nullptr); if(!xrCheckResult(xr_instance, xr_result, "xrEnumerateViewConfigurationViews")) return false; xr_view_configuration_views.resize(propertyCountOutput, {XR_TYPE_VIEW_CONFIGURATION_VIEW}); xr_result = xrEnumerateViewConfigurationViews(xr_instance, xr_system_id, configViewConfigurationType, propertyCountOutput, &propertyCountOutput, xr_view_configuration_views.data()); if(!xrCheckResult(xr_instance, xr_result, "xrEnumerateViewConfigurationViews")) return false; std::cout << "View configuration views (" << xr_view_configuration_views.size() << ")" << std::endl; for(size_t i = 0; i < xr_view_configuration_views.size(); i++){ std::cout << " |-- view " << i << std::endl; std::cout << " | |-- recommended resolution: " << xr_view_configuration_views[i].recommendedImageRectWidth << " x " << xr_view_configuration_views[i].recommendedImageRectHeight << std::endl; std::cout << " | |-- max resolution: " << xr_view_configuration_views[i].maxImageRectWidth << " x " << xr_view_configuration_views[i].maxImageRectHeight << std::endl; std::cout << " | |-- recommended swapchain samples: " << xr_view_configuration_views[i].recommendedSwapchainSampleCount << std::endl; std::cout << " | |-- max swapchain samples: " << xr_view_configuration_views[i].maxSwapchainSampleCount << std::endl; } // resize frame buffers xr_frames_data.resize(xr_view_configuration_views.size()); xr_frames_width.resize(xr_view_configuration_views.size()); xr_frames_height.resize(xr_view_configuration_views.size()); cleanFrames(); return true; } bool OpenXrApplication::acquireBlendModes(XrEnvironmentBlendMode blendMode){ uint32_t propertyCountOutput; xr_result = xrEnumerateEnvironmentBlendModes(xr_instance, xr_system_id, configViewConfigurationType, 0, &propertyCountOutput, nullptr); if(!xrCheckResult(xr_instance, xr_result, "xrEnumerateEnvironmentBlendModes")) return false; vector<XrEnvironmentBlendMode> environmentBlendModes(propertyCountOutput); xr_result = xrEnumerateEnvironmentBlendModes(xr_instance, xr_system_id, configViewConfigurationType, propertyCountOutput, &propertyCountOutput, environmentBlendModes.data()); if(!xrCheckResult(xr_instance, xr_result, "xrEnumerateEnvironmentBlendModes")) return false; std::cout << "Environment blend modes (" << environmentBlendModes.size() << ")" << std::endl; for (size_t i = 0; i < environmentBlendModes.size(); i++){ std::cout << " |-- mode: " << environmentBlendModes[i] << " (https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrEnvironmentBlendMode)" << std::endl; if(environmentBlendModes[i] == blendMode){ std::cout << " | (requested)" << std::endl; environmentBlendMode = blendMode; } } if(environmentBlendMode == XR_ENVIRONMENT_BLEND_MODE_MAX_ENUM){ std::cout << "Unavailable blend mode: " << blendMode << " (https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrEnvironmentBlendMode)" << std::endl; return false; } return true; } bool OpenXrApplication::defineReferenceSpaces(){ // get reference spaces uint32_t propertyCountOutput; xr_result = xrEnumerateReferenceSpaces(xr_session, 0, &propertyCountOutput, nullptr); if(!xrCheckResult(xr_instance, xr_result, "xrEnumerateReferenceSpaces")) return false; vector<XrReferenceSpaceType> referenceSpaces(propertyCountOutput); xr_result = xrEnumerateReferenceSpaces(xr_session, propertyCountOutput, &propertyCountOutput, referenceSpaces.data()); if(!xrCheckResult(xr_instance, xr_result, "xrEnumerateReferenceSpaces")) return false; // create reference space XrPosef pose; pose.orientation = { .x = 0, .y = 0, .z = 0, .w = 1.0 }; pose.position = { .x = 0, .y = 0, .z = 0 }; XrReferenceSpaceCreateInfo referenceSpaceCreateInfo = {XR_TYPE_REFERENCE_SPACE_CREATE_INFO}; referenceSpaceCreateInfo.poseInReferenceSpace = pose; XrExtent2Df spaceBounds; std::cout << "Reference spaces (" << referenceSpaces.size() << ")" << std::endl; for (size_t i = 0; i < referenceSpaces.size(); i++){ referenceSpaceCreateInfo.referenceSpaceType = referenceSpaces[i]; std::cout << " |-- type: " << referenceSpaces[i] << " (https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrReferenceSpaceType)" << std::endl; // view if(referenceSpaces[i] == XR_REFERENCE_SPACE_TYPE_VIEW){ xr_result = xrCreateReferenceSpace(xr_session, &referenceSpaceCreateInfo, &xr_space_view); if(!xrCheckResult(xr_instance, xr_result, "xrCreateReferenceSpace (XR_REFERENCE_SPACE_TYPE_VIEW)")) return false; // get bounds xr_result = xrGetReferenceSpaceBoundsRect(xr_session, XR_REFERENCE_SPACE_TYPE_VIEW, &spaceBounds); if(!xrCheckResult(xr_instance, xr_result, "xrGetReferenceSpaceBoundsRect (XR_REFERENCE_SPACE_TYPE_VIEW)")) return false; std::cout << " | |-- reference space bounds" << std::endl; std::cout << " | | |-- width: " << spaceBounds.width << std::endl; std::cout << " | | |-- height: " << spaceBounds.height << std::endl; } // local else if(referenceSpaces[i] == XR_REFERENCE_SPACE_TYPE_LOCAL){ xr_result = xrCreateReferenceSpace(xr_session, &referenceSpaceCreateInfo, &xr_space_local); if(!xrCheckResult(xr_instance, xr_result, "xrCreateReferenceSpace (XR_REFERENCE_SPACE_TYPE_LOCAL)")) return false; // get bounds xr_result = xrGetReferenceSpaceBoundsRect(xr_session, XR_REFERENCE_SPACE_TYPE_LOCAL, &spaceBounds); if(!xrCheckResult(xr_instance, xr_result, "xrGetReferenceSpaceBoundsRect (XR_REFERENCE_SPACE_TYPE_LOCAL)")) return false; std::cout << " | |-- reference space bounds" << std::endl; std::cout << " | | |-- width: " << spaceBounds.width << std::endl; std::cout << " | | |-- height: " << spaceBounds.height << std::endl; } // stage else if(referenceSpaces[i] == XR_REFERENCE_SPACE_TYPE_STAGE){ xr_result = xrCreateReferenceSpace(xr_session, &referenceSpaceCreateInfo, &xr_space_stage); if(!xrCheckResult(xr_instance, xr_result, "xrCreateReferenceSpace (XR_REFERENCE_SPACE_TYPE_STAGE)")) return false; // get bounds xr_result = xrGetReferenceSpaceBoundsRect(xr_session, XR_REFERENCE_SPACE_TYPE_STAGE, &spaceBounds); if(!xrCheckResult(xr_instance, xr_result, "xrGetReferenceSpaceBoundsRect (XR_REFERENCE_SPACE_TYPE_STAGE)")) return false; std::cout << " | |-- reference space bounds" << std::endl; std::cout << " | | |-- width: " << spaceBounds.width << std::endl; std::cout << " | | |-- height: " << spaceBounds.height << std::endl; } } return true; } void OpenXrApplication::defineInteractionProfileBindings(vector<XrActionSuggestedBinding> & bindings, const vector<string> & validPaths){ for(size_t i = 0; i < xr_actions.aBoolean.size(); i++) if(std::find(validPaths.begin(), validPaths.end(), xr_actions.aBoolean[i].stringPath) != validPaths.end()){ XrActionSuggestedBinding binding; binding.action = xr_actions.aBoolean[i].action; binding.binding = xr_actions.aBoolean[i].path; bindings.push_back(binding); } for(size_t i = 0; i < xr_actions.aFloat.size(); i++) if(std::find(validPaths.begin(), validPaths.end(), xr_actions.aFloat[i].stringPath) != validPaths.end()){ XrActionSuggestedBinding binding; binding.action = xr_actions.aFloat[i].action; binding.binding = xr_actions.aFloat[i].path; bindings.push_back(binding); } for(size_t i = 0; i < xr_actions.aVector2f.size(); i++) if(std::find(validPaths.begin(), validPaths.end(), xr_actions.aVector2f[i].stringPath) != validPaths.end()){ XrActionSuggestedBinding binding; binding.action = xr_actions.aVector2f[i].action; binding.binding = xr_actions.aVector2f[i].path; bindings.push_back(binding); } for(size_t i = 0; i < xr_actions.aPose.size(); i++) if(std::find(validPaths.begin(), validPaths.end(), xr_actions.aPose[i].stringPath) != validPaths.end()){ XrActionSuggestedBinding binding; binding.action = xr_actions.aPose[i].action; binding.binding = xr_actions.aPose[i].path; bindings.push_back(binding); } for(size_t i = 0; i < xr_actions.aVibration.size(); i++) if(std::find(validPaths.begin(), validPaths.end(), xr_actions.aVibration[i].stringPath) != validPaths.end()){ XrActionSuggestedBinding binding; binding.action = xr_actions.aVibration[i].action; binding.binding = xr_actions.aVibration[i].path; bindings.push_back(binding); } } bool OpenXrApplication::suggestInteractionProfileBindings(){ vector<string> validPathsKhronosSimpleController = {{"/user/hand/left/input/select/click"}, {"/user/hand/left/input/menu/click"}, {"/user/hand/left/input/grip/pose"}, {"/user/hand/left/input/aim/pose"}, {"/user/hand/left/output/haptic"}, {"/user/hand/right/input/select/click"}, {"/user/hand/right/input/menu/click"}, {"/user/hand/right/input/grip/pose"}, {"/user/hand/right/input/aim/pose"}, {"/user/hand/right/output/haptic"}}; vector<string> validPathsGoogleDaydreamController = {{"/user/hand/left/input/select/click"}, {"/user/hand/left/input/trackpad/x"}, {"/user/hand/left/input/trackpad/y"}, {"/user/hand/left/input/trackpad/click"}, {"/user/hand/left/input/trackpad/touch"}, {"/user/hand/left/input/grip/pose"}, {"/user/hand/left/input/aim/pose"}, {"/user/hand/right/input/select/click"}, {"/user/hand/right/input/trackpad/x"}, {"/user/hand/right/input/trackpad/y"}, {"/user/hand/right/input/trackpad/click"}, {"/user/hand/right/input/trackpad/touch"}, {"/user/hand/right/input/grip/pose"}, {"/user/hand/right/input/aim/pose"}}; vector<string> validPathsHTCViveController = {{"/user/hand/left/input/system/click"}, {"/user/hand/left/input/squeeze/click"}, {"/user/hand/left/input/menu/click"}, {"/user/hand/left/input/trigger/click"}, {"/user/hand/left/input/trigger/value"}, {"/user/hand/left/input/trackpad/x"}, {"/user/hand/left/input/trackpad/y"}, {"/user/hand/left/input/trackpad/click"}, {"/user/hand/left/input/trackpad/touch"}, {"/user/hand/left/input/grip/pose"}, {"/user/hand/left/input/aim/pose"}, {"/user/hand/left/output/haptic"}, {"/user/hand/right/input/system/click"}, {"/user/hand/right/input/squeeze/click"}, {"/user/hand/right/input/menu/click"}, {"/user/hand/right/input/trigger/click"}, {"/user/hand/right/input/trigger/value"}, {"/user/hand/right/input/trackpad/x"}, {"/user/hand/right/input/trackpad/y"}, {"/user/hand/right/input/trackpad/click"}, {"/user/hand/right/input/trackpad/touch"}, {"/user/hand/right/input/grip/pose"}, {"/user/hand/right/input/aim/pose"}, {"/user/hand/right/output/haptic"}}; vector<string> validPathsHTCVivePro = {{"/user/head/input/system/click"}, {"/user/head/input/volume_up/click"}, {"/user/head/input/volume_down/click"}, {"/user/head/input/mute_mic/click"}}; vector<string> validPathsMicrosoftMixedRealityMotionController = {{"/user/hand/left/input/menu/click"}, {"/user/hand/left/input/squeeze/click"}, {"/user/hand/left/input/trigger/value"}, {"/user/hand/left/input/thumbstick/x"}, {"/user/hand/left/input/thumbstick/y"}, {"/user/hand/left/input/thumbstick/click"}, {"/user/hand/left/input/trackpad/x"}, {"/user/hand/left/input/trackpad/y"}, {"/user/hand/left/input/trackpad/click"}, {"/user/hand/left/input/trackpad/touch"}, {"/user/hand/left/input/grip/pose"}, {"/user/hand/left/input/aim/pose"}, {"/user/hand/left/output/haptic"}, {"/user/hand/right/input/menu/click"}, {"/user/hand/right/input/squeeze/click"}, {"/user/hand/right/input/trigger/value"}, {"/user/hand/right/input/thumbstick/x"}, {"/user/hand/right/input/thumbstick/y"}, {"/user/hand/right/input/thumbstick/click"}, {"/user/hand/right/input/trackpad/x"}, {"/user/hand/right/input/trackpad/y"}, {"/user/hand/right/input/trackpad/click"}, {"/user/hand/right/input/trackpad/touch"}, {"/user/hand/right/input/grip/pose"}, {"/user/hand/right/input/aim/pose"}, {"/user/hand/right/output/haptic"}}; vector<string> validPathsMicrosoftXboxController = {{"/user/gamepad/input/menu/click"}, {"/user/gamepad/input/view/click"}, {"/user/gamepad/input/a/click"}, {"/user/gamepad/input/b/click"}, {"/user/gamepad/input/x/click"}, {"/user/gamepad/input/y/click"}, {"/user/gamepad/input/dpad_down/click"}, {"/user/gamepad/input/dpad_right/click"}, {"/user/gamepad/input/dpad_up/click"}, {"/user/gamepad/input/dpad_left/click"}, {"/user/gamepad/input/shoulder_left/click"}, {"/user/gamepad/input/shoulder_right/click"}, {"/user/gamepad/input/thumbstick_left/click"}, {"/user/gamepad/input/thumbstick_right/click"}, {"/user/gamepad/input/trigger_left/value"}, {"/user/gamepad/input/trigger_right/value"}, {"/user/gamepad/input/thumbstick_left/x"}, {"/user/gamepad/input/thumbstick_left/y"}, {"/user/gamepad/input/thumbstick_right/x"}, {"/user/gamepad/input/thumbstick_right/y"}, {"/user/gamepad/output/haptic_left"}, {"/user/gamepad/output/haptic_right"}, {"/user/gamepad/output/haptic_left_trigger"}, {"/user/gamepad/output/haptic_right_trigger"}}; vector<string> validPathsOculusGoController = {{"/user/hand/left/input/system/click"}, {"/user/hand/left/input/trigger/click"}, {"/user/hand/left/input/back/click"}, {"/user/hand/left/input/trackpad/x"}, {"/user/hand/left/input/trackpad/y"}, {"/user/hand/left/input/trackpad/click"}, {"/user/hand/left/input/trackpad/touch"}, {"/user/hand/left/input/grip/pose"}, {"/user/hand/left/input/aim/pose"}, {"/user/hand/right/input/system/click"}, {"/user/hand/right/input/trigger/click"}, {"/user/hand/right/input/back/click"}, {"/user/hand/right/input/trackpad/x"}, {"/user/hand/right/input/trackpad/y"}, {"/user/hand/right/input/trackpad/click"}, {"/user/hand/right/input/trackpad/touch"}, {"/user/hand/right/input/grip/pose"}, {"/user/hand/right/input/aim/pose"}}; vector<string> validPathsOculusTouchController = {{"/user/hand/left/input/squeeze/value"}, {"/user/hand/left/input/trigger/value"}, {"/user/hand/left/input/trigger/touch"}, {"/user/hand/left/input/thumbstick/x"}, {"/user/hand/left/input/thumbstick/y"}, {"/user/hand/left/input/thumbstick/click"}, {"/user/hand/left/input/thumbstick/touch"}, {"/user/hand/left/input/thumbrest/touch"}, {"/user/hand/left/input/grip/pose"}, {"/user/hand/left/input/aim/pose"}, {"/user/hand/left/output/haptic"}, {"/user/hand/left/input/x/click"}, {"/user/hand/left/input/x/touch"}, {"/user/hand/left/input/y/click"}, {"/user/hand/left/input/y/touch"}, {"/user/hand/left/input/menu/click"}, {"/user/hand/right/input/squeeze/value"}, {"/user/hand/right/input/trigger/value"}, {"/user/hand/right/input/trigger/touch"}, {"/user/hand/right/input/thumbstick/x"}, {"/user/hand/right/input/thumbstick/y"}, {"/user/hand/right/input/thumbstick/click"}, {"/user/hand/right/input/thumbstick/touch"}, {"/user/hand/right/input/thumbrest/touch"}, {"/user/hand/right/input/grip/pose"}, {"/user/hand/right/input/aim/pose"}, {"/user/hand/right/output/haptic"}, {"/user/hand/right/input/a/click"}, {"/user/hand/right/input/a/touch"}, {"/user/hand/right/input/b/click"}, {"/user/hand/right/input/b/touch"}, {"/user/hand/right/input/system/click"}}; vector<string> validPathsValveIndexController = {{"/user/hand/left/input/system/click"}, {"/user/hand/left/input/system/touch"}, {"/user/hand/left/input/a/click"}, {"/user/hand/left/input/a/touch"}, {"/user/hand/left/input/b/click"}, {"/user/hand/left/input/b/touch"}, {"/user/hand/left/input/squeeze/value"}, {"/user/hand/left/input/squeeze/force"}, {"/user/hand/left/input/trigger/click"}, {"/user/hand/left/input/trigger/value"}, {"/user/hand/left/input/trigger/touch"}, {"/user/hand/left/input/thumbstick/x"}, {"/user/hand/left/input/thumbstick/y"}, {"/user/hand/left/input/thumbstick/click"}, {"/user/hand/left/input/thumbstick/touch"}, {"/user/hand/left/input/trackpad/x"}, {"/user/hand/left/input/trackpad/y"}, {"/user/hand/left/input/trackpad/force"}, {"/user/hand/left/input/trackpad/touch"}, {"/user/hand/left/input/grip/pose"}, {"/user/hand/left/input/aim/pose"}, {"/user/hand/left/output/haptic"}, {"/user/hand/right/input/system/click"}, {"/user/hand/right/input/system/touch"}, {"/user/hand/right/input/a/click"}, {"/user/hand/right/input/a/touch"}, {"/user/hand/right/input/b/click"}, {"/user/hand/right/input/b/touch"}, {"/user/hand/right/input/squeeze/value"}, {"/user/hand/right/input/squeeze/force"}, {"/user/hand/right/input/trigger/click"}, {"/user/hand/right/input/trigger/value"}, {"/user/hand/right/input/trigger/touch"}, {"/user/hand/right/input/thumbstick/x"}, {"/user/hand/right/input/thumbstick/y"}, {"/user/hand/right/input/thumbstick/click"}, {"/user/hand/right/input/thumbstick/touch"}, {"/user/hand/right/input/trackpad/x"}, {"/user/hand/right/input/trackpad/y"}, {"/user/hand/right/input/trackpad/force"}, {"/user/hand/right/input/trackpad/touch"}, {"/user/hand/right/input/grip/pose"}, {"/user/hand/right/input/aim/pose"}, {"/user/hand/right/output/haptic"}}; XrPath interactionProfilePath; vector<XrActionSuggestedBinding> bindings; XrInteractionProfileSuggestedBinding suggestedBindings = {XR_TYPE_INTERACTION_PROFILE_SUGGESTED_BINDING}; std::cout << "Suggested interaction bindings by profiles" << std::endl; // Khronos Simple Controller bindings.clear(); xrStringToPath(xr_instance, "/interaction_profiles/khr/simple_controller", &interactionProfilePath); defineInteractionProfileBindings(bindings, validPathsKhronosSimpleController); if(bindings.size()){ suggestedBindings.interactionProfile = interactionProfilePath; suggestedBindings.suggestedBindings = bindings.data(); suggestedBindings.countSuggestedBindings = (uint32_t)bindings.size(); xr_result = xrSuggestInteractionProfileBindings(xr_instance, &suggestedBindings); if(!xrCheckResult(xr_instance, xr_result, "xrSuggestInteractionProfileBindings /interaction_profiles/khr/simple_controller")) return false; } std::cout << " |-- /interaction_profiles/khr/simple_controller (" << bindings.size() << ")" << std::endl; // Google Daydream Controller bindings.clear(); xrStringToPath(xr_instance, "/interaction_profiles/google/daydream_controller", &interactionProfilePath); defineInteractionProfileBindings(bindings, validPathsGoogleDaydreamController); if(bindings.size()){ suggestedBindings.interactionProfile = interactionProfilePath; suggestedBindings.suggestedBindings = bindings.data(); suggestedBindings.countSuggestedBindings = (uint32_t)bindings.size(); xr_result = xrSuggestInteractionProfileBindings(xr_instance, &suggestedBindings); if(!xrCheckResult(xr_instance, xr_result, "xrSuggestInteractionProfileBindings /interaction_profiles/google/daydream_controller")) return false; } std::cout << " |-- /interaction_profiles/google/daydream_controller (" << bindings.size() << ")" << std::endl; // HTC Vive Controller bindings.clear(); xrStringToPath(xr_instance, "/interaction_profiles/htc/vive_controller", &interactionProfilePath); defineInteractionProfileBindings(bindings, validPathsHTCViveController); if(bindings.size()){ suggestedBindings.interactionProfile = interactionProfilePath; suggestedBindings.suggestedBindings = bindings.data(); suggestedBindings.countSuggestedBindings = (uint32_t)bindings.size(); xr_result = xrSuggestInteractionProfileBindings(xr_instance, &suggestedBindings); if(!xrCheckResult(xr_instance, xr_result, "xrSuggestInteractionProfileBindings /interaction_profiles/htc/vive_controller")) return false; } std::cout << " |-- /interaction_profiles/htc/vive_controller (" << bindings.size() << ")" << std::endl; // HTC Vive Pro bindings.clear(); xrStringToPath(xr_instance, "/interaction_profiles/htc/vive_pro", &interactionProfilePath); defineInteractionProfileBindings(bindings, validPathsHTCVivePro); if(bindings.size()){ suggestedBindings.interactionProfile = interactionProfilePath; suggestedBindings.suggestedBindings = bindings.data(); suggestedBindings.countSuggestedBindings = (uint32_t)bindings.size(); xr_result = xrSuggestInteractionProfileBindings(xr_instance, &suggestedBindings); if(!xrCheckResult(xr_instance, xr_result, "xrSuggestInteractionProfileBindings /interaction_profiles/htc/vive_pro")) return false; } std::cout << " |-- /interaction_profiles/htc/vive_pro (" << bindings.size() << ")" << std::endl; // Microsoft Mixed Reality Motion Controller bindings.clear(); xrStringToPath(xr_instance, "/interaction_profiles/microsoft/motion_controller", &interactionProfilePath); defineInteractionProfileBindings(bindings, validPathsMicrosoftMixedRealityMotionController); if(bindings.size()){ suggestedBindings.interactionProfile = interactionProfilePath; suggestedBindings.suggestedBindings = bindings.data(); suggestedBindings.countSuggestedBindings = (uint32_t)bindings.size(); xr_result = xrSuggestInteractionProfileBindings(xr_instance, &suggestedBindings); if(!xrCheckResult(xr_instance, xr_result, "xrSuggestInteractionProfileBindings /interaction_profiles/microsoft/motion_controller")) return false; } std::cout << " |-- /interaction_profiles/microsoft/motion_controller (" << bindings.size() << ")" << std::endl; // Microsoft Xbox Controller bindings.clear(); xrStringToPath(xr_instance, "/interaction_profiles/microsoft/xbox_controller", &interactionProfilePath); defineInteractionProfileBindings(bindings, validPathsMicrosoftXboxController); if(bindings.size()){ suggestedBindings.interactionProfile = interactionProfilePath; suggestedBindings.suggestedBindings = bindings.data(); suggestedBindings.countSuggestedBindings = (uint32_t)bindings.size(); xr_result = xrSuggestInteractionProfileBindings(xr_instance, &suggestedBindings); if(!xrCheckResult(xr_instance, xr_result, "xrSuggestInteractionProfileBindings /interaction_profiles/microsoft/xbox_controller")) return false; } std::cout << " |-- /interaction_profiles/microsoft/xbox_controller (" << bindings.size() << ")" << std::endl; // Oculus Go Controller bindings.clear(); xrStringToPath(xr_instance, "/interaction_profiles/oculus/go_controller", &interactionProfilePath); defineInteractionProfileBindings(bindings, validPathsOculusGoController); if(bindings.size()){ suggestedBindings.interactionProfile = interactionProfilePath; suggestedBindings.suggestedBindings = bindings.data(); suggestedBindings.countSuggestedBindings = (uint32_t)bindings.size(); xr_result = xrSuggestInteractionProfileBindings(xr_instance, &suggestedBindings); if(!xrCheckResult(xr_instance, xr_result, "xrSuggestInteractionProfileBindings /interaction_profiles/oculus/go_controller")) return false; } std::cout << " |-- /interaction_profiles/oculus/go_controller (" << bindings.size() << ")" << std::endl; // Oculus Touch Controller bindings.clear(); xrStringToPath(xr_instance, "/interaction_profiles/oculus/touch_controller", &interactionProfilePath); defineInteractionProfileBindings(bindings, validPathsOculusTouchController); if(bindings.size()){ suggestedBindings.interactionProfile = interactionProfilePath; suggestedBindings.suggestedBindings = bindings.data(); suggestedBindings.countSuggestedBindings = (uint32_t)bindings.size(); xr_result = xrSuggestInteractionProfileBindings(xr_instance, &suggestedBindings); if(!xrCheckResult(xr_instance, xr_result, "xrSuggestInteractionProfileBindings /interaction_profiles/oculus/touch_controller")) return false; } std::cout << " |-- /interaction_profiles/oculus/touch_controller (" << bindings.size() << ")" << std::endl; // Valve Index Controller bindings.clear(); xrStringToPath(xr_instance, "/interaction_profiles/valve/index_controller", &interactionProfilePath); defineInteractionProfileBindings(bindings, validPathsValveIndexController); if(bindings.size()){ suggestedBindings.interactionProfile = interactionProfilePath; suggestedBindings.suggestedBindings = bindings.data(); suggestedBindings.countSuggestedBindings = (uint32_t)bindings.size(); xr_result = xrSuggestInteractionProfileBindings(xr_instance, &suggestedBindings); if(!xrCheckResult(xr_instance, xr_result, "xrSuggestInteractionProfileBindings /interaction_profiles/valve/index_controller")) return false; } std::cout << " |-- /interaction_profiles/valve/index_controller (" << bindings.size() << ")" << std::endl; return true; } bool OpenXrApplication::defineSessionSpaces(){ XrSessionActionSetsAttachInfo attachInfo{XR_TYPE_SESSION_ACTION_SETS_ATTACH_INFO}; attachInfo.countActionSets = 1; attachInfo.actionSets = &xr_action_set; xr_result = xrAttachSessionActionSets(xr_session, &attachInfo); if(!xrCheckResult(xr_instance, xr_result, "xrAttachSessionActionSets")) return false; XrActionSpaceCreateInfo actionSpaceInfo = {XR_TYPE_ACTION_SPACE_CREATE_INFO}; actionSpaceInfo.poseInActionSpace.orientation.w = 1.f; actionSpaceInfo.subactionPath = XR_NULL_PATH; for(size_t i = 0; i < xr_actions.aPose.size(); i++){ XrSpace space; actionSpaceInfo.action = xr_actions.aPose[i].action; xr_result = xrCreateActionSpace(xr_session, &actionSpaceInfo, &space); if(!xrCheckResult(xr_instance, xr_result, "xrCreateActionSpace")) return false; xr_actions.aPose[i].space = space; } return true; } bool OpenXrApplication::defineSwapchains(){ // get swapchain Formats uint32_t propertyCountOutput; xr_result = xrEnumerateSwapchainFormats(xr_session, 0, &propertyCountOutput, nullptr); if(!xrCheckResult(xr_instance, xr_result, "xrEnumerateSwapchainFormats")) return false; vector<int64_t> swapchainFormats(propertyCountOutput); xr_result = xrEnumerateSwapchainFormats(xr_session, propertyCountOutput, &propertyCountOutput, swapchainFormats.data()); if(!xrCheckResult(xr_instance, xr_result, "xrEnumerateSwapchainFormats")) return false; // select swapchain format #ifdef XR_USE_GRAPHICS_API_VULKAN int64_t supportedSwapchainFormats[] = {VK_FORMAT_B8G8R8A8_SRGB, VK_FORMAT_R8G8B8A8_SRGB, VK_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_R8G8B8A8_UNORM}; #endif #ifdef XR_USE_GRAPHICS_API_OPENGL int64_t supportedSwapchainFormats[] = {GL_RGB10_A2, GL_RGBA16F, GL_RGBA8, GL_RGBA8_SNORM}; #endif int64_t selectedSwapchainFormats = -1; for(size_t i = 0; i < swapchainFormats.size(); i++){ for (size_t j = 0; j < _countof(supportedSwapchainFormats); j++) if(swapchainFormats[i] == supportedSwapchainFormats[j]){ selectedSwapchainFormats = swapchainFormats[i]; break; } if(selectedSwapchainFormats != -1) break; } if((selectedSwapchainFormats == -1) && swapchainFormats.size()) selectedSwapchainFormats = swapchainFormats[0]; std::cout << "Swapchain formats (" << swapchainFormats.size() << ")" << std::endl; for (size_t i = 0; i < swapchainFormats.size(); i++){ std::cout << " |-- format: " << swapchainFormats[i] << std::endl; if (swapchainFormats[i] == selectedSwapchainFormats) std::cout << " | (selected)" << std::endl; } // create swapchain per view std::cout << "Created swapchain (" << xr_view_configuration_views.size() << ")" << std::endl; for(uint32_t i = 0; i < xr_view_configuration_views.size(); i++){ XrSwapchainCreateInfo swapchainCreateInfo = {XR_TYPE_SWAPCHAIN_CREATE_INFO}; swapchainCreateInfo.arraySize = 1; swapchainCreateInfo.format = selectedSwapchainFormats; swapchainCreateInfo.width = xr_view_configuration_views[i].recommendedImageRectWidth; swapchainCreateInfo.height = xr_view_configuration_views[i].recommendedImageRectHeight; swapchainCreateInfo.mipCount = 1; swapchainCreateInfo.faceCount = 1; swapchainCreateInfo.sampleCount = xr_graphics_handler.getSupportedSwapchainSampleCount(xr_view_configuration_views[i]); swapchainCreateInfo.usageFlags = XR_SWAPCHAIN_USAGE_SAMPLED_BIT | XR_SWAPCHAIN_USAGE_COLOR_ATTACHMENT_BIT; SwapchainHandler swapchain; xr_result = xrCreateSwapchain(xr_session, &swapchainCreateInfo, &swapchain.handle); if(!xrCheckResult(xr_instance, xr_result, "xrCreateSwapchain")) return false; swapchain.width = swapchainCreateInfo.width; swapchain.height = swapchainCreateInfo.height; std::cout << " |-- swapchain: " << i << std::endl; std::cout << " | |-- width: " << swapchainCreateInfo.width << std::endl; std::cout << " | |-- height: " << swapchainCreateInfo.height << std::endl; std::cout << " | |-- sample count: " << swapchainCreateInfo.sampleCount << std::endl; // enumerate swapchain images xr_result = xrEnumerateSwapchainImages(swapchain.handle, 0, &propertyCountOutput, nullptr); if(!xrCheckResult(xr_instance, xr_result, "xrEnumerateSwapchainImages")) return false; swapchain.length = propertyCountOutput; #ifdef XR_USE_GRAPHICS_API_VULKAN swapchain.images.resize(propertyCountOutput, {XR_TYPE_SWAPCHAIN_IMAGE_VULKAN2_KHR}); #endif #ifdef XR_USE_GRAPHICS_API_OPENGL swapchain.images.resize(propertyCountOutput, {XR_TYPE_SWAPCHAIN_IMAGE_OPENGL_KHR}); #endif xrEnumerateSwapchainImages(swapchain.handle, propertyCountOutput, &propertyCountOutput, (XrSwapchainImageBaseHeader*)swapchain.images.data()); std::cout << " | |-- swapchain images: " << propertyCountOutput << std::endl; xr_swapchains_handlers.push_back(swapchain); } #ifdef XR_USE_GRAPHICS_API_OPENGL // acquire GL context glXMakeCurrent(xr_graphics_binding.xDisplay, xr_graphics_binding.glxDrawable, xr_graphics_binding.glxContext); #endif return true; } bool OpenXrApplication::createInstance(const string & applicationName, const string & engineName, const vector<string> & requestedApiLayers, const vector<string> & requestedExtensions){ vector<string> enabledApiLayers; vector<string> enabledExtensions; // layers if(!defineLayers(requestedApiLayers, enabledApiLayers)) return false; // extensions if(!defineExtensions(requestedExtensions, enabledExtensions)) return false; vector<const char*> enabledApiLayerNames = cast_to_vector_char_p(enabledApiLayers); vector<const char*> enabledExtensionNames = cast_to_vector_char_p(enabledExtensions); // initialize OpenXR (create instance) with the enabled extensions and layers XrInstanceCreateInfo createInfo = {XR_TYPE_INSTANCE_CREATE_INFO}; createInfo.next = NULL; createInfo.createFlags = 0; createInfo.enabledApiLayerCount = enabledApiLayers.size(); createInfo.enabledApiLayerNames = enabledApiLayerNames.data(); createInfo.enabledExtensionCount = enabledExtensions.size(); createInfo.enabledExtensionNames = enabledExtensionNames.data(); createInfo.applicationInfo.apiVersion = XR_CURRENT_API_VERSION; createInfo.applicationInfo.applicationVersion = 1; createInfo.applicationInfo.engineVersion = 1; strncpy(createInfo.applicationInfo.applicationName, applicationName.c_str(), XR_MAX_APPLICATION_NAME_SIZE); strncpy(createInfo.applicationInfo.engineName, engineName.c_str(), XR_MAX_ENGINE_NAME_SIZE); xr_result = xrCreateInstance(&createInfo, &xr_instance); if(!xrCheckResult(NULL, xr_result, "xrCreateInstance")) return false; return true; } bool OpenXrApplication::getSystem(XrFormFactor formFactor, XrEnvironmentBlendMode blendMode, XrViewConfigurationType configurationType){ XrSystemGetInfo systemInfo = {XR_TYPE_SYSTEM_GET_INFO}; systemInfo.formFactor = formFactor; xr_result = xrGetSystem(xr_instance, &systemInfo, &xr_system_id); if(!xrCheckResult(xr_instance, xr_result, "xrGetSystem")) return false; if(!acquireInstanceProperties()) return false; if(!acquireSystemProperties()) return false; if(!acquireViewConfiguration(configurationType)) return false; if(!acquireBlendModes(blendMode)) return false; // create action set XrActionSetCreateInfo actionSetInfo = {XR_TYPE_ACTION_SET_CREATE_INFO}; strcpy(actionSetInfo.actionSetName, "actionset"); strcpy(actionSetInfo.localizedActionSetName, "localized_actionset"); actionSetInfo.priority = 0; xr_result = xrCreateActionSet(xr_instance, &actionSetInfo, &xr_action_set); if(!xrCheckResult(xr_instance, xr_result, "xrCreateActionSet")) return false; return true; } bool OpenXrApplication::createSession(){ #ifdef XR_USE_GRAPHICS_API_VULKAN xr_graphics_handler.createInstance(xr_instance, xr_system_id); xr_graphics_handler.getPhysicalDevice(xr_instance, xr_system_id); xr_graphics_handler.createLogicalDevice(xr_instance, xr_system_id); xr_graphics_binding.instance = xr_graphics_handler.getInstance(); xr_graphics_binding.physicalDevice = xr_graphics_handler.getPhysicalDevice(); xr_graphics_binding.device = xr_graphics_handler.getLogicalDevice(); xr_graphics_binding.queueFamilyIndex = xr_graphics_handler.getQueueFamilyIndex(); xr_graphics_binding.queueIndex = 0; std::cout << "Graphics binding: Vulkan" << std::endl; std::cout << " |-- instance: " << xr_graphics_binding.instance << std::endl; std::cout << " |-- physical device: " << xr_graphics_binding.physicalDevice << std::endl; std::cout << " |-- device: " << xr_graphics_binding.device << std::endl; std::cout << " |-- queue family index: " << xr_graphics_binding.queueFamilyIndex << std::endl; std::cout << " |-- queue index: " << xr_graphics_binding.queueIndex << std::endl; #endif #ifdef XR_USE_GRAPHICS_API_OPENGL if(!xr_graphics_handler.getRequirements(xr_instance, xr_system_id)) return false; if(!xr_graphics_handler.initGraphicsBinding(&xr_graphics_binding.xDisplay, &xr_graphics_binding.visualid, &xr_graphics_binding.glxFBConfig, &xr_graphics_binding.glxDrawable, &xr_graphics_binding.glxContext, xr_view_configuration_views[0].recommendedImageRectWidth, xr_view_configuration_views[0].recommendedImageRectHeight)) return false; if(!xr_graphics_handler.initResources(xr_instance, xr_system_id)) return false; std::cout << "Graphics binding: OpenGL" << std::endl; std::cout << " |-- xDisplay: " << xr_graphics_binding.xDisplay << std::endl; std::cout << " |-- visualid: " << xr_graphics_binding.visualid << std::endl; std::cout << " |-- glxFBConfig: " << xr_graphics_binding.glxFBConfig << std::endl; std::cout << " |-- glxDrawable: " << xr_graphics_binding.glxDrawable << std::endl; std::cout << " |-- glxContext: " << xr_graphics_binding.glxContext << std::endl; #endif // create session XrSessionCreateInfo sessionInfo = {XR_TYPE_SESSION_CREATE_INFO}; sessionInfo.next = &xr_graphics_binding; sessionInfo.systemId = xr_system_id; xr_result = xrCreateSession(xr_instance, &sessionInfo, &xr_session); if(!xrCheckResult(xr_instance, xr_result, "xrCreateSession")) return false; // reference spaces if(!defineReferenceSpaces()) return false; // suggest interaction profile bindings if(!suggestInteractionProfileBindings()) return false; // action spaces / attach session action sets if(!defineSessionSpaces()) return false; // swapchains if(!defineSwapchains()) return false; return true; } bool OpenXrApplication::pollEvents(bool * exitLoop){ *exitLoop = false; XrEventDataBuffer event; while(true){ // pool events event.type = XR_TYPE_EVENT_DATA_BUFFER; event.next = nullptr; xr_result = xrPollEvent(xr_instance, &event); if(!xrCheckResult(xr_instance, xr_result, "xrPollEvent")) return false; // process messages switch(event.type){ case XR_EVENT_UNAVAILABLE: { return true; break; } case XR_TYPE_EVENT_DATA_BUFFER: { return true; break; } // event queue overflowed (some events were removed) case XR_TYPE_EVENT_DATA_EVENTS_LOST: { const XrEventDataEventsLost & eventsLost = *reinterpret_cast<XrEventDataEventsLost*>(&event); std::cout << "Event queue has overflowed (" << eventsLost.lostEventCount << " overflowed event(s))" << std::endl; break; } // session state changed case XR_TYPE_EVENT_DATA_SESSION_STATE_CHANGED: { const XrEventDataSessionStateChanged & sessionStateChangedEvent = *reinterpret_cast<XrEventDataSessionStateChanged*>(&event); std::cout << "XrEventDataSessionStateChanged to " << _enum_to_string(sessionStateChangedEvent.state) << " (" << sessionStateChangedEvent.state << ")" << std::endl; // check session if((sessionStateChangedEvent.session != XR_NULL_HANDLE) && (sessionStateChangedEvent.session != xr_session)){ std::cout << "XrEventDataSessionStateChanged for unknown session " << sessionStateChangedEvent.session << std::endl; return false; } // handle session state switch(sessionStateChangedEvent.state){ case XR_SESSION_STATE_READY: { XrSessionBeginInfo sessionBeginInfo = {XR_TYPE_SESSION_BEGIN_INFO}; sessionBeginInfo.primaryViewConfigurationType = configViewConfigurationType; xr_result = xrBeginSession(xr_session, &sessionBeginInfo); if(!xrCheckResult(xr_instance, xr_result, "xrBeginSession")) return false; flagSessionRunning = true; std::cout << "Event: XR_SESSION_STATE_READY (xrBeginSession)" << std::endl; break; } case XR_SESSION_STATE_STOPPING: { xr_result = xrEndSession(xr_session); if(!xrCheckResult(xr_instance, xr_result, "xrEndSession")) return false; flagSessionRunning = false; std::cout << "Event: XR_SESSION_STATE_STOPPING (xrEndSession)" << std::endl; break; } case XR_SESSION_STATE_EXITING: { *exitLoop = true; std::cout << "Event: XR_SESSION_STATE_EXITING" << std::endl; break; } case XR_SESSION_STATE_LOSS_PENDING: { *exitLoop = true; std::cout << "Event: XR_SESSION_STATE_LOSS_PENDING" << std::endl; break; } default: break; } break; } // application is about to lose the XrInstance case XR_TYPE_EVENT_DATA_INSTANCE_LOSS_PENDING: { const XrEventDataInstanceLossPending & instanceLossPending = *reinterpret_cast<XrEventDataInstanceLossPending*>(&event); *exitLoop = true; std::cout << "XrEventDataInstanceLossPending by " << instanceLossPending.lossTime << std::endl; return true; break; } case XR_TYPE_EVENT_DATA_INTERACTION_PROFILE_CHANGED: { // TODO: implement std::cout << "XR_TYPE_EVENT_DATA_INTERACTION_PROFILE_CHANGED" << std::endl; break; } // reference space is changing case XR_TYPE_EVENT_DATA_REFERENCE_SPACE_CHANGE_PENDING: { const XrEventDataReferenceSpaceChangePending & referenceSpaceChangePending = *reinterpret_cast<XrEventDataReferenceSpaceChangePending*>(&event); std::cout << "XrEventDataReferenceSpaceChangePending for " << _enum_to_string(referenceSpaceChangePending.referenceSpaceType) << std::endl; break; } default: break; } } return true; } bool OpenXrApplication::pollActions(vector<ActionState> & actionStates){ // sync actions XrActiveActionSet activeActionSet = {xr_action_set, XR_NULL_PATH}; XrActionsSyncInfo syncInfo = {XR_TYPE_ACTIONS_SYNC_INFO}; syncInfo.countActiveActionSets = 1; syncInfo.activeActionSets = &activeActionSet; xr_result = xrSyncActions(xr_session, &syncInfo); if(!xrCheckResult(xr_instance, xr_result, "xrSyncActions")) return false; XrActionStateGetInfo getInfo = {XR_TYPE_ACTION_STATE_GET_INFO}; getInfo.next = nullptr; getInfo.subactionPath = XR_NULL_PATH; // boolean XrActionStateBoolean actionStateBoolean = {XR_TYPE_ACTION_STATE_BOOLEAN}; for(size_t i = 0; i < xr_actions.aBoolean.size(); i++){ getInfo.action = xr_actions.aBoolean[i].action; xr_result = xrGetActionStateBoolean(xr_session, &getInfo, &actionStateBoolean); if(!xrCheckResult(xr_instance, xr_result, "xrGetActionStateBoolean")) return false; if(actionStateBoolean.isActive && actionStateBoolean.changedSinceLastSync){ ActionState state; state.type = XR_ACTION_TYPE_BOOLEAN_INPUT; state.path = xr_actions.aBoolean[i].stringPath.c_str(); state.isActive = actionStateBoolean.isActive; state.stateBool = (bool)actionStateBoolean.currentState; actionStates.push_back(state); } } // float XrActionStateFloat actionStateFloat = {XR_TYPE_ACTION_STATE_FLOAT}; for(size_t i = 0; i < xr_actions.aFloat.size(); i++){ getInfo.action = xr_actions.aFloat[i].action; xr_result = xrGetActionStateFloat(xr_session, &getInfo, &actionStateFloat); if(!xrCheckResult(xr_instance, xr_result, "xrGetActionStateFloat")) return false; if(actionStateFloat.isActive && actionStateFloat.changedSinceLastSync){ ActionState state; state.type = XR_ACTION_TYPE_FLOAT_INPUT; state.path = xr_actions.aFloat[i].stringPath.c_str(); state.isActive = actionStateFloat.isActive; state.stateFloat = actionStateFloat.currentState; actionStates.push_back(state); } } // vector2f XrActionStateVector2f actionStateVector2f = {XR_TYPE_ACTION_STATE_VECTOR2F}; for(size_t i = 0; i < xr_actions.aVector2f.size(); i++){ getInfo.action = xr_actions.aVector2f[i].action; xr_result = xrGetActionStateVector2f(xr_session, &getInfo, &actionStateVector2f); if(!xrCheckResult(xr_instance, xr_result, "xrGetActionStateVector2f")) return false; if(actionStateVector2f.isActive && actionStateVector2f.changedSinceLastSync){ ActionState state; state.type = XR_ACTION_TYPE_VECTOR2F_INPUT; state.path = xr_actions.aVector2f[i].stringPath.c_str(); state.isActive = actionStateVector2f.isActive; state.stateVectorX = actionStateVector2f.currentState.x; state.stateVectorY = actionStateVector2f.currentState.y; actionStates.push_back(state); } } // pose XrActionStatePose actionStatePose = {XR_TYPE_ACTION_STATE_POSE}; for(size_t i = 0; i < xr_actions.aPose.size(); i++){ getInfo.action = xr_actions.aPose[i].action; xr_result = xrGetActionStatePose(xr_session, &getInfo, &actionStatePose); if(!xrCheckResult(xr_instance, xr_result, "xrGetActionStatePose")) return false; if(actionStatePose.isActive){ ActionState state; state.type = XR_ACTION_TYPE_POSE_INPUT; state.path = xr_actions.aPose[i].stringPath.c_str(); state.isActive = actionStatePose.isActive; actionStates.push_back(state); } } return true; } bool OpenXrApplication::renderViews(XrReferenceSpaceType referenceSpaceType, vector<ActionPoseState> & actionPoseStates){ xr_graphics_handler.acquireContext(xr_graphics_binding, "xrWaitFrame"); XrFrameWaitInfo frameWaitInfo = {XR_TYPE_FRAME_WAIT_INFO}; XrFrameState frameState = {XR_TYPE_FRAME_STATE}; xr_result = xrWaitFrame(xr_session, &frameWaitInfo, &frameState); if(!xrCheckResult(xr_instance, xr_result, "xrWaitFrame")) return false; XrFrameBeginInfo frameBeginInfo = {XR_TYPE_FRAME_BEGIN_INFO}; xr_result = xrBeginFrame(xr_session, &frameBeginInfo); if(!xrCheckResult(xr_instance, xr_result, "xrBeginFrame")) return false; // locate actions XrSpaceLocation spaceLocation = {XR_TYPE_SPACE_LOCATION}; for(size_t i = 0; i < xr_actions.aPose.size(); i++){ XrSpace actionPoseSpace; if(xr_actions.aPose[i].referenceSpaceType == XR_REFERENCE_SPACE_TYPE_VIEW) actionPoseSpace = xr_space_view; else if(xr_actions.aPose[i].referenceSpaceType == XR_REFERENCE_SPACE_TYPE_LOCAL) actionPoseSpace = xr_space_local; else if(xr_actions.aPose[i].referenceSpaceType == XR_REFERENCE_SPACE_TYPE_STAGE) actionPoseSpace = xr_space_stage; else{ std::cout << "[WARNING] Invalid reference space (" << xr_actions.aPose[i].referenceSpaceType << ") for " << xr_actions.aPose[i].stringPath << std::endl; continue; } xr_result = xrLocateSpace(xr_actions.aPose[i].space, actionPoseSpace, frameState.predictedDisplayTime, &spaceLocation); if(!xrCheckResult(xr_instance, xr_result, "xrLocateSpace")) return false; ActionPoseState state; state.type = XR_ACTION_TYPE_POSE_INPUT; state.path = xr_actions.aPose[i].stringPath.c_str(); state.isActive = false; if((spaceLocation.locationFlags & XR_VIEW_STATE_POSITION_VALID_BIT) != 0 || (spaceLocation.locationFlags & XR_VIEW_STATE_ORIENTATION_VALID_BIT) != 0){ state.isActive = true; state.pose = spaceLocation.pose; } actionPoseStates.push_back(state); } vector<XrCompositionLayerBaseHeader*> layers; XrCompositionLayerProjection layer = {XR_TYPE_COMPOSITION_LAYER_PROJECTION}; vector<XrCompositionLayerProjectionView> projectionLayerViews; if(frameState.shouldRender == XR_TRUE){ // locate views vector<XrView> views(xr_view_configuration_views.size(), {XR_TYPE_VIEW}); XrViewState viewState = {XR_TYPE_VIEW_STATE}; uint32_t viewCountOutput; XrViewLocateInfo viewLocateInfo = {XR_TYPE_VIEW_LOCATE_INFO}; viewLocateInfo.viewConfigurationType = configViewConfigurationType; viewLocateInfo.displayTime = frameState.predictedDisplayTime; if(referenceSpaceType == XR_REFERENCE_SPACE_TYPE_VIEW){ viewLocateInfo.space = xr_space_view; xr_result = xrLocateViews(xr_session, &viewLocateInfo, &viewState, (uint32_t)views.size(), &viewCountOutput, views.data()); if(!xrCheckResult(xr_instance, xr_result, "xrLocateViews (XR_REFERENCE_SPACE_TYPE_VIEW)")) return false; if((viewState.viewStateFlags & XR_VIEW_STATE_POSITION_VALID_BIT) == 0 || (viewState.viewStateFlags & XR_VIEW_STATE_ORIENTATION_VALID_BIT) == 0) std::cout << "Invalid location view for XR_REFERENCE_SPACE_TYPE_VIEW" << std::endl; } else if(referenceSpaceType == XR_REFERENCE_SPACE_TYPE_LOCAL){ viewLocateInfo.space = xr_space_local; xr_result = xrLocateViews(xr_session, &viewLocateInfo, &viewState, (uint32_t)views.size(), &viewCountOutput, views.data()); if(!xrCheckResult(xr_instance, xr_result, "xrLocateViews (XR_REFERENCE_SPACE_TYPE_LOCAL)")) return false; if((viewState.viewStateFlags & XR_VIEW_STATE_POSITION_VALID_BIT) == 0 || (viewState.viewStateFlags & XR_VIEW_STATE_ORIENTATION_VALID_BIT) == 0) std::cout << "Invalid location view for XR_REFERENCE_SPACE_TYPE_LOCAL" << std::endl; } else if(referenceSpaceType == XR_REFERENCE_SPACE_TYPE_STAGE){ viewLocateInfo.space = xr_space_stage; xr_result = xrLocateViews(xr_session, &viewLocateInfo, &viewState, (uint32_t)views.size(), &viewCountOutput, views.data()); if(!xrCheckResult(xr_instance, xr_result, "xrLocateViews (XR_REFERENCE_SPACE_TYPE_STAGE)")) return false; if((viewState.viewStateFlags & XR_VIEW_STATE_POSITION_VALID_BIT) == 0 || (viewState.viewStateFlags & XR_VIEW_STATE_ORIENTATION_VALID_BIT) == 0) std::cout << "Invalid location view for XR_REFERENCE_SPACE_TYPE_STAGE" << std::endl; } else{ std::cout << "Invalid reference space type (" << referenceSpaceType << ")" << std::endl; return false; } // call render callback to get frames if(renderCallback) renderCallback(views.size(), views.data(), xr_view_configuration_views.data()); else if(renderCallbackFunction) renderCallbackFunction(views.size(), views, xr_view_configuration_views); // TODO: render if there are images // render view to the appropriate part of the swapchain image projectionLayerViews.resize(viewCountOutput); for(uint32_t i = 0; i < viewCountOutput; i++){ // Each view has a separate swapchain which is acquired, rendered to, and released const SwapchainHandler viewSwapchain = xr_swapchains_handlers[i]; XrSwapchainImageAcquireInfo acquireInfo{XR_TYPE_SWAPCHAIN_IMAGE_ACQUIRE_INFO}; uint32_t swapchainImageIndex; xr_result = xrAcquireSwapchainImage(viewSwapchain.handle, &acquireInfo, &swapchainImageIndex); if(!xrCheckResult(xr_instance, xr_result, "xrAcquireSwapchainImage")) return false; xr_graphics_handler.acquireContext(xr_graphics_binding, "xrAcquireSwapchainImage"); XrSwapchainImageWaitInfo waitInfo = {XR_TYPE_SWAPCHAIN_IMAGE_WAIT_INFO}; waitInfo.timeout = XR_INFINITE_DURATION; xr_result = xrWaitSwapchainImage(viewSwapchain.handle, &waitInfo); if(!xrCheckResult(xr_instance, xr_result, "xrWaitSwapchainImage")) return false; xr_graphics_handler.acquireContext(xr_graphics_binding, "xrWaitSwapchainImage"); projectionLayerViews[i] = {XR_TYPE_COMPOSITION_LAYER_PROJECTION_VIEW}; projectionLayerViews[i].pose = views[i].pose; projectionLayerViews[i].fov = views[i].fov; projectionLayerViews[i].subImage.swapchain = viewSwapchain.handle; projectionLayerViews[i].subImage.imageRect.offset = {0, 0}; projectionLayerViews[i].subImage.imageRect.extent = {viewSwapchain.width, viewSwapchain.height}; // render frame if((renderCallback || renderCallbackFunction) && (xr_frames_width[i] && xr_frames_height[i])){ const XrSwapchainImageBaseHeader* const swapchainImage = (XrSwapchainImageBaseHeader*)&viewSwapchain.images[swapchainImageIndex]; // FIXME: use format (vulkan: 43, opengl: 34842) // xr_graphics_handler.renderView(projectionLayerViews[i], swapchainImage, 43); xr_graphics_handler.renderViewFromImage(projectionLayerViews[i], swapchainImage, 43, xr_frames_width[i], xr_frames_height[i], xr_frames_data[i], xr_frames_is_rgba); cleanFrames(); } XrSwapchainImageReleaseInfo releaseInfo{XR_TYPE_SWAPCHAIN_IMAGE_RELEASE_INFO}; xr_result = xrReleaseSwapchainImage(viewSwapchain.handle, &releaseInfo); if(!xrCheckResult(xr_instance, xr_result, "xrReleaseSwapchainImage")) return false; } if(referenceSpaceType == XR_REFERENCE_SPACE_TYPE_VIEW) layer.space = xr_space_view; else if(referenceSpaceType == XR_REFERENCE_SPACE_TYPE_LOCAL) layer.space = xr_space_local; else if(referenceSpaceType == XR_REFERENCE_SPACE_TYPE_STAGE) layer.space = xr_space_stage; layer.viewCount = (uint32_t)projectionLayerViews.size(); layer.views = projectionLayerViews.data(); layers.push_back(reinterpret_cast<XrCompositionLayerBaseHeader*>(&layer)); } // end frame XrFrameEndInfo frameEndInfo{XR_TYPE_FRAME_END_INFO}; frameEndInfo.displayTime = frameState.predictedDisplayTime; frameEndInfo.environmentBlendMode = environmentBlendMode; frameEndInfo.layerCount = (uint32_t)layers.size(); frameEndInfo.layers = layers.data(); xr_result = xrEndFrame(xr_session, &frameEndInfo); if(!xrCheckResult(xr_instance, xr_result, "xrEndFrame")) return false; return true; } bool OpenXrApplication::addAction(string stringPath, XrActionType actionType, XrReferenceSpaceType referenceSpaceType){ XrPath path; XrAction action; xrStringToPath(xr_instance, stringPath.c_str(), &path); string actionName = ""; string localizedActionName = ""; if(actionType == XR_ACTION_TYPE_BOOLEAN_INPUT) actionName = "action_boolean_" + std::to_string(xr_actions.aBoolean.size()); else if(actionType == XR_ACTION_TYPE_FLOAT_INPUT) actionName = "action_float_" + std::to_string(xr_actions.aFloat.size()); else if(actionType == XR_ACTION_TYPE_VECTOR2F_INPUT) actionName = "action_vector2f_" + std::to_string(xr_actions.aVector2f.size()); else if(actionType == XR_ACTION_TYPE_POSE_INPUT) actionName = "action_pose_" + std::to_string(xr_actions.aPose.size()); else if(actionType == XR_ACTION_TYPE_VIBRATION_OUTPUT) actionName = "action_vibration_" + std::to_string(xr_actions.aVibration.size()); localizedActionName = "localized_" + actionName; XrActionCreateInfo actionInfo = {XR_TYPE_ACTION_CREATE_INFO}; actionInfo.actionType = actionType; strcpy(actionInfo.actionName, actionName.c_str()); strcpy(actionInfo.localizedActionName, localizedActionName.c_str()); actionInfo.countSubactionPaths = 0; actionInfo.subactionPaths = nullptr; xr_result = xrCreateAction(xr_action_set, &actionInfo, &action); if(!xrCheckResult(xr_instance, xr_result, "xrCreateAction")) return false; if(actionType == XR_ACTION_TYPE_BOOLEAN_INPUT){ Action actionPackage; actionPackage.action = action; actionPackage.path = path; actionPackage.stringPath = stringPath; xr_actions.aBoolean.push_back(actionPackage); } else if(actionType == XR_ACTION_TYPE_FLOAT_INPUT){ Action actionPackage; actionPackage.action = action; actionPackage.path = path; actionPackage.stringPath = stringPath; xr_actions.aFloat.push_back(actionPackage); } else if(actionType == XR_ACTION_TYPE_VECTOR2F_INPUT){ Action actionPackage; actionPackage.action = action; actionPackage.path = path; actionPackage.stringPath = stringPath; xr_actions.aVector2f.push_back(actionPackage); } else if(actionType == XR_ACTION_TYPE_POSE_INPUT){ ActionPose actionPackage; actionPackage.action = action; actionPackage.path = path; actionPackage.stringPath = stringPath; actionPackage.referenceSpaceType = referenceSpaceType; xr_actions.aPose.push_back(actionPackage); } else if(actionType == XR_ACTION_TYPE_VIBRATION_OUTPUT){ Action actionPackage; actionPackage.action = action; actionPackage.path = path; actionPackage.stringPath = stringPath; xr_actions.aVibration.push_back(actionPackage); } return true; } bool OpenXrApplication::applyHapticFeedback(string stringPath, XrHapticBaseHeader * hapticFeedback){ for(size_t i = 0; i < xr_actions.aVibration.size(); i++) if(!xr_actions.aVibration[i].stringPath.compare(stringPath)){ XrHapticActionInfo hapticActionInfo = {XR_TYPE_HAPTIC_ACTION_INFO}; hapticActionInfo.action = xr_actions.aVibration[i].action; hapticActionInfo.subactionPath = XR_NULL_PATH; xr_result = xrApplyHapticFeedback(xr_session, &hapticActionInfo, hapticFeedback); if(!xrCheckResult(xr_instance, xr_result, "xrApplyHapticFeedback")) return false; return true; } return false; } bool OpenXrApplication::stopHapticFeedback(string stringPath){ for(size_t i = 0; i < xr_actions.aVibration.size(); i++) if(!xr_actions.aVibration[i].stringPath.compare(stringPath)){ XrHapticActionInfo hapticActionInfo = {XR_TYPE_HAPTIC_ACTION_INFO}; hapticActionInfo.action = xr_actions.aVibration[i].action; hapticActionInfo.subactionPath = XR_NULL_PATH; xr_result = xrStopHapticFeedback(xr_session, &hapticActionInfo); if(!xrCheckResult(xr_instance, xr_result, "xrStopHapticFeedback")) return false; return true; } return false; } bool OpenXrApplication::setFrameByIndex(int index, int width, int height, void * frame, bool rgba){ if(index < 0 || (size_t)index >= xr_frames_data.size()) return false; xr_frames_width[index] = width; xr_frames_height[index] = height; xr_frames_data[index] = frame; xr_frames_is_rgba = rgba; return true; } #ifdef APPLICATION int main(){ OpenXrApplication * app = new OpenXrApplication(); vector<ActionPoseState> requestedActionPoseStates; // create instance string applicationName = "Omniverse (VR)"; string engineName = "OpenXR Engine"; vector<string> requestedApiLayers = { "XR_APILAYER_LUNARG_core_validation" }; vector<string> requestedExtensions = { #ifdef XR_USE_GRAPHICS_API_VULKAN #ifdef APP_USE_VULKAN2 XR_KHR_VULKAN_ENABLE2_EXTENSION_NAME, #else XR_KHR_VULKAN_ENABLE_EXTENSION_NAME, #endif #endif #ifdef XR_USE_GRAPHICS_API_OPENGL XR_KHR_OPENGL_ENABLE_EXTENSION_NAME, #endif }; app->createInstance(applicationName, engineName, requestedApiLayers, requestedExtensions); app->getSystem(XR_FORM_FACTOR_HEAD_MOUNTED_DISPLAY, XR_ENVIRONMENT_BLEND_MODE_OPAQUE, XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO); app->createSession(); bool exitRenderLoop = false; #ifdef XR_USE_GRAPHICS_API_OPENGL SDL_Event sdl_event; #endif while(true){ #ifdef XR_USE_GRAPHICS_API_OPENGL while(SDL_PollEvent(&sdl_event)) if (sdl_event.type == SDL_QUIT || (sdl_event.type == SDL_KEYDOWN && sdl_event.key.keysym.sym == SDLK_ESCAPE)) return 0; #endif app->pollEvents(&exitRenderLoop); if(exitRenderLoop) break; if(app->isSessionRunning()){ vector<ActionState> requestedActionStates; app->pollActions(requestedActionStates); app->renderViews(XR_REFERENCE_SPACE_TYPE_LOCAL, requestedActionPoseStates); } else{ // Throttle loop since xrWaitFrame won't be called. // std::this_thread::sleep_for(std::chrono::milliseconds(250)); } } return 0; } #endif #ifdef CTYPES extern "C" { OpenXrApplication * openXrApplication(){ return new OpenXrApplication(); } bool destroy(OpenXrApplication * app){ return app->destroy(); } // utils bool isSessionRunning(OpenXrApplication * app){ return app->isSessionRunning(); } bool getViewConfigurationViews(OpenXrApplication * app, XrViewConfigurationView * views, int viewsLength){ if((size_t)viewsLength != app->getViewConfigurationViewsSize()) return false; vector<XrViewConfigurationView> viewConfigurationView = app->getViewConfigurationViews(); for(size_t i = 0; i < viewConfigurationView.size(); i++) views[i] = viewConfigurationView[i]; return true; } int getViewConfigurationViewsSize(OpenXrApplication * app){ return app->getViewConfigurationViewsSize(); } // setup app bool createInstance(OpenXrApplication * app, const char * applicationName, const char * engineName, const char ** apiLayers, int apiLayersLength, const char ** extensions, int extensionsLength){ vector<string> requestedApiLayers; for(int i = 0; i < apiLayersLength; i++) requestedApiLayers.push_back(apiLayers[i]); vector<string> requestedExtensions; for(int i = 0; i < extensionsLength; i++) requestedExtensions.push_back(extensions[i]); return app->createInstance(applicationName, engineName, requestedApiLayers, requestedExtensions); } bool getSystem(OpenXrApplication * app, int formFactor, int blendMode, int configurationType){ return app->getSystem(XrFormFactor(formFactor), XrEnvironmentBlendMode(blendMode), XrViewConfigurationType(configurationType)); } bool createSession(OpenXrApplication * app){ return app->createSession(); } // actions bool addAction(OpenXrApplication * app, const char * stringPath, int actionType, int referenceSpaceType){ return app->addAction(stringPath, XrActionType(actionType), XrReferenceSpaceType(referenceSpaceType)); } bool applyHapticFeedback(OpenXrApplication * app, const char * stringPath, float amplitude, int64_t duration, float frequency){ XrHapticVibration vibration = {XR_TYPE_HAPTIC_VIBRATION}; vibration.amplitude = amplitude; vibration.duration = XrDuration(duration); vibration.frequency = frequency; return app->applyHapticFeedback(stringPath, (XrHapticBaseHeader*)&vibration); } bool stopHapticFeedback(OpenXrApplication * app, const char * stringPath){ return app->stopHapticFeedback(stringPath); } // poll data bool pollEvents(OpenXrApplication * app, bool * exitLoop){ return app->pollEvents(exitLoop); } bool pollActions(OpenXrApplication * app, ActionState * actionStates, int actionStatesLength){ vector<ActionState> requestedActionStates; bool status = app->pollActions(requestedActionStates); if(requestedActionStates.size() <= actionStatesLength) for(size_t i = 0; i < requestedActionStates.size(); i++) actionStates[i] = requestedActionStates[i]; return status; } // render bool renderViews(OpenXrApplication * app, int referenceSpaceType, ActionPoseState * actionPoseStates, int actionPoseStatesLength){ vector<ActionPoseState> requestedActionPoseStates; bool status = app->renderViews(XrReferenceSpaceType(referenceSpaceType), requestedActionPoseStates); if(requestedActionPoseStates.size() <= actionPoseStatesLength) for(size_t i = 0; i < requestedActionPoseStates.size(); i++) actionPoseStates[i] = requestedActionPoseStates[i]; return status; } // render utilities void setRenderCallback(OpenXrApplication * app, void (*callback)(int, XrView*, XrViewConfigurationView*)){ app->setRenderCallbackFromPointer(callback); } bool setFrames(OpenXrApplication * app, int leftWidth, int leftHeight, void * leftData, int rightWidth, int rightHeight, void * rightData, bool rgba){ if(app->getViewConfigurationViewsSize() == 1) return app->setFrameByIndex(0, leftWidth, leftHeight, leftData, rgba); else if(app->getViewConfigurationViewsSize() == 2){ bool status = app->setFrameByIndex(0, leftWidth, leftHeight, leftData, rgba); return status && app->setFrameByIndex(1, rightWidth, rightHeight, rightData, rgba); } return false; } } #endif
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/sources/pybind11_ext.py
import os import sys from distutils.core import setup from pybind11.setup_helpers import Pybind11Extension, build_ext # OV python (kit\python\include) if sys.platform == 'win32': python_library_dir = os.path.join(os.path.dirname(sys.executable), "include") elif sys.platform == 'linux': python_library_dir = os.path.join(os.path.dirname(sys.executable), "..", "lib") if not os.path.exists(python_library_dir): raise Exception("OV Python library directory not found: {}".format(python_library_dir)) ext_modules = [ Pybind11Extension("xrlib_p", ["pybind11_wrapper.cpp"], include_dirs=[os.path.join(os.getcwd(), "thirdparty", "openxr", "include"), os.path.join(os.getcwd(), "thirdparty", "opengl", "include"), os.path.join(os.getcwd(), "thirdparty", "sdl2")], library_dirs=[os.path.join(os.getcwd(), "thirdparty", "openxr", "lib"), os.path.join(os.getcwd(), "thirdparty", "opengl", "lib"), os.path.join(os.getcwd(), "thirdparty", "sdl2", "lib"), python_library_dir], libraries=["openxr_loader", "GL", "SDL2"], extra_link_args=["-Wl,-rpath=./bin"], undef_macros=["CTYPES", "APPLICATION"]), ] setup( name = 'openxr-lib', cmdclass = {'build_ext': build_ext}, ext_modules = ext_modules )
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/sources/BUILD.md
## Building from source ### Linux Install the following packages or dependencies ```bash sudo apt install libx11-dev ``` Setup a python environment. Change the `OV_APP` variable to the name of the Omniverse app you want to build for ```bash cd src/semu.xr.openxr/sources ~/.local/share/ov/pkg/OV_APP/kit/python/bin/python3 -m venv env # source the env source env/bin/activate # install required packages python -m pip install --upgrade pip python -m pip install pybind11 python -m pip install Cython ``` #### Build CTYPES-based library ```bash cd src/semu.xr.openxr/sources bash compile_ctypes.bash ``` #### Build PYBIND11-based library ```bash cd src/semu.xr.openxr/sources bash compile_pybind11.bash ```
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/sources/clean_compiled_files.bash
#!/bin/bash # delete old files rm -r build rm xrlib* rm xrapp*
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/sources/compile_ctypes.bash
#!/bin/bash # delete old files . clean_compiled_files.bash rm ../bin/xrlib_c* # set variables export OPENXR_DIR=$(pwd)"/thirdparty/openxr" export OPENGL_DIR=$(pwd)"/thirdparty/opengl" export SDL_DIR=$(pwd)"/thirdparty/sdl2" export DFLAGS="-DAPPLICATION -DCTYPES -DXR_USE_PLATFORM_XLIB -DXR_USE_GRAPHICS_API_OPENGL" export CFLAGS="-std=c++17 -pthread -O2 -fpermissive -Wwrite-strings" export INCFLAGS="-I$OPENGL_DIR/include -I$OPENXR_DIR/include -I$SDL_DIR" export LIBFLAGS="-L$OPENGL_DIR/lib -L$OPENXR_DIR/lib -L$SDL_DIR/lib" export LDFLAGS="-lopenxr_loader -lGL -lSDL2 -lX11" # -lvulkan -lSDL2_image -ldl # generate executable # g++ $DFLAGS $CFLAGS $INCFLAGS -o xrapp $CPPFILES xr_opengl.cpp xr.cpp $LIBFLAGS $LDFLAGS # generate object file g++ $DFLAGS $CFLAGS $INCFLAGS -fPIC -c -o xrlib.o xr.cpp $LIBFLAGS $LDFLAGS # generate shared library g++ -shared -Wl,-soname,xrlib_c.so -o xrlib_c.so xrlib.o # copy compiled file cp xrlib_c* ../bin/xrlib_c.so # delete temporal data rm -r build rm xrlib*
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/sources/layers/api_layers/XrApiLayer_core_validation.json
{ "file_format_version": "1.0.0", "api_layer": { "name": "XR_APILAYER_LUNARG_core_validation", "library_path": "/home/argus/Videos/xr/xr/layers/api_layers/libXrApiLayer_core_validation.so", "api_version": "1.0", "implementation_version": "1", "description": "API Layer to perform validation of api calls and parameters as they occur" } }
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/sources/layers/api_layers/XrApiLayer_api_dump.json
{ "file_format_version": "1.0.0", "api_layer": { "name": "XR_APILAYER_LUNARG_api_dump", "library_path": "/home/argus/Videos/xr/xr/layers/api_layers/libXrApiLayer_api_dump.so", "api_version": "1.0", "implementation_version": "1", "description": "API Layer to record api calls as they occur" } }
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/sources/thirdparty/openxr/include/openxr/openxr_platform.h
#ifndef OPENXR_PLATFORM_H_ #define OPENXR_PLATFORM_H_ 1 /* ** Copyright (c) 2017-2021, The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 OR MIT */ /* ** This header is generated from the Khronos OpenXR XML API Registry. ** */ #include "openxr.h" #ifdef __cplusplus extern "C" { #endif #ifdef XR_USE_PLATFORM_ANDROID #define XR_KHR_android_thread_settings 1 #define XR_KHR_android_thread_settings_SPEC_VERSION 5 #define XR_KHR_ANDROID_THREAD_SETTINGS_EXTENSION_NAME "XR_KHR_android_thread_settings" typedef enum XrAndroidThreadTypeKHR { XR_ANDROID_THREAD_TYPE_APPLICATION_MAIN_KHR = 1, XR_ANDROID_THREAD_TYPE_APPLICATION_WORKER_KHR = 2, XR_ANDROID_THREAD_TYPE_RENDERER_MAIN_KHR = 3, XR_ANDROID_THREAD_TYPE_RENDERER_WORKER_KHR = 4, XR_ANDROID_THREAD_TYPE_MAX_ENUM_KHR = 0x7FFFFFFF } XrAndroidThreadTypeKHR; typedef XrResult (XRAPI_PTR *PFN_xrSetAndroidApplicationThreadKHR)(XrSession session, XrAndroidThreadTypeKHR threadType, uint32_t threadId); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrSetAndroidApplicationThreadKHR( XrSession session, XrAndroidThreadTypeKHR threadType, uint32_t threadId); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #endif /* XR_USE_PLATFORM_ANDROID */ #ifdef XR_USE_PLATFORM_ANDROID #define XR_KHR_android_surface_swapchain 1 #define XR_KHR_android_surface_swapchain_SPEC_VERSION 4 #define XR_KHR_ANDROID_SURFACE_SWAPCHAIN_EXTENSION_NAME "XR_KHR_android_surface_swapchain" typedef XrResult (XRAPI_PTR *PFN_xrCreateSwapchainAndroidSurfaceKHR)(XrSession session, const XrSwapchainCreateInfo* info, XrSwapchain* swapchain, jobject* surface); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrCreateSwapchainAndroidSurfaceKHR( XrSession session, const XrSwapchainCreateInfo* info, XrSwapchain* swapchain, jobject* surface); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #endif /* XR_USE_PLATFORM_ANDROID */ #ifdef XR_USE_PLATFORM_ANDROID #define XR_KHR_android_create_instance 1 #define XR_KHR_android_create_instance_SPEC_VERSION 3 #define XR_KHR_ANDROID_CREATE_INSTANCE_EXTENSION_NAME "XR_KHR_android_create_instance" // XrInstanceCreateInfoAndroidKHR extends XrInstanceCreateInfo typedef struct XrInstanceCreateInfoAndroidKHR { XrStructureType type; const void* XR_MAY_ALIAS next; void* XR_MAY_ALIAS applicationVM; void* XR_MAY_ALIAS applicationActivity; } XrInstanceCreateInfoAndroidKHR; #endif /* XR_USE_PLATFORM_ANDROID */ #ifdef XR_USE_GRAPHICS_API_VULKAN #define XR_KHR_vulkan_swapchain_format_list 1 #define XR_KHR_vulkan_swapchain_format_list_SPEC_VERSION 4 #define XR_KHR_VULKAN_SWAPCHAIN_FORMAT_LIST_EXTENSION_NAME "XR_KHR_vulkan_swapchain_format_list" typedef struct XrVulkanSwapchainFormatListCreateInfoKHR { XrStructureType type; const void* XR_MAY_ALIAS next; uint32_t viewFormatCount; const VkFormat* viewFormats; } XrVulkanSwapchainFormatListCreateInfoKHR; #endif /* XR_USE_GRAPHICS_API_VULKAN */ #ifdef XR_USE_GRAPHICS_API_OPENGL #define XR_KHR_opengl_enable 1 #define XR_KHR_opengl_enable_SPEC_VERSION 10 #define XR_KHR_OPENGL_ENABLE_EXTENSION_NAME "XR_KHR_opengl_enable" #ifdef XR_USE_PLATFORM_WIN32 // XrGraphicsBindingOpenGLWin32KHR extends XrSessionCreateInfo typedef struct XrGraphicsBindingOpenGLWin32KHR { XrStructureType type; const void* XR_MAY_ALIAS next; HDC hDC; HGLRC hGLRC; } XrGraphicsBindingOpenGLWin32KHR; #endif // XR_USE_PLATFORM_WIN32 #ifdef XR_USE_PLATFORM_XLIB // XrGraphicsBindingOpenGLXlibKHR extends XrSessionCreateInfo typedef struct XrGraphicsBindingOpenGLXlibKHR { XrStructureType type; const void* XR_MAY_ALIAS next; Display* xDisplay; uint32_t visualid; GLXFBConfig glxFBConfig; GLXDrawable glxDrawable; GLXContext glxContext; } XrGraphicsBindingOpenGLXlibKHR; #endif // XR_USE_PLATFORM_XLIB #ifdef XR_USE_PLATFORM_XCB // XrGraphicsBindingOpenGLXcbKHR extends XrSessionCreateInfo typedef struct XrGraphicsBindingOpenGLXcbKHR { XrStructureType type; const void* XR_MAY_ALIAS next; xcb_connection_t* connection; uint32_t screenNumber; xcb_glx_fbconfig_t fbconfigid; xcb_visualid_t visualid; xcb_glx_drawable_t glxDrawable; xcb_glx_context_t glxContext; } XrGraphicsBindingOpenGLXcbKHR; #endif // XR_USE_PLATFORM_XCB #ifdef XR_USE_PLATFORM_WAYLAND // XrGraphicsBindingOpenGLWaylandKHR extends XrSessionCreateInfo typedef struct XrGraphicsBindingOpenGLWaylandKHR { XrStructureType type; const void* XR_MAY_ALIAS next; struct wl_display* display; } XrGraphicsBindingOpenGLWaylandKHR; #endif // XR_USE_PLATFORM_WAYLAND typedef struct XrSwapchainImageOpenGLKHR { XrStructureType type; void* XR_MAY_ALIAS next; uint32_t image; } XrSwapchainImageOpenGLKHR; typedef struct XrGraphicsRequirementsOpenGLKHR { XrStructureType type; void* XR_MAY_ALIAS next; XrVersion minApiVersionSupported; XrVersion maxApiVersionSupported; } XrGraphicsRequirementsOpenGLKHR; typedef XrResult (XRAPI_PTR *PFN_xrGetOpenGLGraphicsRequirementsKHR)(XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsOpenGLKHR* graphicsRequirements); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrGetOpenGLGraphicsRequirementsKHR( XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsOpenGLKHR* graphicsRequirements); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #endif /* XR_USE_GRAPHICS_API_OPENGL */ #ifdef XR_USE_GRAPHICS_API_OPENGL_ES #define XR_KHR_opengl_es_enable 1 #define XR_KHR_opengl_es_enable_SPEC_VERSION 8 #define XR_KHR_OPENGL_ES_ENABLE_EXTENSION_NAME "XR_KHR_opengl_es_enable" #ifdef XR_USE_PLATFORM_ANDROID // XrGraphicsBindingOpenGLESAndroidKHR extends XrSessionCreateInfo typedef struct XrGraphicsBindingOpenGLESAndroidKHR { XrStructureType type; const void* XR_MAY_ALIAS next; EGLDisplay display; EGLConfig config; EGLContext context; } XrGraphicsBindingOpenGLESAndroidKHR; #endif // XR_USE_PLATFORM_ANDROID typedef struct XrSwapchainImageOpenGLESKHR { XrStructureType type; void* XR_MAY_ALIAS next; uint32_t image; } XrSwapchainImageOpenGLESKHR; typedef struct XrGraphicsRequirementsOpenGLESKHR { XrStructureType type; void* XR_MAY_ALIAS next; XrVersion minApiVersionSupported; XrVersion maxApiVersionSupported; } XrGraphicsRequirementsOpenGLESKHR; typedef XrResult (XRAPI_PTR *PFN_xrGetOpenGLESGraphicsRequirementsKHR)(XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsOpenGLESKHR* graphicsRequirements); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrGetOpenGLESGraphicsRequirementsKHR( XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsOpenGLESKHR* graphicsRequirements); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #endif /* XR_USE_GRAPHICS_API_OPENGL_ES */ #ifdef XR_USE_GRAPHICS_API_VULKAN #define XR_KHR_vulkan_enable 1 #define XR_KHR_vulkan_enable_SPEC_VERSION 8 #define XR_KHR_VULKAN_ENABLE_EXTENSION_NAME "XR_KHR_vulkan_enable" // XrGraphicsBindingVulkanKHR extends XrSessionCreateInfo typedef struct XrGraphicsBindingVulkanKHR { XrStructureType type; const void* XR_MAY_ALIAS next; VkInstance instance; VkPhysicalDevice physicalDevice; VkDevice device; uint32_t queueFamilyIndex; uint32_t queueIndex; } XrGraphicsBindingVulkanKHR; typedef struct XrSwapchainImageVulkanKHR { XrStructureType type; void* XR_MAY_ALIAS next; VkImage image; } XrSwapchainImageVulkanKHR; typedef struct XrGraphicsRequirementsVulkanKHR { XrStructureType type; void* XR_MAY_ALIAS next; XrVersion minApiVersionSupported; XrVersion maxApiVersionSupported; } XrGraphicsRequirementsVulkanKHR; typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanInstanceExtensionsKHR)(XrInstance instance, XrSystemId systemId, uint32_t bufferCapacityInput, uint32_t* bufferCountOutput, char* buffer); typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanDeviceExtensionsKHR)(XrInstance instance, XrSystemId systemId, uint32_t bufferCapacityInput, uint32_t* bufferCountOutput, char* buffer); typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanGraphicsDeviceKHR)(XrInstance instance, XrSystemId systemId, VkInstance vkInstance, VkPhysicalDevice* vkPhysicalDevice); typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanGraphicsRequirementsKHR)(XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsVulkanKHR* graphicsRequirements); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanInstanceExtensionsKHR( XrInstance instance, XrSystemId systemId, uint32_t bufferCapacityInput, uint32_t* bufferCountOutput, char* buffer); XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanDeviceExtensionsKHR( XrInstance instance, XrSystemId systemId, uint32_t bufferCapacityInput, uint32_t* bufferCountOutput, char* buffer); XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanGraphicsDeviceKHR( XrInstance instance, XrSystemId systemId, VkInstance vkInstance, VkPhysicalDevice* vkPhysicalDevice); XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanGraphicsRequirementsKHR( XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsVulkanKHR* graphicsRequirements); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #endif /* XR_USE_GRAPHICS_API_VULKAN */ #ifdef XR_USE_GRAPHICS_API_D3D11 #define XR_KHR_D3D11_enable 1 #define XR_KHR_D3D11_enable_SPEC_VERSION 8 #define XR_KHR_D3D11_ENABLE_EXTENSION_NAME "XR_KHR_D3D11_enable" // XrGraphicsBindingD3D11KHR extends XrSessionCreateInfo typedef struct XrGraphicsBindingD3D11KHR { XrStructureType type; const void* XR_MAY_ALIAS next; ID3D11Device* device; } XrGraphicsBindingD3D11KHR; typedef struct XrSwapchainImageD3D11KHR { XrStructureType type; void* XR_MAY_ALIAS next; ID3D11Texture2D* texture; } XrSwapchainImageD3D11KHR; typedef struct XrGraphicsRequirementsD3D11KHR { XrStructureType type; void* XR_MAY_ALIAS next; LUID adapterLuid; D3D_FEATURE_LEVEL minFeatureLevel; } XrGraphicsRequirementsD3D11KHR; typedef XrResult (XRAPI_PTR *PFN_xrGetD3D11GraphicsRequirementsKHR)(XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsD3D11KHR* graphicsRequirements); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrGetD3D11GraphicsRequirementsKHR( XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsD3D11KHR* graphicsRequirements); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #endif /* XR_USE_GRAPHICS_API_D3D11 */ #ifdef XR_USE_GRAPHICS_API_D3D12 #define XR_KHR_D3D12_enable 1 #define XR_KHR_D3D12_enable_SPEC_VERSION 8 #define XR_KHR_D3D12_ENABLE_EXTENSION_NAME "XR_KHR_D3D12_enable" // XrGraphicsBindingD3D12KHR extends XrSessionCreateInfo typedef struct XrGraphicsBindingD3D12KHR { XrStructureType type; const void* XR_MAY_ALIAS next; ID3D12Device* device; ID3D12CommandQueue* queue; } XrGraphicsBindingD3D12KHR; typedef struct XrSwapchainImageD3D12KHR { XrStructureType type; void* XR_MAY_ALIAS next; ID3D12Resource* texture; } XrSwapchainImageD3D12KHR; typedef struct XrGraphicsRequirementsD3D12KHR { XrStructureType type; void* XR_MAY_ALIAS next; LUID adapterLuid; D3D_FEATURE_LEVEL minFeatureLevel; } XrGraphicsRequirementsD3D12KHR; typedef XrResult (XRAPI_PTR *PFN_xrGetD3D12GraphicsRequirementsKHR)(XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsD3D12KHR* graphicsRequirements); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrGetD3D12GraphicsRequirementsKHR( XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsD3D12KHR* graphicsRequirements); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #endif /* XR_USE_GRAPHICS_API_D3D12 */ #ifdef XR_USE_PLATFORM_WIN32 #define XR_KHR_win32_convert_performance_counter_time 1 #define XR_KHR_win32_convert_performance_counter_time_SPEC_VERSION 1 #define XR_KHR_WIN32_CONVERT_PERFORMANCE_COUNTER_TIME_EXTENSION_NAME "XR_KHR_win32_convert_performance_counter_time" typedef XrResult (XRAPI_PTR *PFN_xrConvertWin32PerformanceCounterToTimeKHR)(XrInstance instance, const LARGE_INTEGER* performanceCounter, XrTime* time); typedef XrResult (XRAPI_PTR *PFN_xrConvertTimeToWin32PerformanceCounterKHR)(XrInstance instance, XrTime time, LARGE_INTEGER* performanceCounter); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrConvertWin32PerformanceCounterToTimeKHR( XrInstance instance, const LARGE_INTEGER* performanceCounter, XrTime* time); XRAPI_ATTR XrResult XRAPI_CALL xrConvertTimeToWin32PerformanceCounterKHR( XrInstance instance, XrTime time, LARGE_INTEGER* performanceCounter); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #endif /* XR_USE_PLATFORM_WIN32 */ #ifdef XR_USE_TIMESPEC #define XR_KHR_convert_timespec_time 1 #define XR_KHR_convert_timespec_time_SPEC_VERSION 1 #define XR_KHR_CONVERT_TIMESPEC_TIME_EXTENSION_NAME "XR_KHR_convert_timespec_time" typedef XrResult (XRAPI_PTR *PFN_xrConvertTimespecTimeToTimeKHR)(XrInstance instance, const struct timespec* timespecTime, XrTime* time); typedef XrResult (XRAPI_PTR *PFN_xrConvertTimeToTimespecTimeKHR)(XrInstance instance, XrTime time, struct timespec* timespecTime); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrConvertTimespecTimeToTimeKHR( XrInstance instance, const struct timespec* timespecTime, XrTime* time); XRAPI_ATTR XrResult XRAPI_CALL xrConvertTimeToTimespecTimeKHR( XrInstance instance, XrTime time, struct timespec* timespecTime); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #endif /* XR_USE_TIMESPEC */ #ifdef XR_USE_PLATFORM_ANDROID #define XR_KHR_loader_init_android 1 #define XR_KHR_loader_init_android_SPEC_VERSION 1 #define XR_KHR_LOADER_INIT_ANDROID_EXTENSION_NAME "XR_KHR_loader_init_android" typedef struct XrLoaderInitInfoAndroidKHR { XrStructureType type; const void* XR_MAY_ALIAS next; void* XR_MAY_ALIAS applicationVM; void* XR_MAY_ALIAS applicationContext; } XrLoaderInitInfoAndroidKHR; #endif /* XR_USE_PLATFORM_ANDROID */ #ifdef XR_USE_GRAPHICS_API_VULKAN #define XR_KHR_vulkan_enable2 1 #define XR_KHR_vulkan_enable2_SPEC_VERSION 2 #define XR_KHR_VULKAN_ENABLE2_EXTENSION_NAME "XR_KHR_vulkan_enable2" typedef XrFlags64 XrVulkanInstanceCreateFlagsKHR; // Flag bits for XrVulkanInstanceCreateFlagsKHR typedef XrFlags64 XrVulkanDeviceCreateFlagsKHR; // Flag bits for XrVulkanDeviceCreateFlagsKHR typedef struct XrVulkanInstanceCreateInfoKHR { XrStructureType type; const void* XR_MAY_ALIAS next; XrSystemId systemId; XrVulkanInstanceCreateFlagsKHR createFlags; PFN_vkGetInstanceProcAddr pfnGetInstanceProcAddr; const VkInstanceCreateInfo* vulkanCreateInfo; const VkAllocationCallbacks* vulkanAllocator; } XrVulkanInstanceCreateInfoKHR; typedef struct XrVulkanDeviceCreateInfoKHR { XrStructureType type; const void* XR_MAY_ALIAS next; XrSystemId systemId; XrVulkanDeviceCreateFlagsKHR createFlags; PFN_vkGetInstanceProcAddr pfnGetInstanceProcAddr; VkPhysicalDevice vulkanPhysicalDevice; const VkDeviceCreateInfo* vulkanCreateInfo; const VkAllocationCallbacks* vulkanAllocator; } XrVulkanDeviceCreateInfoKHR; typedef XrGraphicsBindingVulkanKHR XrGraphicsBindingVulkan2KHR; typedef struct XrVulkanGraphicsDeviceGetInfoKHR { XrStructureType type; const void* XR_MAY_ALIAS next; XrSystemId systemId; VkInstance vulkanInstance; } XrVulkanGraphicsDeviceGetInfoKHR; typedef XrSwapchainImageVulkanKHR XrSwapchainImageVulkan2KHR; typedef XrGraphicsRequirementsVulkanKHR XrGraphicsRequirementsVulkan2KHR; typedef XrResult (XRAPI_PTR *PFN_xrCreateVulkanInstanceKHR)(XrInstance instance, const XrVulkanInstanceCreateInfoKHR* createInfo, VkInstance* vulkanInstance, VkResult* vulkanResult); typedef XrResult (XRAPI_PTR *PFN_xrCreateVulkanDeviceKHR)(XrInstance instance, const XrVulkanDeviceCreateInfoKHR* createInfo, VkDevice* vulkanDevice, VkResult* vulkanResult); typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanGraphicsDevice2KHR)(XrInstance instance, const XrVulkanGraphicsDeviceGetInfoKHR* getInfo, VkPhysicalDevice* vulkanPhysicalDevice); typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanGraphicsRequirements2KHR)(XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsVulkanKHR* graphicsRequirements); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrCreateVulkanInstanceKHR( XrInstance instance, const XrVulkanInstanceCreateInfoKHR* createInfo, VkInstance* vulkanInstance, VkResult* vulkanResult); XRAPI_ATTR XrResult XRAPI_CALL xrCreateVulkanDeviceKHR( XrInstance instance, const XrVulkanDeviceCreateInfoKHR* createInfo, VkDevice* vulkanDevice, VkResult* vulkanResult); XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanGraphicsDevice2KHR( XrInstance instance, const XrVulkanGraphicsDeviceGetInfoKHR* getInfo, VkPhysicalDevice* vulkanPhysicalDevice); XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanGraphicsRequirements2KHR( XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsVulkanKHR* graphicsRequirements); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #endif /* XR_USE_GRAPHICS_API_VULKAN */ #ifdef XR_USE_PLATFORM_EGL #define XR_MNDX_egl_enable 1 #define XR_MNDX_egl_enable_SPEC_VERSION 1 #define XR_MNDX_EGL_ENABLE_EXTENSION_NAME "XR_MNDX_egl_enable" // XrGraphicsBindingEGLMNDX extends XrSessionCreateInfo typedef struct XrGraphicsBindingEGLMNDX { XrStructureType type; const void* XR_MAY_ALIAS next; PFNEGLGETPROCADDRESSPROC getProcAddress; EGLDisplay display; EGLConfig config; EGLContext context; } XrGraphicsBindingEGLMNDX; #endif /* XR_USE_PLATFORM_EGL */ #ifdef XR_USE_PLATFORM_WIN32 #define XR_MSFT_perception_anchor_interop 1 #define XR_MSFT_perception_anchor_interop_SPEC_VERSION 1 #define XR_MSFT_PERCEPTION_ANCHOR_INTEROP_EXTENSION_NAME "XR_MSFT_perception_anchor_interop" typedef XrResult (XRAPI_PTR *PFN_xrCreateSpatialAnchorFromPerceptionAnchorMSFT)(XrSession session, IUnknown* perceptionAnchor, XrSpatialAnchorMSFT* anchor); typedef XrResult (XRAPI_PTR *PFN_xrTryGetPerceptionAnchorFromSpatialAnchorMSFT)(XrSession session, XrSpatialAnchorMSFT anchor, IUnknown** perceptionAnchor); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrCreateSpatialAnchorFromPerceptionAnchorMSFT( XrSession session, IUnknown* perceptionAnchor, XrSpatialAnchorMSFT* anchor); XRAPI_ATTR XrResult XRAPI_CALL xrTryGetPerceptionAnchorFromSpatialAnchorMSFT( XrSession session, XrSpatialAnchorMSFT anchor, IUnknown** perceptionAnchor); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #endif /* XR_USE_PLATFORM_WIN32 */ #ifdef XR_USE_PLATFORM_WIN32 #define XR_MSFT_holographic_window_attachment 1 #define XR_MSFT_holographic_window_attachment_SPEC_VERSION 1 #define XR_MSFT_HOLOGRAPHIC_WINDOW_ATTACHMENT_EXTENSION_NAME "XR_MSFT_holographic_window_attachment" #ifdef XR_USE_PLATFORM_WIN32 // XrHolographicWindowAttachmentMSFT extends XrSessionCreateInfo typedef struct XrHolographicWindowAttachmentMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; IUnknown* holographicSpace; IUnknown* coreWindow; } XrHolographicWindowAttachmentMSFT; #endif // XR_USE_PLATFORM_WIN32 #endif /* XR_USE_PLATFORM_WIN32 */ #ifdef XR_USE_PLATFORM_ANDROID #define XR_FB_android_surface_swapchain_create 1 #define XR_FB_android_surface_swapchain_create_SPEC_VERSION 1 #define XR_FB_ANDROID_SURFACE_SWAPCHAIN_CREATE_EXTENSION_NAME "XR_FB_android_surface_swapchain_create" typedef XrFlags64 XrAndroidSurfaceSwapchainFlagsFB; // Flag bits for XrAndroidSurfaceSwapchainFlagsFB static const XrAndroidSurfaceSwapchainFlagsFB XR_ANDROID_SURFACE_SWAPCHAIN_SYNCHRONOUS_BIT_FB = 0x00000001; static const XrAndroidSurfaceSwapchainFlagsFB XR_ANDROID_SURFACE_SWAPCHAIN_USE_TIMESTAMPS_BIT_FB = 0x00000002; #ifdef XR_USE_PLATFORM_ANDROID // XrAndroidSurfaceSwapchainCreateInfoFB extends XrSwapchainCreateInfo typedef struct XrAndroidSurfaceSwapchainCreateInfoFB { XrStructureType type; const void* XR_MAY_ALIAS next; XrAndroidSurfaceSwapchainFlagsFB createFlags; } XrAndroidSurfaceSwapchainCreateInfoFB; #endif // XR_USE_PLATFORM_ANDROID #endif /* XR_USE_PLATFORM_ANDROID */ #ifdef XR_USE_PLATFORM_WIN32 #define XR_OCULUS_audio_device_guid 1 #define XR_OCULUS_audio_device_guid_SPEC_VERSION 1 #define XR_OCULUS_AUDIO_DEVICE_GUID_EXTENSION_NAME "XR_OCULUS_audio_device_guid" #define XR_MAX_AUDIO_DEVICE_STR_SIZE_OCULUS 128 typedef XrResult (XRAPI_PTR *PFN_xrGetAudioOutputDeviceGuidOculus)(XrInstance instance, wchar_t buffer[XR_MAX_AUDIO_DEVICE_STR_SIZE_OCULUS]); typedef XrResult (XRAPI_PTR *PFN_xrGetAudioInputDeviceGuidOculus)(XrInstance instance, wchar_t buffer[XR_MAX_AUDIO_DEVICE_STR_SIZE_OCULUS]); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrGetAudioOutputDeviceGuidOculus( XrInstance instance, wchar_t buffer[XR_MAX_AUDIO_DEVICE_STR_SIZE_OCULUS]); XRAPI_ATTR XrResult XRAPI_CALL xrGetAudioInputDeviceGuidOculus( XrInstance instance, wchar_t buffer[XR_MAX_AUDIO_DEVICE_STR_SIZE_OCULUS]); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #endif /* XR_USE_PLATFORM_WIN32 */ #ifdef XR_USE_GRAPHICS_API_VULKAN #define XR_FB_foveation_vulkan 1 #define XR_FB_foveation_vulkan_SPEC_VERSION 1 #define XR_FB_FOVEATION_VULKAN_EXTENSION_NAME "XR_FB_foveation_vulkan" // XrSwapchainImageFoveationVulkanFB extends XrSwapchainImageVulkanKHR typedef struct XrSwapchainImageFoveationVulkanFB { XrStructureType type; void* XR_MAY_ALIAS next; VkImage image; uint32_t width; uint32_t height; } XrSwapchainImageFoveationVulkanFB; #endif /* XR_USE_GRAPHICS_API_VULKAN */ #ifdef XR_USE_PLATFORM_ANDROID #define XR_FB_swapchain_update_state_android_surface 1 #define XR_FB_swapchain_update_state_android_surface_SPEC_VERSION 1 #define XR_FB_SWAPCHAIN_UPDATE_STATE_ANDROID_SURFACE_EXTENSION_NAME "XR_FB_swapchain_update_state_android_surface" #ifdef XR_USE_PLATFORM_ANDROID typedef struct XrSwapchainStateAndroidSurfaceDimensionsFB { XrStructureType type; void* XR_MAY_ALIAS next; uint32_t width; uint32_t height; } XrSwapchainStateAndroidSurfaceDimensionsFB; #endif // XR_USE_PLATFORM_ANDROID #endif /* XR_USE_PLATFORM_ANDROID */ #ifdef XR_USE_GRAPHICS_API_OPENGL_ES #define XR_FB_swapchain_update_state_opengl_es 1 #define XR_FB_swapchain_update_state_opengl_es_SPEC_VERSION 1 #define XR_FB_SWAPCHAIN_UPDATE_STATE_OPENGL_ES_EXTENSION_NAME "XR_FB_swapchain_update_state_opengl_es" #ifdef XR_USE_GRAPHICS_API_OPENGL_ES typedef struct XrSwapchainStateSamplerOpenGLESFB { XrStructureType type; void* XR_MAY_ALIAS next; EGLenum minFilter; EGLenum magFilter; EGLenum wrapModeS; EGLenum wrapModeT; EGLenum swizzleRed; EGLenum swizzleGreen; EGLenum swizzleBlue; EGLenum swizzleAlpha; float maxAnisotropy; XrColor4f borderColor; } XrSwapchainStateSamplerOpenGLESFB; #endif // XR_USE_GRAPHICS_API_OPENGL_ES #endif /* XR_USE_GRAPHICS_API_OPENGL_ES */ #ifdef XR_USE_GRAPHICS_API_VULKAN #define XR_FB_swapchain_update_state_vulkan 1 #define XR_FB_swapchain_update_state_vulkan_SPEC_VERSION 1 #define XR_FB_SWAPCHAIN_UPDATE_STATE_VULKAN_EXTENSION_NAME "XR_FB_swapchain_update_state_vulkan" #ifdef XR_USE_GRAPHICS_API_VULKAN typedef struct XrSwapchainStateSamplerVulkanFB { XrStructureType type; void* XR_MAY_ALIAS next; VkFilter minFilter; VkFilter magFilter; VkSamplerMipmapMode mipmapMode; VkSamplerAddressMode wrapModeS; VkSamplerAddressMode wrapModeT; VkComponentSwizzle swizzleRed; VkComponentSwizzle swizzleGreen; VkComponentSwizzle swizzleBlue; VkComponentSwizzle swizzleAlpha; float maxAnisotropy; XrColor4f borderColor; } XrSwapchainStateSamplerVulkanFB; #endif // XR_USE_GRAPHICS_API_VULKAN #endif /* XR_USE_GRAPHICS_API_VULKAN */ #ifdef __cplusplus } #endif #endif
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/sources/thirdparty/openxr/include/openxr/openxr_platform_defines.h
/* ** Copyright (c) 2017-2021, The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 OR MIT */ #ifndef OPENXR_PLATFORM_DEFINES_H_ #define OPENXR_PLATFORM_DEFINES_H_ 1 #ifdef __cplusplus extern "C" { #endif /* Platform-specific calling convention macros. * * Platforms should define these so that OpenXR clients call OpenXR functions * with the same calling conventions that the OpenXR implementation expects. * * XRAPI_ATTR - Placed before the return type in function declarations. * Useful for C++11 and GCC/Clang-style function attribute syntax. * XRAPI_CALL - Placed after the return type in function declarations. * Useful for MSVC-style calling convention syntax. * XRAPI_PTR - Placed between the '(' and '*' in function pointer types. * * Function declaration: XRAPI_ATTR void XRAPI_CALL xrFunction(void); * Function pointer type: typedef void (XRAPI_PTR *PFN_xrFunction)(void); */ #if defined(_WIN32) #define XRAPI_ATTR // On Windows, functions use the stdcall convention #define XRAPI_CALL __stdcall #define XRAPI_PTR XRAPI_CALL #elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7 #error "API not supported for the 'armeabi' NDK ABI" #elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE) // On Android 32-bit ARM targets, functions use the "hardfloat" // calling convention, i.e. float parameters are passed in registers. This // is true even if the rest of the application passes floats on the stack, // as it does by default when compiling for the armeabi-v7a NDK ABI. #define XRAPI_ATTR __attribute__((pcs("aapcs-vfp"))) #define XRAPI_CALL #define XRAPI_PTR XRAPI_ATTR #else // On other platforms, use the default calling convention #define XRAPI_ATTR #define XRAPI_CALL #define XRAPI_PTR #endif #include <stddef.h> #if !defined(XR_NO_STDINT_H) #if defined(_MSC_VER) && (_MSC_VER < 1600) typedef signed __int8 int8_t; typedef unsigned __int8 uint8_t; typedef signed __int16 int16_t; typedef unsigned __int16 uint16_t; typedef signed __int32 int32_t; typedef unsigned __int32 uint32_t; typedef signed __int64 int64_t; typedef unsigned __int64 uint64_t; #else #include <stdint.h> #endif #endif // !defined( XR_NO_STDINT_H ) // XR_PTR_SIZE (in bytes) #if (defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)) #define XR_PTR_SIZE 8 #else #define XR_PTR_SIZE 4 #endif // Needed so we can use clang __has_feature portably. #if !defined(XR_COMPILER_HAS_FEATURE) #if defined(__clang__) #define XR_COMPILER_HAS_FEATURE(x) __has_feature(x) #else #define XR_COMPILER_HAS_FEATURE(x) 0 #endif #endif // Identifies if the current compiler has C++11 support enabled. // Does not by itself identify if any given C++11 feature is present. #if !defined(XR_CPP11_ENABLED) && defined(__cplusplus) #if defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__) #define XR_CPP11_ENABLED 1 #elif defined(_MSC_VER) && (_MSC_VER >= 1600) #define XR_CPP11_ENABLED 1 #elif (__cplusplus >= 201103L) // 201103 is the first C++11 version. #define XR_CPP11_ENABLED 1 #endif #endif // Identifies if the current compiler supports C++11 nullptr. #if !defined(XR_CPP_NULLPTR_SUPPORTED) #if defined(XR_CPP11_ENABLED) && \ ((defined(__clang__) && XR_COMPILER_HAS_FEATURE(cxx_nullptr)) || \ (defined(__GNUC__) && (((__GNUC__ * 1000) + __GNUC_MINOR__) >= 4006)) || \ (defined(_MSC_VER) && (_MSC_VER >= 1600)) || \ (defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 403))) #define XR_CPP_NULLPTR_SUPPORTED 1 #endif #endif #ifdef __cplusplus } #endif #endif
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/sources/thirdparty/openxr/include/openxr/openxr.h
#ifndef OPENXR_H_ #define OPENXR_H_ 1 /* ** Copyright (c) 2017-2021, The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 OR MIT */ /* ** This header is generated from the Khronos OpenXR XML API Registry. ** */ #ifdef __cplusplus extern "C" { #endif #define XR_VERSION_1_0 1 #include "openxr_platform_defines.h" #define XR_MAKE_VERSION(major, minor, patch) \ ((((major) & 0xffffULL) << 48) | (((minor) & 0xffffULL) << 32) | ((patch) & 0xffffffffULL)) // OpenXR current version number. #define XR_CURRENT_API_VERSION XR_MAKE_VERSION(1, 0, 20) #define XR_VERSION_MAJOR(version) (uint16_t)(((uint64_t)(version) >> 48)& 0xffffULL) #define XR_VERSION_MINOR(version) (uint16_t)(((uint64_t)(version) >> 32) & 0xffffULL) #define XR_VERSION_PATCH(version) (uint32_t)((uint64_t)(version) & 0xffffffffULL) #if !defined(XR_NULL_HANDLE) #if (XR_PTR_SIZE == 8) && XR_CPP_NULLPTR_SUPPORTED #define XR_NULL_HANDLE nullptr #else #define XR_NULL_HANDLE 0 #endif #endif #define XR_NULL_SYSTEM_ID 0 #define XR_NULL_PATH 0 #define XR_SUCCEEDED(result) ((result) >= 0) #define XR_FAILED(result) ((result) < 0) #define XR_UNQUALIFIED_SUCCESS(result) ((result) == 0) #define XR_NO_DURATION 0 #define XR_INFINITE_DURATION 0x7fffffffffffffffLL #define XR_MIN_HAPTIC_DURATION -1 #define XR_FREQUENCY_UNSPECIFIED 0 #define XR_MAX_EVENT_DATA_SIZE sizeof(XrEventDataBuffer) #if !defined(XR_MAY_ALIAS) #if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4)) #define XR_MAY_ALIAS __attribute__((__may_alias__)) #else #define XR_MAY_ALIAS #endif #endif #if !defined(XR_DEFINE_HANDLE) #if (XR_PTR_SIZE == 8) #define XR_DEFINE_HANDLE(object) typedef struct object##_T* object; #else #define XR_DEFINE_HANDLE(object) typedef uint64_t object; #endif #endif #if !defined(XR_DEFINE_ATOM) #define XR_DEFINE_ATOM(object) typedef uint64_t object; #endif typedef uint64_t XrVersion; typedef uint64_t XrFlags64; XR_DEFINE_ATOM(XrSystemId) typedef uint32_t XrBool32; XR_DEFINE_ATOM(XrPath) typedef int64_t XrTime; typedef int64_t XrDuration; XR_DEFINE_HANDLE(XrInstance) XR_DEFINE_HANDLE(XrSession) XR_DEFINE_HANDLE(XrSpace) XR_DEFINE_HANDLE(XrAction) XR_DEFINE_HANDLE(XrSwapchain) XR_DEFINE_HANDLE(XrActionSet) #define XR_TRUE 1 #define XR_FALSE 0 #define XR_MAX_EXTENSION_NAME_SIZE 128 #define XR_MAX_API_LAYER_NAME_SIZE 256 #define XR_MAX_API_LAYER_DESCRIPTION_SIZE 256 #define XR_MAX_SYSTEM_NAME_SIZE 256 #define XR_MAX_APPLICATION_NAME_SIZE 128 #define XR_MAX_ENGINE_NAME_SIZE 128 #define XR_MAX_RUNTIME_NAME_SIZE 128 #define XR_MAX_PATH_LENGTH 256 #define XR_MAX_STRUCTURE_NAME_SIZE 64 #define XR_MAX_RESULT_STRING_SIZE 64 #define XR_MIN_COMPOSITION_LAYERS_SUPPORTED 16 #define XR_MAX_ACTION_SET_NAME_SIZE 64 #define XR_MAX_LOCALIZED_ACTION_SET_NAME_SIZE 128 #define XR_MAX_ACTION_NAME_SIZE 64 #define XR_MAX_LOCALIZED_ACTION_NAME_SIZE 128 typedef enum XrResult { XR_SUCCESS = 0, XR_TIMEOUT_EXPIRED = 1, XR_SESSION_LOSS_PENDING = 3, XR_EVENT_UNAVAILABLE = 4, XR_SPACE_BOUNDS_UNAVAILABLE = 7, XR_SESSION_NOT_FOCUSED = 8, XR_FRAME_DISCARDED = 9, XR_ERROR_VALIDATION_FAILURE = -1, XR_ERROR_RUNTIME_FAILURE = -2, XR_ERROR_OUT_OF_MEMORY = -3, XR_ERROR_API_VERSION_UNSUPPORTED = -4, XR_ERROR_INITIALIZATION_FAILED = -6, XR_ERROR_FUNCTION_UNSUPPORTED = -7, XR_ERROR_FEATURE_UNSUPPORTED = -8, XR_ERROR_EXTENSION_NOT_PRESENT = -9, XR_ERROR_LIMIT_REACHED = -10, XR_ERROR_SIZE_INSUFFICIENT = -11, XR_ERROR_HANDLE_INVALID = -12, XR_ERROR_INSTANCE_LOST = -13, XR_ERROR_SESSION_RUNNING = -14, XR_ERROR_SESSION_NOT_RUNNING = -16, XR_ERROR_SESSION_LOST = -17, XR_ERROR_SYSTEM_INVALID = -18, XR_ERROR_PATH_INVALID = -19, XR_ERROR_PATH_COUNT_EXCEEDED = -20, XR_ERROR_PATH_FORMAT_INVALID = -21, XR_ERROR_PATH_UNSUPPORTED = -22, XR_ERROR_LAYER_INVALID = -23, XR_ERROR_LAYER_LIMIT_EXCEEDED = -24, XR_ERROR_SWAPCHAIN_RECT_INVALID = -25, XR_ERROR_SWAPCHAIN_FORMAT_UNSUPPORTED = -26, XR_ERROR_ACTION_TYPE_MISMATCH = -27, XR_ERROR_SESSION_NOT_READY = -28, XR_ERROR_SESSION_NOT_STOPPING = -29, XR_ERROR_TIME_INVALID = -30, XR_ERROR_REFERENCE_SPACE_UNSUPPORTED = -31, XR_ERROR_FILE_ACCESS_ERROR = -32, XR_ERROR_FILE_CONTENTS_INVALID = -33, XR_ERROR_FORM_FACTOR_UNSUPPORTED = -34, XR_ERROR_FORM_FACTOR_UNAVAILABLE = -35, XR_ERROR_API_LAYER_NOT_PRESENT = -36, XR_ERROR_CALL_ORDER_INVALID = -37, XR_ERROR_GRAPHICS_DEVICE_INVALID = -38, XR_ERROR_POSE_INVALID = -39, XR_ERROR_INDEX_OUT_OF_RANGE = -40, XR_ERROR_VIEW_CONFIGURATION_TYPE_UNSUPPORTED = -41, XR_ERROR_ENVIRONMENT_BLEND_MODE_UNSUPPORTED = -42, XR_ERROR_NAME_DUPLICATED = -44, XR_ERROR_NAME_INVALID = -45, XR_ERROR_ACTIONSET_NOT_ATTACHED = -46, XR_ERROR_ACTIONSETS_ALREADY_ATTACHED = -47, XR_ERROR_LOCALIZED_NAME_DUPLICATED = -48, XR_ERROR_LOCALIZED_NAME_INVALID = -49, XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING = -50, XR_ERROR_RUNTIME_UNAVAILABLE = -51, XR_ERROR_ANDROID_THREAD_SETTINGS_ID_INVALID_KHR = -1000003000, XR_ERROR_ANDROID_THREAD_SETTINGS_FAILURE_KHR = -1000003001, XR_ERROR_CREATE_SPATIAL_ANCHOR_FAILED_MSFT = -1000039001, XR_ERROR_SECONDARY_VIEW_CONFIGURATION_TYPE_NOT_ENABLED_MSFT = -1000053000, XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT = -1000055000, XR_ERROR_REPROJECTION_MODE_UNSUPPORTED_MSFT = -1000066000, XR_ERROR_COMPUTE_NEW_SCENE_NOT_COMPLETED_MSFT = -1000097000, XR_ERROR_SCENE_COMPONENT_ID_INVALID_MSFT = -1000097001, XR_ERROR_SCENE_COMPONENT_TYPE_MISMATCH_MSFT = -1000097002, XR_ERROR_SCENE_MESH_BUFFER_ID_INVALID_MSFT = -1000097003, XR_ERROR_SCENE_COMPUTE_FEATURE_INCOMPATIBLE_MSFT = -1000097004, XR_ERROR_SCENE_COMPUTE_CONSISTENCY_MISMATCH_MSFT = -1000097005, XR_ERROR_DISPLAY_REFRESH_RATE_UNSUPPORTED_FB = -1000101000, XR_ERROR_COLOR_SPACE_UNSUPPORTED_FB = -1000108000, XR_ERROR_UNEXPECTED_STATE_PASSTHROUGH_FB = -1000118000, XR_ERROR_FEATURE_ALREADY_CREATED_PASSTHROUGH_FB = -1000118001, XR_ERROR_FEATURE_REQUIRED_PASSTHROUGH_FB = -1000118002, XR_ERROR_NOT_PERMITTED_PASSTHROUGH_FB = -1000118003, XR_ERROR_INSUFFICIENT_RESOURCES_PASSTHROUGH_FB = -1000118004, XR_ERROR_UNKNOWN_PASSTHROUGH_FB = -1000118050, XR_ERROR_MARKER_NOT_TRACKED_VARJO = -1000124000, XR_ERROR_MARKER_ID_INVALID_VARJO = -1000124001, XR_ERROR_SPATIAL_ANCHOR_NAME_NOT_FOUND_MSFT = -1000142001, XR_ERROR_SPATIAL_ANCHOR_NAME_INVALID_MSFT = -1000142002, XR_RESULT_MAX_ENUM = 0x7FFFFFFF } XrResult; typedef enum XrStructureType { XR_TYPE_UNKNOWN = 0, XR_TYPE_API_LAYER_PROPERTIES = 1, XR_TYPE_EXTENSION_PROPERTIES = 2, XR_TYPE_INSTANCE_CREATE_INFO = 3, XR_TYPE_SYSTEM_GET_INFO = 4, XR_TYPE_SYSTEM_PROPERTIES = 5, XR_TYPE_VIEW_LOCATE_INFO = 6, XR_TYPE_VIEW = 7, XR_TYPE_SESSION_CREATE_INFO = 8, XR_TYPE_SWAPCHAIN_CREATE_INFO = 9, XR_TYPE_SESSION_BEGIN_INFO = 10, XR_TYPE_VIEW_STATE = 11, XR_TYPE_FRAME_END_INFO = 12, XR_TYPE_HAPTIC_VIBRATION = 13, XR_TYPE_EVENT_DATA_BUFFER = 16, XR_TYPE_EVENT_DATA_INSTANCE_LOSS_PENDING = 17, XR_TYPE_EVENT_DATA_SESSION_STATE_CHANGED = 18, XR_TYPE_ACTION_STATE_BOOLEAN = 23, XR_TYPE_ACTION_STATE_FLOAT = 24, XR_TYPE_ACTION_STATE_VECTOR2F = 25, XR_TYPE_ACTION_STATE_POSE = 27, XR_TYPE_ACTION_SET_CREATE_INFO = 28, XR_TYPE_ACTION_CREATE_INFO = 29, XR_TYPE_INSTANCE_PROPERTIES = 32, XR_TYPE_FRAME_WAIT_INFO = 33, XR_TYPE_COMPOSITION_LAYER_PROJECTION = 35, XR_TYPE_COMPOSITION_LAYER_QUAD = 36, XR_TYPE_REFERENCE_SPACE_CREATE_INFO = 37, XR_TYPE_ACTION_SPACE_CREATE_INFO = 38, XR_TYPE_EVENT_DATA_REFERENCE_SPACE_CHANGE_PENDING = 40, XR_TYPE_VIEW_CONFIGURATION_VIEW = 41, XR_TYPE_SPACE_LOCATION = 42, XR_TYPE_SPACE_VELOCITY = 43, XR_TYPE_FRAME_STATE = 44, XR_TYPE_VIEW_CONFIGURATION_PROPERTIES = 45, XR_TYPE_FRAME_BEGIN_INFO = 46, XR_TYPE_COMPOSITION_LAYER_PROJECTION_VIEW = 48, XR_TYPE_EVENT_DATA_EVENTS_LOST = 49, XR_TYPE_INTERACTION_PROFILE_SUGGESTED_BINDING = 51, XR_TYPE_EVENT_DATA_INTERACTION_PROFILE_CHANGED = 52, XR_TYPE_INTERACTION_PROFILE_STATE = 53, XR_TYPE_SWAPCHAIN_IMAGE_ACQUIRE_INFO = 55, XR_TYPE_SWAPCHAIN_IMAGE_WAIT_INFO = 56, XR_TYPE_SWAPCHAIN_IMAGE_RELEASE_INFO = 57, XR_TYPE_ACTION_STATE_GET_INFO = 58, XR_TYPE_HAPTIC_ACTION_INFO = 59, XR_TYPE_SESSION_ACTION_SETS_ATTACH_INFO = 60, XR_TYPE_ACTIONS_SYNC_INFO = 61, XR_TYPE_BOUND_SOURCES_FOR_ACTION_ENUMERATE_INFO = 62, XR_TYPE_INPUT_SOURCE_LOCALIZED_NAME_GET_INFO = 63, XR_TYPE_COMPOSITION_LAYER_CUBE_KHR = 1000006000, XR_TYPE_INSTANCE_CREATE_INFO_ANDROID_KHR = 1000008000, XR_TYPE_COMPOSITION_LAYER_DEPTH_INFO_KHR = 1000010000, XR_TYPE_VULKAN_SWAPCHAIN_FORMAT_LIST_CREATE_INFO_KHR = 1000014000, XR_TYPE_EVENT_DATA_PERF_SETTINGS_EXT = 1000015000, XR_TYPE_COMPOSITION_LAYER_CYLINDER_KHR = 1000017000, XR_TYPE_COMPOSITION_LAYER_EQUIRECT_KHR = 1000018000, XR_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT = 1000019000, XR_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT = 1000019001, XR_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT = 1000019002, XR_TYPE_DEBUG_UTILS_LABEL_EXT = 1000019003, XR_TYPE_GRAPHICS_BINDING_OPENGL_WIN32_KHR = 1000023000, XR_TYPE_GRAPHICS_BINDING_OPENGL_XLIB_KHR = 1000023001, XR_TYPE_GRAPHICS_BINDING_OPENGL_XCB_KHR = 1000023002, XR_TYPE_GRAPHICS_BINDING_OPENGL_WAYLAND_KHR = 1000023003, XR_TYPE_SWAPCHAIN_IMAGE_OPENGL_KHR = 1000023004, XR_TYPE_GRAPHICS_REQUIREMENTS_OPENGL_KHR = 1000023005, XR_TYPE_GRAPHICS_BINDING_OPENGL_ES_ANDROID_KHR = 1000024001, XR_TYPE_SWAPCHAIN_IMAGE_OPENGL_ES_KHR = 1000024002, XR_TYPE_GRAPHICS_REQUIREMENTS_OPENGL_ES_KHR = 1000024003, XR_TYPE_GRAPHICS_BINDING_VULKAN_KHR = 1000025000, XR_TYPE_SWAPCHAIN_IMAGE_VULKAN_KHR = 1000025001, XR_TYPE_GRAPHICS_REQUIREMENTS_VULKAN_KHR = 1000025002, XR_TYPE_GRAPHICS_BINDING_D3D11_KHR = 1000027000, XR_TYPE_SWAPCHAIN_IMAGE_D3D11_KHR = 1000027001, XR_TYPE_GRAPHICS_REQUIREMENTS_D3D11_KHR = 1000027002, XR_TYPE_GRAPHICS_BINDING_D3D12_KHR = 1000028000, XR_TYPE_SWAPCHAIN_IMAGE_D3D12_KHR = 1000028001, XR_TYPE_GRAPHICS_REQUIREMENTS_D3D12_KHR = 1000028002, XR_TYPE_SYSTEM_EYE_GAZE_INTERACTION_PROPERTIES_EXT = 1000030000, XR_TYPE_EYE_GAZE_SAMPLE_TIME_EXT = 1000030001, XR_TYPE_VISIBILITY_MASK_KHR = 1000031000, XR_TYPE_EVENT_DATA_VISIBILITY_MASK_CHANGED_KHR = 1000031001, XR_TYPE_SESSION_CREATE_INFO_OVERLAY_EXTX = 1000033000, XR_TYPE_EVENT_DATA_MAIN_SESSION_VISIBILITY_CHANGED_EXTX = 1000033003, XR_TYPE_COMPOSITION_LAYER_COLOR_SCALE_BIAS_KHR = 1000034000, XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_MSFT = 1000039000, XR_TYPE_SPATIAL_ANCHOR_SPACE_CREATE_INFO_MSFT = 1000039001, XR_TYPE_COMPOSITION_LAYER_IMAGE_LAYOUT_FB = 1000040000, XR_TYPE_COMPOSITION_LAYER_ALPHA_BLEND_FB = 1000041001, XR_TYPE_VIEW_CONFIGURATION_DEPTH_RANGE_EXT = 1000046000, XR_TYPE_GRAPHICS_BINDING_EGL_MNDX = 1000048004, XR_TYPE_SPATIAL_GRAPH_NODE_SPACE_CREATE_INFO_MSFT = 1000049000, XR_TYPE_SYSTEM_HAND_TRACKING_PROPERTIES_EXT = 1000051000, XR_TYPE_HAND_TRACKER_CREATE_INFO_EXT = 1000051001, XR_TYPE_HAND_JOINTS_LOCATE_INFO_EXT = 1000051002, XR_TYPE_HAND_JOINT_LOCATIONS_EXT = 1000051003, XR_TYPE_HAND_JOINT_VELOCITIES_EXT = 1000051004, XR_TYPE_SYSTEM_HAND_TRACKING_MESH_PROPERTIES_MSFT = 1000052000, XR_TYPE_HAND_MESH_SPACE_CREATE_INFO_MSFT = 1000052001, XR_TYPE_HAND_MESH_UPDATE_INFO_MSFT = 1000052002, XR_TYPE_HAND_MESH_MSFT = 1000052003, XR_TYPE_HAND_POSE_TYPE_INFO_MSFT = 1000052004, XR_TYPE_SECONDARY_VIEW_CONFIGURATION_SESSION_BEGIN_INFO_MSFT = 1000053000, XR_TYPE_SECONDARY_VIEW_CONFIGURATION_STATE_MSFT = 1000053001, XR_TYPE_SECONDARY_VIEW_CONFIGURATION_FRAME_STATE_MSFT = 1000053002, XR_TYPE_SECONDARY_VIEW_CONFIGURATION_FRAME_END_INFO_MSFT = 1000053003, XR_TYPE_SECONDARY_VIEW_CONFIGURATION_LAYER_INFO_MSFT = 1000053004, XR_TYPE_SECONDARY_VIEW_CONFIGURATION_SWAPCHAIN_CREATE_INFO_MSFT = 1000053005, XR_TYPE_CONTROLLER_MODEL_KEY_STATE_MSFT = 1000055000, XR_TYPE_CONTROLLER_MODEL_NODE_PROPERTIES_MSFT = 1000055001, XR_TYPE_CONTROLLER_MODEL_PROPERTIES_MSFT = 1000055002, XR_TYPE_CONTROLLER_MODEL_NODE_STATE_MSFT = 1000055003, XR_TYPE_CONTROLLER_MODEL_STATE_MSFT = 1000055004, XR_TYPE_VIEW_CONFIGURATION_VIEW_FOV_EPIC = 1000059000, XR_TYPE_HOLOGRAPHIC_WINDOW_ATTACHMENT_MSFT = 1000063000, XR_TYPE_COMPOSITION_LAYER_REPROJECTION_INFO_MSFT = 1000066000, XR_TYPE_COMPOSITION_LAYER_REPROJECTION_PLANE_OVERRIDE_MSFT = 1000066001, XR_TYPE_ANDROID_SURFACE_SWAPCHAIN_CREATE_INFO_FB = 1000070000, XR_TYPE_COMPOSITION_LAYER_SECURE_CONTENT_FB = 1000072000, XR_TYPE_INTERACTION_PROFILE_ANALOG_THRESHOLD_VALVE = 1000079000, XR_TYPE_HAND_JOINTS_MOTION_RANGE_INFO_EXT = 1000080000, XR_TYPE_LOADER_INIT_INFO_ANDROID_KHR = 1000089000, XR_TYPE_VULKAN_INSTANCE_CREATE_INFO_KHR = 1000090000, XR_TYPE_VULKAN_DEVICE_CREATE_INFO_KHR = 1000090001, XR_TYPE_VULKAN_GRAPHICS_DEVICE_GET_INFO_KHR = 1000090003, XR_TYPE_COMPOSITION_LAYER_EQUIRECT2_KHR = 1000091000, XR_TYPE_SCENE_OBSERVER_CREATE_INFO_MSFT = 1000097000, XR_TYPE_SCENE_CREATE_INFO_MSFT = 1000097001, XR_TYPE_NEW_SCENE_COMPUTE_INFO_MSFT = 1000097002, XR_TYPE_VISUAL_MESH_COMPUTE_LOD_INFO_MSFT = 1000097003, XR_TYPE_SCENE_COMPONENTS_MSFT = 1000097004, XR_TYPE_SCENE_COMPONENTS_GET_INFO_MSFT = 1000097005, XR_TYPE_SCENE_COMPONENT_LOCATIONS_MSFT = 1000097006, XR_TYPE_SCENE_COMPONENTS_LOCATE_INFO_MSFT = 1000097007, XR_TYPE_SCENE_OBJECTS_MSFT = 1000097008, XR_TYPE_SCENE_COMPONENT_PARENT_FILTER_INFO_MSFT = 1000097009, XR_TYPE_SCENE_OBJECT_TYPES_FILTER_INFO_MSFT = 1000097010, XR_TYPE_SCENE_PLANES_MSFT = 1000097011, XR_TYPE_SCENE_PLANE_ALIGNMENT_FILTER_INFO_MSFT = 1000097012, XR_TYPE_SCENE_MESHES_MSFT = 1000097013, XR_TYPE_SCENE_MESH_BUFFERS_GET_INFO_MSFT = 1000097014, XR_TYPE_SCENE_MESH_BUFFERS_MSFT = 1000097015, XR_TYPE_SCENE_MESH_VERTEX_BUFFER_MSFT = 1000097016, XR_TYPE_SCENE_MESH_INDICES_UINT32_MSFT = 1000097017, XR_TYPE_SCENE_MESH_INDICES_UINT16_MSFT = 1000097018, XR_TYPE_SERIALIZED_SCENE_FRAGMENT_DATA_GET_INFO_MSFT = 1000098000, XR_TYPE_SCENE_DESERIALIZE_INFO_MSFT = 1000098001, XR_TYPE_EVENT_DATA_DISPLAY_REFRESH_RATE_CHANGED_FB = 1000101000, XR_TYPE_VIVE_TRACKER_PATHS_HTCX = 1000103000, XR_TYPE_EVENT_DATA_VIVE_TRACKER_CONNECTED_HTCX = 1000103001, XR_TYPE_SYSTEM_COLOR_SPACE_PROPERTIES_FB = 1000108000, XR_TYPE_HAND_TRACKING_MESH_FB = 1000110001, XR_TYPE_HAND_TRACKING_SCALE_FB = 1000110003, XR_TYPE_HAND_TRACKING_AIM_STATE_FB = 1000111001, XR_TYPE_HAND_TRACKING_CAPSULES_STATE_FB = 1000112000, XR_TYPE_FOVEATION_PROFILE_CREATE_INFO_FB = 1000114000, XR_TYPE_SWAPCHAIN_CREATE_INFO_FOVEATION_FB = 1000114001, XR_TYPE_SWAPCHAIN_STATE_FOVEATION_FB = 1000114002, XR_TYPE_FOVEATION_LEVEL_PROFILE_CREATE_INFO_FB = 1000115000, XR_TYPE_TRIANGLE_MESH_CREATE_INFO_FB = 1000117001, XR_TYPE_SYSTEM_PASSTHROUGH_PROPERTIES_FB = 1000118000, XR_TYPE_PASSTHROUGH_CREATE_INFO_FB = 1000118001, XR_TYPE_PASSTHROUGH_LAYER_CREATE_INFO_FB = 1000118002, XR_TYPE_COMPOSITION_LAYER_PASSTHROUGH_FB = 1000118003, XR_TYPE_GEOMETRY_INSTANCE_CREATE_INFO_FB = 1000118004, XR_TYPE_GEOMETRY_INSTANCE_TRANSFORM_FB = 1000118005, XR_TYPE_PASSTHROUGH_STYLE_FB = 1000118020, XR_TYPE_PASSTHROUGH_COLOR_MAP_MONO_TO_RGBA_FB = 1000118021, XR_TYPE_PASSTHROUGH_COLOR_MAP_MONO_TO_MONO_FB = 1000118022, XR_TYPE_EVENT_DATA_PASSTHROUGH_STATE_CHANGED_FB = 1000118030, XR_TYPE_BINDING_MODIFICATIONS_KHR = 1000120000, XR_TYPE_VIEW_LOCATE_FOVEATED_RENDERING_VARJO = 1000121000, XR_TYPE_FOVEATED_VIEW_CONFIGURATION_VIEW_VARJO = 1000121001, XR_TYPE_SYSTEM_FOVEATED_RENDERING_PROPERTIES_VARJO = 1000121002, XR_TYPE_COMPOSITION_LAYER_DEPTH_TEST_VARJO = 1000122000, XR_TYPE_SYSTEM_MARKER_TRACKING_PROPERTIES_VARJO = 1000124000, XR_TYPE_EVENT_DATA_MARKER_TRACKING_UPDATE_VARJO = 1000124001, XR_TYPE_MARKER_SPACE_CREATE_INFO_VARJO = 1000124002, XR_TYPE_SPATIAL_ANCHOR_PERSISTENCE_INFO_MSFT = 1000142000, XR_TYPE_SPATIAL_ANCHOR_FROM_PERSISTED_ANCHOR_CREATE_INFO_MSFT = 1000142001, XR_TYPE_SWAPCHAIN_IMAGE_FOVEATION_VULKAN_FB = 1000160000, XR_TYPE_SWAPCHAIN_STATE_ANDROID_SURFACE_DIMENSIONS_FB = 1000161000, XR_TYPE_SWAPCHAIN_STATE_SAMPLER_OPENGL_ES_FB = 1000162000, XR_TYPE_SWAPCHAIN_STATE_SAMPLER_VULKAN_FB = 1000163000, XR_TYPE_COMPOSITION_LAYER_SPACE_WARP_INFO_FB = 1000171000, XR_TYPE_SYSTEM_SPACE_WARP_PROPERTIES_FB = 1000171001, XR_TYPE_GRAPHICS_BINDING_VULKAN2_KHR = XR_TYPE_GRAPHICS_BINDING_VULKAN_KHR, XR_TYPE_SWAPCHAIN_IMAGE_VULKAN2_KHR = XR_TYPE_SWAPCHAIN_IMAGE_VULKAN_KHR, XR_TYPE_GRAPHICS_REQUIREMENTS_VULKAN2_KHR = XR_TYPE_GRAPHICS_REQUIREMENTS_VULKAN_KHR, XR_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF } XrStructureType; typedef enum XrFormFactor { XR_FORM_FACTOR_HEAD_MOUNTED_DISPLAY = 1, XR_FORM_FACTOR_HANDHELD_DISPLAY = 2, XR_FORM_FACTOR_MAX_ENUM = 0x7FFFFFFF } XrFormFactor; typedef enum XrViewConfigurationType { XR_VIEW_CONFIGURATION_TYPE_PRIMARY_MONO = 1, XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO = 2, XR_VIEW_CONFIGURATION_TYPE_PRIMARY_QUAD_VARJO = 1000037000, XR_VIEW_CONFIGURATION_TYPE_SECONDARY_MONO_FIRST_PERSON_OBSERVER_MSFT = 1000054000, XR_VIEW_CONFIGURATION_TYPE_MAX_ENUM = 0x7FFFFFFF } XrViewConfigurationType; typedef enum XrEnvironmentBlendMode { XR_ENVIRONMENT_BLEND_MODE_OPAQUE = 1, XR_ENVIRONMENT_BLEND_MODE_ADDITIVE = 2, XR_ENVIRONMENT_BLEND_MODE_ALPHA_BLEND = 3, XR_ENVIRONMENT_BLEND_MODE_MAX_ENUM = 0x7FFFFFFF } XrEnvironmentBlendMode; typedef enum XrReferenceSpaceType { XR_REFERENCE_SPACE_TYPE_VIEW = 1, XR_REFERENCE_SPACE_TYPE_LOCAL = 2, XR_REFERENCE_SPACE_TYPE_STAGE = 3, XR_REFERENCE_SPACE_TYPE_UNBOUNDED_MSFT = 1000038000, XR_REFERENCE_SPACE_TYPE_COMBINED_EYE_VARJO = 1000121000, XR_REFERENCE_SPACE_TYPE_MAX_ENUM = 0x7FFFFFFF } XrReferenceSpaceType; typedef enum XrActionType { XR_ACTION_TYPE_BOOLEAN_INPUT = 1, XR_ACTION_TYPE_FLOAT_INPUT = 2, XR_ACTION_TYPE_VECTOR2F_INPUT = 3, XR_ACTION_TYPE_POSE_INPUT = 4, XR_ACTION_TYPE_VIBRATION_OUTPUT = 100, XR_ACTION_TYPE_MAX_ENUM = 0x7FFFFFFF } XrActionType; typedef enum XrEyeVisibility { XR_EYE_VISIBILITY_BOTH = 0, XR_EYE_VISIBILITY_LEFT = 1, XR_EYE_VISIBILITY_RIGHT = 2, XR_EYE_VISIBILITY_MAX_ENUM = 0x7FFFFFFF } XrEyeVisibility; typedef enum XrSessionState { XR_SESSION_STATE_UNKNOWN = 0, XR_SESSION_STATE_IDLE = 1, XR_SESSION_STATE_READY = 2, XR_SESSION_STATE_SYNCHRONIZED = 3, XR_SESSION_STATE_VISIBLE = 4, XR_SESSION_STATE_FOCUSED = 5, XR_SESSION_STATE_STOPPING = 6, XR_SESSION_STATE_LOSS_PENDING = 7, XR_SESSION_STATE_EXITING = 8, XR_SESSION_STATE_MAX_ENUM = 0x7FFFFFFF } XrSessionState; typedef enum XrObjectType { XR_OBJECT_TYPE_UNKNOWN = 0, XR_OBJECT_TYPE_INSTANCE = 1, XR_OBJECT_TYPE_SESSION = 2, XR_OBJECT_TYPE_SWAPCHAIN = 3, XR_OBJECT_TYPE_SPACE = 4, XR_OBJECT_TYPE_ACTION_SET = 5, XR_OBJECT_TYPE_ACTION = 6, XR_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT = 1000019000, XR_OBJECT_TYPE_SPATIAL_ANCHOR_MSFT = 1000039000, XR_OBJECT_TYPE_HAND_TRACKER_EXT = 1000051000, XR_OBJECT_TYPE_SCENE_OBSERVER_MSFT = 1000097000, XR_OBJECT_TYPE_SCENE_MSFT = 1000097001, XR_OBJECT_TYPE_FOVEATION_PROFILE_FB = 1000114000, XR_OBJECT_TYPE_TRIANGLE_MESH_FB = 1000117000, XR_OBJECT_TYPE_PASSTHROUGH_FB = 1000118000, XR_OBJECT_TYPE_PASSTHROUGH_LAYER_FB = 1000118002, XR_OBJECT_TYPE_GEOMETRY_INSTANCE_FB = 1000118004, XR_OBJECT_TYPE_SPATIAL_ANCHOR_STORE_CONNECTION_MSFT = 1000142000, XR_OBJECT_TYPE_MAX_ENUM = 0x7FFFFFFF } XrObjectType; typedef XrFlags64 XrInstanceCreateFlags; // Flag bits for XrInstanceCreateFlags typedef XrFlags64 XrSessionCreateFlags; // Flag bits for XrSessionCreateFlags typedef XrFlags64 XrSpaceVelocityFlags; // Flag bits for XrSpaceVelocityFlags static const XrSpaceVelocityFlags XR_SPACE_VELOCITY_LINEAR_VALID_BIT = 0x00000001; static const XrSpaceVelocityFlags XR_SPACE_VELOCITY_ANGULAR_VALID_BIT = 0x00000002; typedef XrFlags64 XrSpaceLocationFlags; // Flag bits for XrSpaceLocationFlags static const XrSpaceLocationFlags XR_SPACE_LOCATION_ORIENTATION_VALID_BIT = 0x00000001; static const XrSpaceLocationFlags XR_SPACE_LOCATION_POSITION_VALID_BIT = 0x00000002; static const XrSpaceLocationFlags XR_SPACE_LOCATION_ORIENTATION_TRACKED_BIT = 0x00000004; static const XrSpaceLocationFlags XR_SPACE_LOCATION_POSITION_TRACKED_BIT = 0x00000008; typedef XrFlags64 XrSwapchainCreateFlags; // Flag bits for XrSwapchainCreateFlags static const XrSwapchainCreateFlags XR_SWAPCHAIN_CREATE_PROTECTED_CONTENT_BIT = 0x00000001; static const XrSwapchainCreateFlags XR_SWAPCHAIN_CREATE_STATIC_IMAGE_BIT = 0x00000002; typedef XrFlags64 XrSwapchainUsageFlags; // Flag bits for XrSwapchainUsageFlags static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_COLOR_ATTACHMENT_BIT = 0x00000001; static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000002; static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_UNORDERED_ACCESS_BIT = 0x00000004; static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_TRANSFER_SRC_BIT = 0x00000008; static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_TRANSFER_DST_BIT = 0x00000010; static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_SAMPLED_BIT = 0x00000020; static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_MUTABLE_FORMAT_BIT = 0x00000040; static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_MND = 0x00000080; static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_KHR = 0x00000080; // alias of XR_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_MND typedef XrFlags64 XrCompositionLayerFlags; // Flag bits for XrCompositionLayerFlags static const XrCompositionLayerFlags XR_COMPOSITION_LAYER_CORRECT_CHROMATIC_ABERRATION_BIT = 0x00000001; static const XrCompositionLayerFlags XR_COMPOSITION_LAYER_BLEND_TEXTURE_SOURCE_ALPHA_BIT = 0x00000002; static const XrCompositionLayerFlags XR_COMPOSITION_LAYER_UNPREMULTIPLIED_ALPHA_BIT = 0x00000004; typedef XrFlags64 XrViewStateFlags; // Flag bits for XrViewStateFlags static const XrViewStateFlags XR_VIEW_STATE_ORIENTATION_VALID_BIT = 0x00000001; static const XrViewStateFlags XR_VIEW_STATE_POSITION_VALID_BIT = 0x00000002; static const XrViewStateFlags XR_VIEW_STATE_ORIENTATION_TRACKED_BIT = 0x00000004; static const XrViewStateFlags XR_VIEW_STATE_POSITION_TRACKED_BIT = 0x00000008; typedef XrFlags64 XrInputSourceLocalizedNameFlags; // Flag bits for XrInputSourceLocalizedNameFlags static const XrInputSourceLocalizedNameFlags XR_INPUT_SOURCE_LOCALIZED_NAME_USER_PATH_BIT = 0x00000001; static const XrInputSourceLocalizedNameFlags XR_INPUT_SOURCE_LOCALIZED_NAME_INTERACTION_PROFILE_BIT = 0x00000002; static const XrInputSourceLocalizedNameFlags XR_INPUT_SOURCE_LOCALIZED_NAME_COMPONENT_BIT = 0x00000004; typedef void (XRAPI_PTR *PFN_xrVoidFunction)(void); typedef struct XrApiLayerProperties { XrStructureType type; void* XR_MAY_ALIAS next; char layerName[XR_MAX_API_LAYER_NAME_SIZE]; XrVersion specVersion; uint32_t layerVersion; char description[XR_MAX_API_LAYER_DESCRIPTION_SIZE]; } XrApiLayerProperties; typedef struct XrExtensionProperties { XrStructureType type; void* XR_MAY_ALIAS next; char extensionName[XR_MAX_EXTENSION_NAME_SIZE]; uint32_t extensionVersion; } XrExtensionProperties; typedef struct XrApplicationInfo { char applicationName[XR_MAX_APPLICATION_NAME_SIZE]; uint32_t applicationVersion; char engineName[XR_MAX_ENGINE_NAME_SIZE]; uint32_t engineVersion; XrVersion apiVersion; } XrApplicationInfo; typedef struct XrInstanceCreateInfo { XrStructureType type; const void* XR_MAY_ALIAS next; XrInstanceCreateFlags createFlags; XrApplicationInfo applicationInfo; uint32_t enabledApiLayerCount; const char* const* enabledApiLayerNames; uint32_t enabledExtensionCount; const char* const* enabledExtensionNames; } XrInstanceCreateInfo; typedef struct XrInstanceProperties { XrStructureType type; void* XR_MAY_ALIAS next; XrVersion runtimeVersion; char runtimeName[XR_MAX_RUNTIME_NAME_SIZE]; } XrInstanceProperties; typedef struct XrEventDataBuffer { XrStructureType type; const void* XR_MAY_ALIAS next; uint8_t varying[4000]; } XrEventDataBuffer; typedef struct XrSystemGetInfo { XrStructureType type; const void* XR_MAY_ALIAS next; XrFormFactor formFactor; } XrSystemGetInfo; typedef struct XrSystemGraphicsProperties { uint32_t maxSwapchainImageHeight; uint32_t maxSwapchainImageWidth; uint32_t maxLayerCount; } XrSystemGraphicsProperties; typedef struct XrSystemTrackingProperties { XrBool32 orientationTracking; XrBool32 positionTracking; } XrSystemTrackingProperties; typedef struct XrSystemProperties { XrStructureType type; void* XR_MAY_ALIAS next; XrSystemId systemId; uint32_t vendorId; char systemName[XR_MAX_SYSTEM_NAME_SIZE]; XrSystemGraphicsProperties graphicsProperties; XrSystemTrackingProperties trackingProperties; } XrSystemProperties; typedef struct XrSessionCreateInfo { XrStructureType type; const void* XR_MAY_ALIAS next; XrSessionCreateFlags createFlags; XrSystemId systemId; } XrSessionCreateInfo; typedef struct XrVector3f { float x; float y; float z; } XrVector3f; // XrSpaceVelocity extends XrSpaceLocation typedef struct XrSpaceVelocity { XrStructureType type; void* XR_MAY_ALIAS next; XrSpaceVelocityFlags velocityFlags; XrVector3f linearVelocity; XrVector3f angularVelocity; } XrSpaceVelocity; typedef struct XrQuaternionf { float x; float y; float z; float w; } XrQuaternionf; typedef struct XrPosef { XrQuaternionf orientation; XrVector3f position; } XrPosef; typedef struct XrReferenceSpaceCreateInfo { XrStructureType type; const void* XR_MAY_ALIAS next; XrReferenceSpaceType referenceSpaceType; XrPosef poseInReferenceSpace; } XrReferenceSpaceCreateInfo; typedef struct XrExtent2Df { float width; float height; } XrExtent2Df; typedef struct XrActionSpaceCreateInfo { XrStructureType type; const void* XR_MAY_ALIAS next; XrAction action; XrPath subactionPath; XrPosef poseInActionSpace; } XrActionSpaceCreateInfo; typedef struct XrSpaceLocation { XrStructureType type; void* XR_MAY_ALIAS next; XrSpaceLocationFlags locationFlags; XrPosef pose; } XrSpaceLocation; typedef struct XrViewConfigurationProperties { XrStructureType type; void* XR_MAY_ALIAS next; XrViewConfigurationType viewConfigurationType; XrBool32 fovMutable; } XrViewConfigurationProperties; typedef struct XrViewConfigurationView { XrStructureType type; void* XR_MAY_ALIAS next; uint32_t recommendedImageRectWidth; uint32_t maxImageRectWidth; uint32_t recommendedImageRectHeight; uint32_t maxImageRectHeight; uint32_t recommendedSwapchainSampleCount; uint32_t maxSwapchainSampleCount; } XrViewConfigurationView; typedef struct XrSwapchainCreateInfo { XrStructureType type; const void* XR_MAY_ALIAS next; XrSwapchainCreateFlags createFlags; XrSwapchainUsageFlags usageFlags; int64_t format; uint32_t sampleCount; uint32_t width; uint32_t height; uint32_t faceCount; uint32_t arraySize; uint32_t mipCount; } XrSwapchainCreateInfo; typedef struct XR_MAY_ALIAS XrSwapchainImageBaseHeader { XrStructureType type; void* XR_MAY_ALIAS next; } XrSwapchainImageBaseHeader; typedef struct XrSwapchainImageAcquireInfo { XrStructureType type; const void* XR_MAY_ALIAS next; } XrSwapchainImageAcquireInfo; typedef struct XrSwapchainImageWaitInfo { XrStructureType type; const void* XR_MAY_ALIAS next; XrDuration timeout; } XrSwapchainImageWaitInfo; typedef struct XrSwapchainImageReleaseInfo { XrStructureType type; const void* XR_MAY_ALIAS next; } XrSwapchainImageReleaseInfo; typedef struct XrSessionBeginInfo { XrStructureType type; const void* XR_MAY_ALIAS next; XrViewConfigurationType primaryViewConfigurationType; } XrSessionBeginInfo; typedef struct XrFrameWaitInfo { XrStructureType type; const void* XR_MAY_ALIAS next; } XrFrameWaitInfo; typedef struct XrFrameState { XrStructureType type; void* XR_MAY_ALIAS next; XrTime predictedDisplayTime; XrDuration predictedDisplayPeriod; XrBool32 shouldRender; } XrFrameState; typedef struct XrFrameBeginInfo { XrStructureType type; const void* XR_MAY_ALIAS next; } XrFrameBeginInfo; typedef struct XR_MAY_ALIAS XrCompositionLayerBaseHeader { XrStructureType type; const void* XR_MAY_ALIAS next; XrCompositionLayerFlags layerFlags; XrSpace space; } XrCompositionLayerBaseHeader; typedef struct XrFrameEndInfo { XrStructureType type; const void* XR_MAY_ALIAS next; XrTime displayTime; XrEnvironmentBlendMode environmentBlendMode; uint32_t layerCount; const XrCompositionLayerBaseHeader* const* layers; } XrFrameEndInfo; typedef struct XrViewLocateInfo { XrStructureType type; const void* XR_MAY_ALIAS next; XrViewConfigurationType viewConfigurationType; XrTime displayTime; XrSpace space; } XrViewLocateInfo; typedef struct XrViewState { XrStructureType type; void* XR_MAY_ALIAS next; XrViewStateFlags viewStateFlags; } XrViewState; typedef struct XrFovf { float angleLeft; float angleRight; float angleUp; float angleDown; } XrFovf; typedef struct XrView { XrStructureType type; void* XR_MAY_ALIAS next; XrPosef pose; XrFovf fov; } XrView; typedef struct XrActionSetCreateInfo { XrStructureType type; const void* XR_MAY_ALIAS next; char actionSetName[XR_MAX_ACTION_SET_NAME_SIZE]; char localizedActionSetName[XR_MAX_LOCALIZED_ACTION_SET_NAME_SIZE]; uint32_t priority; } XrActionSetCreateInfo; typedef struct XrActionCreateInfo { XrStructureType type; const void* XR_MAY_ALIAS next; char actionName[XR_MAX_ACTION_NAME_SIZE]; XrActionType actionType; uint32_t countSubactionPaths; const XrPath* subactionPaths; char localizedActionName[XR_MAX_LOCALIZED_ACTION_NAME_SIZE]; } XrActionCreateInfo; typedef struct XrActionSuggestedBinding { XrAction action; XrPath binding; } XrActionSuggestedBinding; typedef struct XrInteractionProfileSuggestedBinding { XrStructureType type; const void* XR_MAY_ALIAS next; XrPath interactionProfile; uint32_t countSuggestedBindings; const XrActionSuggestedBinding* suggestedBindings; } XrInteractionProfileSuggestedBinding; typedef struct XrSessionActionSetsAttachInfo { XrStructureType type; const void* XR_MAY_ALIAS next; uint32_t countActionSets; const XrActionSet* actionSets; } XrSessionActionSetsAttachInfo; typedef struct XrInteractionProfileState { XrStructureType type; void* XR_MAY_ALIAS next; XrPath interactionProfile; } XrInteractionProfileState; typedef struct XrActionStateGetInfo { XrStructureType type; const void* XR_MAY_ALIAS next; XrAction action; XrPath subactionPath; } XrActionStateGetInfo; typedef struct XrActionStateBoolean { XrStructureType type; void* XR_MAY_ALIAS next; XrBool32 currentState; XrBool32 changedSinceLastSync; XrTime lastChangeTime; XrBool32 isActive; } XrActionStateBoolean; typedef struct XrActionStateFloat { XrStructureType type; void* XR_MAY_ALIAS next; float currentState; XrBool32 changedSinceLastSync; XrTime lastChangeTime; XrBool32 isActive; } XrActionStateFloat; typedef struct XrVector2f { float x; float y; } XrVector2f; typedef struct XrActionStateVector2f { XrStructureType type; void* XR_MAY_ALIAS next; XrVector2f currentState; XrBool32 changedSinceLastSync; XrTime lastChangeTime; XrBool32 isActive; } XrActionStateVector2f; typedef struct XrActionStatePose { XrStructureType type; void* XR_MAY_ALIAS next; XrBool32 isActive; } XrActionStatePose; typedef struct XrActiveActionSet { XrActionSet actionSet; XrPath subactionPath; } XrActiveActionSet; typedef struct XrActionsSyncInfo { XrStructureType type; const void* XR_MAY_ALIAS next; uint32_t countActiveActionSets; const XrActiveActionSet* activeActionSets; } XrActionsSyncInfo; typedef struct XrBoundSourcesForActionEnumerateInfo { XrStructureType type; const void* XR_MAY_ALIAS next; XrAction action; } XrBoundSourcesForActionEnumerateInfo; typedef struct XrInputSourceLocalizedNameGetInfo { XrStructureType type; const void* XR_MAY_ALIAS next; XrPath sourcePath; XrInputSourceLocalizedNameFlags whichComponents; } XrInputSourceLocalizedNameGetInfo; typedef struct XrHapticActionInfo { XrStructureType type; const void* XR_MAY_ALIAS next; XrAction action; XrPath subactionPath; } XrHapticActionInfo; typedef struct XR_MAY_ALIAS XrHapticBaseHeader { XrStructureType type; const void* XR_MAY_ALIAS next; } XrHapticBaseHeader; typedef struct XR_MAY_ALIAS XrBaseInStructure { XrStructureType type; const struct XrBaseInStructure* next; } XrBaseInStructure; typedef struct XR_MAY_ALIAS XrBaseOutStructure { XrStructureType type; struct XrBaseOutStructure* next; } XrBaseOutStructure; typedef struct XrOffset2Di { int32_t x; int32_t y; } XrOffset2Di; typedef struct XrExtent2Di { int32_t width; int32_t height; } XrExtent2Di; typedef struct XrRect2Di { XrOffset2Di offset; XrExtent2Di extent; } XrRect2Di; typedef struct XrSwapchainSubImage { XrSwapchain swapchain; XrRect2Di imageRect; uint32_t imageArrayIndex; } XrSwapchainSubImage; typedef struct XrCompositionLayerProjectionView { XrStructureType type; const void* XR_MAY_ALIAS next; XrPosef pose; XrFovf fov; XrSwapchainSubImage subImage; } XrCompositionLayerProjectionView; typedef struct XrCompositionLayerProjection { XrStructureType type; const void* XR_MAY_ALIAS next; XrCompositionLayerFlags layerFlags; XrSpace space; uint32_t viewCount; const XrCompositionLayerProjectionView* views; } XrCompositionLayerProjection; typedef struct XrCompositionLayerQuad { XrStructureType type; const void* XR_MAY_ALIAS next; XrCompositionLayerFlags layerFlags; XrSpace space; XrEyeVisibility eyeVisibility; XrSwapchainSubImage subImage; XrPosef pose; XrExtent2Df size; } XrCompositionLayerQuad; typedef struct XR_MAY_ALIAS XrEventDataBaseHeader { XrStructureType type; const void* XR_MAY_ALIAS next; } XrEventDataBaseHeader; typedef struct XrEventDataEventsLost { XrStructureType type; const void* XR_MAY_ALIAS next; uint32_t lostEventCount; } XrEventDataEventsLost; typedef struct XrEventDataInstanceLossPending { XrStructureType type; const void* XR_MAY_ALIAS next; XrTime lossTime; } XrEventDataInstanceLossPending; typedef struct XrEventDataSessionStateChanged { XrStructureType type; const void* XR_MAY_ALIAS next; XrSession session; XrSessionState state; XrTime time; } XrEventDataSessionStateChanged; typedef struct XrEventDataReferenceSpaceChangePending { XrStructureType type; const void* XR_MAY_ALIAS next; XrSession session; XrReferenceSpaceType referenceSpaceType; XrTime changeTime; XrBool32 poseValid; XrPosef poseInPreviousSpace; } XrEventDataReferenceSpaceChangePending; typedef struct XrEventDataInteractionProfileChanged { XrStructureType type; const void* XR_MAY_ALIAS next; XrSession session; } XrEventDataInteractionProfileChanged; typedef struct XrHapticVibration { XrStructureType type; const void* XR_MAY_ALIAS next; XrDuration duration; float frequency; float amplitude; } XrHapticVibration; typedef struct XrOffset2Df { float x; float y; } XrOffset2Df; typedef struct XrRect2Df { XrOffset2Df offset; XrExtent2Df extent; } XrRect2Df; typedef struct XrVector4f { float x; float y; float z; float w; } XrVector4f; typedef struct XrColor4f { float r; float g; float b; float a; } XrColor4f; typedef XrResult (XRAPI_PTR *PFN_xrGetInstanceProcAddr)(XrInstance instance, const char* name, PFN_xrVoidFunction* function); typedef XrResult (XRAPI_PTR *PFN_xrEnumerateApiLayerProperties)(uint32_t propertyCapacityInput, uint32_t* propertyCountOutput, XrApiLayerProperties* properties); typedef XrResult (XRAPI_PTR *PFN_xrEnumerateInstanceExtensionProperties)(const char* layerName, uint32_t propertyCapacityInput, uint32_t* propertyCountOutput, XrExtensionProperties* properties); typedef XrResult (XRAPI_PTR *PFN_xrCreateInstance)(const XrInstanceCreateInfo* createInfo, XrInstance* instance); typedef XrResult (XRAPI_PTR *PFN_xrDestroyInstance)(XrInstance instance); typedef XrResult (XRAPI_PTR *PFN_xrGetInstanceProperties)(XrInstance instance, XrInstanceProperties* instanceProperties); typedef XrResult (XRAPI_PTR *PFN_xrPollEvent)(XrInstance instance, XrEventDataBuffer* eventData); typedef XrResult (XRAPI_PTR *PFN_xrResultToString)(XrInstance instance, XrResult value, char buffer[XR_MAX_RESULT_STRING_SIZE]); typedef XrResult (XRAPI_PTR *PFN_xrStructureTypeToString)(XrInstance instance, XrStructureType value, char buffer[XR_MAX_STRUCTURE_NAME_SIZE]); typedef XrResult (XRAPI_PTR *PFN_xrGetSystem)(XrInstance instance, const XrSystemGetInfo* getInfo, XrSystemId* systemId); typedef XrResult (XRAPI_PTR *PFN_xrGetSystemProperties)(XrInstance instance, XrSystemId systemId, XrSystemProperties* properties); typedef XrResult (XRAPI_PTR *PFN_xrEnumerateEnvironmentBlendModes)(XrInstance instance, XrSystemId systemId, XrViewConfigurationType viewConfigurationType, uint32_t environmentBlendModeCapacityInput, uint32_t* environmentBlendModeCountOutput, XrEnvironmentBlendMode* environmentBlendModes); typedef XrResult (XRAPI_PTR *PFN_xrCreateSession)(XrInstance instance, const XrSessionCreateInfo* createInfo, XrSession* session); typedef XrResult (XRAPI_PTR *PFN_xrDestroySession)(XrSession session); typedef XrResult (XRAPI_PTR *PFN_xrEnumerateReferenceSpaces)(XrSession session, uint32_t spaceCapacityInput, uint32_t* spaceCountOutput, XrReferenceSpaceType* spaces); typedef XrResult (XRAPI_PTR *PFN_xrCreateReferenceSpace)(XrSession session, const XrReferenceSpaceCreateInfo* createInfo, XrSpace* space); typedef XrResult (XRAPI_PTR *PFN_xrGetReferenceSpaceBoundsRect)(XrSession session, XrReferenceSpaceType referenceSpaceType, XrExtent2Df* bounds); typedef XrResult (XRAPI_PTR *PFN_xrCreateActionSpace)(XrSession session, const XrActionSpaceCreateInfo* createInfo, XrSpace* space); typedef XrResult (XRAPI_PTR *PFN_xrLocateSpace)(XrSpace space, XrSpace baseSpace, XrTime time, XrSpaceLocation* location); typedef XrResult (XRAPI_PTR *PFN_xrDestroySpace)(XrSpace space); typedef XrResult (XRAPI_PTR *PFN_xrEnumerateViewConfigurations)(XrInstance instance, XrSystemId systemId, uint32_t viewConfigurationTypeCapacityInput, uint32_t* viewConfigurationTypeCountOutput, XrViewConfigurationType* viewConfigurationTypes); typedef XrResult (XRAPI_PTR *PFN_xrGetViewConfigurationProperties)(XrInstance instance, XrSystemId systemId, XrViewConfigurationType viewConfigurationType, XrViewConfigurationProperties* configurationProperties); typedef XrResult (XRAPI_PTR *PFN_xrEnumerateViewConfigurationViews)(XrInstance instance, XrSystemId systemId, XrViewConfigurationType viewConfigurationType, uint32_t viewCapacityInput, uint32_t* viewCountOutput, XrViewConfigurationView* views); typedef XrResult (XRAPI_PTR *PFN_xrEnumerateSwapchainFormats)(XrSession session, uint32_t formatCapacityInput, uint32_t* formatCountOutput, int64_t* formats); typedef XrResult (XRAPI_PTR *PFN_xrCreateSwapchain)(XrSession session, const XrSwapchainCreateInfo* createInfo, XrSwapchain* swapchain); typedef XrResult (XRAPI_PTR *PFN_xrDestroySwapchain)(XrSwapchain swapchain); typedef XrResult (XRAPI_PTR *PFN_xrEnumerateSwapchainImages)(XrSwapchain swapchain, uint32_t imageCapacityInput, uint32_t* imageCountOutput, XrSwapchainImageBaseHeader* images); typedef XrResult (XRAPI_PTR *PFN_xrAcquireSwapchainImage)(XrSwapchain swapchain, const XrSwapchainImageAcquireInfo* acquireInfo, uint32_t* index); typedef XrResult (XRAPI_PTR *PFN_xrWaitSwapchainImage)(XrSwapchain swapchain, const XrSwapchainImageWaitInfo* waitInfo); typedef XrResult (XRAPI_PTR *PFN_xrReleaseSwapchainImage)(XrSwapchain swapchain, const XrSwapchainImageReleaseInfo* releaseInfo); typedef XrResult (XRAPI_PTR *PFN_xrBeginSession)(XrSession session, const XrSessionBeginInfo* beginInfo); typedef XrResult (XRAPI_PTR *PFN_xrEndSession)(XrSession session); typedef XrResult (XRAPI_PTR *PFN_xrRequestExitSession)(XrSession session); typedef XrResult (XRAPI_PTR *PFN_xrWaitFrame)(XrSession session, const XrFrameWaitInfo* frameWaitInfo, XrFrameState* frameState); typedef XrResult (XRAPI_PTR *PFN_xrBeginFrame)(XrSession session, const XrFrameBeginInfo* frameBeginInfo); typedef XrResult (XRAPI_PTR *PFN_xrEndFrame)(XrSession session, const XrFrameEndInfo* frameEndInfo); typedef XrResult (XRAPI_PTR *PFN_xrLocateViews)(XrSession session, const XrViewLocateInfo* viewLocateInfo, XrViewState* viewState, uint32_t viewCapacityInput, uint32_t* viewCountOutput, XrView* views); typedef XrResult (XRAPI_PTR *PFN_xrStringToPath)(XrInstance instance, const char* pathString, XrPath* path); typedef XrResult (XRAPI_PTR *PFN_xrPathToString)(XrInstance instance, XrPath path, uint32_t bufferCapacityInput, uint32_t* bufferCountOutput, char* buffer); typedef XrResult (XRAPI_PTR *PFN_xrCreateActionSet)(XrInstance instance, const XrActionSetCreateInfo* createInfo, XrActionSet* actionSet); typedef XrResult (XRAPI_PTR *PFN_xrDestroyActionSet)(XrActionSet actionSet); typedef XrResult (XRAPI_PTR *PFN_xrCreateAction)(XrActionSet actionSet, const XrActionCreateInfo* createInfo, XrAction* action); typedef XrResult (XRAPI_PTR *PFN_xrDestroyAction)(XrAction action); typedef XrResult (XRAPI_PTR *PFN_xrSuggestInteractionProfileBindings)(XrInstance instance, const XrInteractionProfileSuggestedBinding* suggestedBindings); typedef XrResult (XRAPI_PTR *PFN_xrAttachSessionActionSets)(XrSession session, const XrSessionActionSetsAttachInfo* attachInfo); typedef XrResult (XRAPI_PTR *PFN_xrGetCurrentInteractionProfile)(XrSession session, XrPath topLevelUserPath, XrInteractionProfileState* interactionProfile); typedef XrResult (XRAPI_PTR *PFN_xrGetActionStateBoolean)(XrSession session, const XrActionStateGetInfo* getInfo, XrActionStateBoolean* state); typedef XrResult (XRAPI_PTR *PFN_xrGetActionStateFloat)(XrSession session, const XrActionStateGetInfo* getInfo, XrActionStateFloat* state); typedef XrResult (XRAPI_PTR *PFN_xrGetActionStateVector2f)(XrSession session, const XrActionStateGetInfo* getInfo, XrActionStateVector2f* state); typedef XrResult (XRAPI_PTR *PFN_xrGetActionStatePose)(XrSession session, const XrActionStateGetInfo* getInfo, XrActionStatePose* state); typedef XrResult (XRAPI_PTR *PFN_xrSyncActions)(XrSession session, const XrActionsSyncInfo* syncInfo); typedef XrResult (XRAPI_PTR *PFN_xrEnumerateBoundSourcesForAction)(XrSession session, const XrBoundSourcesForActionEnumerateInfo* enumerateInfo, uint32_t sourceCapacityInput, uint32_t* sourceCountOutput, XrPath* sources); typedef XrResult (XRAPI_PTR *PFN_xrGetInputSourceLocalizedName)(XrSession session, const XrInputSourceLocalizedNameGetInfo* getInfo, uint32_t bufferCapacityInput, uint32_t* bufferCountOutput, char* buffer); typedef XrResult (XRAPI_PTR *PFN_xrApplyHapticFeedback)(XrSession session, const XrHapticActionInfo* hapticActionInfo, const XrHapticBaseHeader* hapticFeedback); typedef XrResult (XRAPI_PTR *PFN_xrStopHapticFeedback)(XrSession session, const XrHapticActionInfo* hapticActionInfo); #ifndef XR_NO_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrGetInstanceProcAddr( XrInstance instance, const char* name, PFN_xrVoidFunction* function); XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateApiLayerProperties( uint32_t propertyCapacityInput, uint32_t* propertyCountOutput, XrApiLayerProperties* properties); XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateInstanceExtensionProperties( const char* layerName, uint32_t propertyCapacityInput, uint32_t* propertyCountOutput, XrExtensionProperties* properties); XRAPI_ATTR XrResult XRAPI_CALL xrCreateInstance( const XrInstanceCreateInfo* createInfo, XrInstance* instance); XRAPI_ATTR XrResult XRAPI_CALL xrDestroyInstance( XrInstance instance); XRAPI_ATTR XrResult XRAPI_CALL xrGetInstanceProperties( XrInstance instance, XrInstanceProperties* instanceProperties); XRAPI_ATTR XrResult XRAPI_CALL xrPollEvent( XrInstance instance, XrEventDataBuffer* eventData); XRAPI_ATTR XrResult XRAPI_CALL xrResultToString( XrInstance instance, XrResult value, char buffer[XR_MAX_RESULT_STRING_SIZE]); XRAPI_ATTR XrResult XRAPI_CALL xrStructureTypeToString( XrInstance instance, XrStructureType value, char buffer[XR_MAX_STRUCTURE_NAME_SIZE]); XRAPI_ATTR XrResult XRAPI_CALL xrGetSystem( XrInstance instance, const XrSystemGetInfo* getInfo, XrSystemId* systemId); XRAPI_ATTR XrResult XRAPI_CALL xrGetSystemProperties( XrInstance instance, XrSystemId systemId, XrSystemProperties* properties); XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateEnvironmentBlendModes( XrInstance instance, XrSystemId systemId, XrViewConfigurationType viewConfigurationType, uint32_t environmentBlendModeCapacityInput, uint32_t* environmentBlendModeCountOutput, XrEnvironmentBlendMode* environmentBlendModes); XRAPI_ATTR XrResult XRAPI_CALL xrCreateSession( XrInstance instance, const XrSessionCreateInfo* createInfo, XrSession* session); XRAPI_ATTR XrResult XRAPI_CALL xrDestroySession( XrSession session); XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateReferenceSpaces( XrSession session, uint32_t spaceCapacityInput, uint32_t* spaceCountOutput, XrReferenceSpaceType* spaces); XRAPI_ATTR XrResult XRAPI_CALL xrCreateReferenceSpace( XrSession session, const XrReferenceSpaceCreateInfo* createInfo, XrSpace* space); XRAPI_ATTR XrResult XRAPI_CALL xrGetReferenceSpaceBoundsRect( XrSession session, XrReferenceSpaceType referenceSpaceType, XrExtent2Df* bounds); XRAPI_ATTR XrResult XRAPI_CALL xrCreateActionSpace( XrSession session, const XrActionSpaceCreateInfo* createInfo, XrSpace* space); XRAPI_ATTR XrResult XRAPI_CALL xrLocateSpace( XrSpace space, XrSpace baseSpace, XrTime time, XrSpaceLocation* location); XRAPI_ATTR XrResult XRAPI_CALL xrDestroySpace( XrSpace space); XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateViewConfigurations( XrInstance instance, XrSystemId systemId, uint32_t viewConfigurationTypeCapacityInput, uint32_t* viewConfigurationTypeCountOutput, XrViewConfigurationType* viewConfigurationTypes); XRAPI_ATTR XrResult XRAPI_CALL xrGetViewConfigurationProperties( XrInstance instance, XrSystemId systemId, XrViewConfigurationType viewConfigurationType, XrViewConfigurationProperties* configurationProperties); XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateViewConfigurationViews( XrInstance instance, XrSystemId systemId, XrViewConfigurationType viewConfigurationType, uint32_t viewCapacityInput, uint32_t* viewCountOutput, XrViewConfigurationView* views); XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateSwapchainFormats( XrSession session, uint32_t formatCapacityInput, uint32_t* formatCountOutput, int64_t* formats); XRAPI_ATTR XrResult XRAPI_CALL xrCreateSwapchain( XrSession session, const XrSwapchainCreateInfo* createInfo, XrSwapchain* swapchain); XRAPI_ATTR XrResult XRAPI_CALL xrDestroySwapchain( XrSwapchain swapchain); XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateSwapchainImages( XrSwapchain swapchain, uint32_t imageCapacityInput, uint32_t* imageCountOutput, XrSwapchainImageBaseHeader* images); XRAPI_ATTR XrResult XRAPI_CALL xrAcquireSwapchainImage( XrSwapchain swapchain, const XrSwapchainImageAcquireInfo* acquireInfo, uint32_t* index); XRAPI_ATTR XrResult XRAPI_CALL xrWaitSwapchainImage( XrSwapchain swapchain, const XrSwapchainImageWaitInfo* waitInfo); XRAPI_ATTR XrResult XRAPI_CALL xrReleaseSwapchainImage( XrSwapchain swapchain, const XrSwapchainImageReleaseInfo* releaseInfo); XRAPI_ATTR XrResult XRAPI_CALL xrBeginSession( XrSession session, const XrSessionBeginInfo* beginInfo); XRAPI_ATTR XrResult XRAPI_CALL xrEndSession( XrSession session); XRAPI_ATTR XrResult XRAPI_CALL xrRequestExitSession( XrSession session); XRAPI_ATTR XrResult XRAPI_CALL xrWaitFrame( XrSession session, const XrFrameWaitInfo* frameWaitInfo, XrFrameState* frameState); XRAPI_ATTR XrResult XRAPI_CALL xrBeginFrame( XrSession session, const XrFrameBeginInfo* frameBeginInfo); XRAPI_ATTR XrResult XRAPI_CALL xrEndFrame( XrSession session, const XrFrameEndInfo* frameEndInfo); XRAPI_ATTR XrResult XRAPI_CALL xrLocateViews( XrSession session, const XrViewLocateInfo* viewLocateInfo, XrViewState* viewState, uint32_t viewCapacityInput, uint32_t* viewCountOutput, XrView* views); XRAPI_ATTR XrResult XRAPI_CALL xrStringToPath( XrInstance instance, const char* pathString, XrPath* path); XRAPI_ATTR XrResult XRAPI_CALL xrPathToString( XrInstance instance, XrPath path, uint32_t bufferCapacityInput, uint32_t* bufferCountOutput, char* buffer); XRAPI_ATTR XrResult XRAPI_CALL xrCreateActionSet( XrInstance instance, const XrActionSetCreateInfo* createInfo, XrActionSet* actionSet); XRAPI_ATTR XrResult XRAPI_CALL xrDestroyActionSet( XrActionSet actionSet); XRAPI_ATTR XrResult XRAPI_CALL xrCreateAction( XrActionSet actionSet, const XrActionCreateInfo* createInfo, XrAction* action); XRAPI_ATTR XrResult XRAPI_CALL xrDestroyAction( XrAction action); XRAPI_ATTR XrResult XRAPI_CALL xrSuggestInteractionProfileBindings( XrInstance instance, const XrInteractionProfileSuggestedBinding* suggestedBindings); XRAPI_ATTR XrResult XRAPI_CALL xrAttachSessionActionSets( XrSession session, const XrSessionActionSetsAttachInfo* attachInfo); XRAPI_ATTR XrResult XRAPI_CALL xrGetCurrentInteractionProfile( XrSession session, XrPath topLevelUserPath, XrInteractionProfileState* interactionProfile); XRAPI_ATTR XrResult XRAPI_CALL xrGetActionStateBoolean( XrSession session, const XrActionStateGetInfo* getInfo, XrActionStateBoolean* state); XRAPI_ATTR XrResult XRAPI_CALL xrGetActionStateFloat( XrSession session, const XrActionStateGetInfo* getInfo, XrActionStateFloat* state); XRAPI_ATTR XrResult XRAPI_CALL xrGetActionStateVector2f( XrSession session, const XrActionStateGetInfo* getInfo, XrActionStateVector2f* state); XRAPI_ATTR XrResult XRAPI_CALL xrGetActionStatePose( XrSession session, const XrActionStateGetInfo* getInfo, XrActionStatePose* state); XRAPI_ATTR XrResult XRAPI_CALL xrSyncActions( XrSession session, const XrActionsSyncInfo* syncInfo); XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateBoundSourcesForAction( XrSession session, const XrBoundSourcesForActionEnumerateInfo* enumerateInfo, uint32_t sourceCapacityInput, uint32_t* sourceCountOutput, XrPath* sources); XRAPI_ATTR XrResult XRAPI_CALL xrGetInputSourceLocalizedName( XrSession session, const XrInputSourceLocalizedNameGetInfo* getInfo, uint32_t bufferCapacityInput, uint32_t* bufferCountOutput, char* buffer); XRAPI_ATTR XrResult XRAPI_CALL xrApplyHapticFeedback( XrSession session, const XrHapticActionInfo* hapticActionInfo, const XrHapticBaseHeader* hapticFeedback); XRAPI_ATTR XrResult XRAPI_CALL xrStopHapticFeedback( XrSession session, const XrHapticActionInfo* hapticActionInfo); #endif /* !XR_NO_PROTOTYPES */ #define XR_KHR_composition_layer_cube 1 #define XR_KHR_composition_layer_cube_SPEC_VERSION 8 #define XR_KHR_COMPOSITION_LAYER_CUBE_EXTENSION_NAME "XR_KHR_composition_layer_cube" typedef struct XrCompositionLayerCubeKHR { XrStructureType type; const void* XR_MAY_ALIAS next; XrCompositionLayerFlags layerFlags; XrSpace space; XrEyeVisibility eyeVisibility; XrSwapchain swapchain; uint32_t imageArrayIndex; XrQuaternionf orientation; } XrCompositionLayerCubeKHR; #define XR_KHR_composition_layer_depth 1 #define XR_KHR_composition_layer_depth_SPEC_VERSION 5 #define XR_KHR_COMPOSITION_LAYER_DEPTH_EXTENSION_NAME "XR_KHR_composition_layer_depth" // XrCompositionLayerDepthInfoKHR extends XrCompositionLayerProjectionView typedef struct XrCompositionLayerDepthInfoKHR { XrStructureType type; const void* XR_MAY_ALIAS next; XrSwapchainSubImage subImage; float minDepth; float maxDepth; float nearZ; float farZ; } XrCompositionLayerDepthInfoKHR; #define XR_KHR_composition_layer_cylinder 1 #define XR_KHR_composition_layer_cylinder_SPEC_VERSION 4 #define XR_KHR_COMPOSITION_LAYER_CYLINDER_EXTENSION_NAME "XR_KHR_composition_layer_cylinder" typedef struct XrCompositionLayerCylinderKHR { XrStructureType type; const void* XR_MAY_ALIAS next; XrCompositionLayerFlags layerFlags; XrSpace space; XrEyeVisibility eyeVisibility; XrSwapchainSubImage subImage; XrPosef pose; float radius; float centralAngle; float aspectRatio; } XrCompositionLayerCylinderKHR; #define XR_KHR_composition_layer_equirect 1 #define XR_KHR_composition_layer_equirect_SPEC_VERSION 3 #define XR_KHR_COMPOSITION_LAYER_EQUIRECT_EXTENSION_NAME "XR_KHR_composition_layer_equirect" typedef struct XrCompositionLayerEquirectKHR { XrStructureType type; const void* XR_MAY_ALIAS next; XrCompositionLayerFlags layerFlags; XrSpace space; XrEyeVisibility eyeVisibility; XrSwapchainSubImage subImage; XrPosef pose; float radius; XrVector2f scale; XrVector2f bias; } XrCompositionLayerEquirectKHR; #define XR_KHR_visibility_mask 1 #define XR_KHR_visibility_mask_SPEC_VERSION 2 #define XR_KHR_VISIBILITY_MASK_EXTENSION_NAME "XR_KHR_visibility_mask" typedef enum XrVisibilityMaskTypeKHR { XR_VISIBILITY_MASK_TYPE_HIDDEN_TRIANGLE_MESH_KHR = 1, XR_VISIBILITY_MASK_TYPE_VISIBLE_TRIANGLE_MESH_KHR = 2, XR_VISIBILITY_MASK_TYPE_LINE_LOOP_KHR = 3, XR_VISIBILITY_MASK_TYPE_MAX_ENUM_KHR = 0x7FFFFFFF } XrVisibilityMaskTypeKHR; typedef struct XrVisibilityMaskKHR { XrStructureType type; void* XR_MAY_ALIAS next; uint32_t vertexCapacityInput; uint32_t vertexCountOutput; XrVector2f* vertices; uint32_t indexCapacityInput; uint32_t indexCountOutput; uint32_t* indices; } XrVisibilityMaskKHR; typedef struct XrEventDataVisibilityMaskChangedKHR { XrStructureType type; const void* XR_MAY_ALIAS next; XrSession session; XrViewConfigurationType viewConfigurationType; uint32_t viewIndex; } XrEventDataVisibilityMaskChangedKHR; typedef XrResult (XRAPI_PTR *PFN_xrGetVisibilityMaskKHR)(XrSession session, XrViewConfigurationType viewConfigurationType, uint32_t viewIndex, XrVisibilityMaskTypeKHR visibilityMaskType, XrVisibilityMaskKHR* visibilityMask); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrGetVisibilityMaskKHR( XrSession session, XrViewConfigurationType viewConfigurationType, uint32_t viewIndex, XrVisibilityMaskTypeKHR visibilityMaskType, XrVisibilityMaskKHR* visibilityMask); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_KHR_composition_layer_color_scale_bias 1 #define XR_KHR_composition_layer_color_scale_bias_SPEC_VERSION 5 #define XR_KHR_COMPOSITION_LAYER_COLOR_SCALE_BIAS_EXTENSION_NAME "XR_KHR_composition_layer_color_scale_bias" // XrCompositionLayerColorScaleBiasKHR extends XrCompositionLayerBaseHeader typedef struct XrCompositionLayerColorScaleBiasKHR { XrStructureType type; const void* XR_MAY_ALIAS next; XrColor4f colorScale; XrColor4f colorBias; } XrCompositionLayerColorScaleBiasKHR; #define XR_KHR_loader_init 1 #define XR_KHR_loader_init_SPEC_VERSION 1 #define XR_KHR_LOADER_INIT_EXTENSION_NAME "XR_KHR_loader_init" typedef struct XR_MAY_ALIAS XrLoaderInitInfoBaseHeaderKHR { XrStructureType type; const void* XR_MAY_ALIAS next; } XrLoaderInitInfoBaseHeaderKHR; typedef XrResult (XRAPI_PTR *PFN_xrInitializeLoaderKHR)(const XrLoaderInitInfoBaseHeaderKHR* loaderInitInfo); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrInitializeLoaderKHR( const XrLoaderInitInfoBaseHeaderKHR* loaderInitInfo); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_KHR_composition_layer_equirect2 1 #define XR_KHR_composition_layer_equirect2_SPEC_VERSION 1 #define XR_KHR_COMPOSITION_LAYER_EQUIRECT2_EXTENSION_NAME "XR_KHR_composition_layer_equirect2" typedef struct XrCompositionLayerEquirect2KHR { XrStructureType type; const void* XR_MAY_ALIAS next; XrCompositionLayerFlags layerFlags; XrSpace space; XrEyeVisibility eyeVisibility; XrSwapchainSubImage subImage; XrPosef pose; float radius; float centralHorizontalAngle; float upperVerticalAngle; float lowerVerticalAngle; } XrCompositionLayerEquirect2KHR; #define XR_KHR_binding_modification 1 #define XR_KHR_binding_modification_SPEC_VERSION 1 #define XR_KHR_BINDING_MODIFICATION_EXTENSION_NAME "XR_KHR_binding_modification" typedef struct XR_MAY_ALIAS XrBindingModificationBaseHeaderKHR { XrStructureType type; const void* XR_MAY_ALIAS next; } XrBindingModificationBaseHeaderKHR; // XrBindingModificationsKHR extends XrInteractionProfileSuggestedBinding typedef struct XrBindingModificationsKHR { XrStructureType type; const void* XR_MAY_ALIAS next; uint32_t bindingModificationCount; const XrBindingModificationBaseHeaderKHR* const* bindingModifications; } XrBindingModificationsKHR; #define XR_KHR_swapchain_usage_input_attachment_bit 1 #define XR_KHR_swapchain_usage_input_attachment_bit_SPEC_VERSION 3 #define XR_KHR_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_EXTENSION_NAME "XR_KHR_swapchain_usage_input_attachment_bit" #define XR_EXT_performance_settings 1 #define XR_EXT_performance_settings_SPEC_VERSION 3 #define XR_EXT_PERFORMANCE_SETTINGS_EXTENSION_NAME "XR_EXT_performance_settings" typedef enum XrPerfSettingsDomainEXT { XR_PERF_SETTINGS_DOMAIN_CPU_EXT = 1, XR_PERF_SETTINGS_DOMAIN_GPU_EXT = 2, XR_PERF_SETTINGS_DOMAIN_MAX_ENUM_EXT = 0x7FFFFFFF } XrPerfSettingsDomainEXT; typedef enum XrPerfSettingsSubDomainEXT { XR_PERF_SETTINGS_SUB_DOMAIN_COMPOSITING_EXT = 1, XR_PERF_SETTINGS_SUB_DOMAIN_RENDERING_EXT = 2, XR_PERF_SETTINGS_SUB_DOMAIN_THERMAL_EXT = 3, XR_PERF_SETTINGS_SUB_DOMAIN_MAX_ENUM_EXT = 0x7FFFFFFF } XrPerfSettingsSubDomainEXT; typedef enum XrPerfSettingsLevelEXT { XR_PERF_SETTINGS_LEVEL_POWER_SAVINGS_EXT = 0, XR_PERF_SETTINGS_LEVEL_SUSTAINED_LOW_EXT = 25, XR_PERF_SETTINGS_LEVEL_SUSTAINED_HIGH_EXT = 50, XR_PERF_SETTINGS_LEVEL_BOOST_EXT = 75, XR_PERF_SETTINGS_LEVEL_MAX_ENUM_EXT = 0x7FFFFFFF } XrPerfSettingsLevelEXT; typedef enum XrPerfSettingsNotificationLevelEXT { XR_PERF_SETTINGS_NOTIF_LEVEL_NORMAL_EXT = 0, XR_PERF_SETTINGS_NOTIF_LEVEL_WARNING_EXT = 25, XR_PERF_SETTINGS_NOTIF_LEVEL_IMPAIRED_EXT = 75, XR_PERF_SETTINGS_NOTIFICATION_LEVEL_MAX_ENUM_EXT = 0x7FFFFFFF } XrPerfSettingsNotificationLevelEXT; typedef struct XrEventDataPerfSettingsEXT { XrStructureType type; const void* XR_MAY_ALIAS next; XrPerfSettingsDomainEXT domain; XrPerfSettingsSubDomainEXT subDomain; XrPerfSettingsNotificationLevelEXT fromLevel; XrPerfSettingsNotificationLevelEXT toLevel; } XrEventDataPerfSettingsEXT; typedef XrResult (XRAPI_PTR *PFN_xrPerfSettingsSetPerformanceLevelEXT)(XrSession session, XrPerfSettingsDomainEXT domain, XrPerfSettingsLevelEXT level); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrPerfSettingsSetPerformanceLevelEXT( XrSession session, XrPerfSettingsDomainEXT domain, XrPerfSettingsLevelEXT level); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_EXT_thermal_query 1 #define XR_EXT_thermal_query_SPEC_VERSION 2 #define XR_EXT_THERMAL_QUERY_EXTENSION_NAME "XR_EXT_thermal_query" typedef XrResult (XRAPI_PTR *PFN_xrThermalGetTemperatureTrendEXT)(XrSession session, XrPerfSettingsDomainEXT domain, XrPerfSettingsNotificationLevelEXT* notificationLevel, float* tempHeadroom, float* tempSlope); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrThermalGetTemperatureTrendEXT( XrSession session, XrPerfSettingsDomainEXT domain, XrPerfSettingsNotificationLevelEXT* notificationLevel, float* tempHeadroom, float* tempSlope); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_EXT_debug_utils 1 XR_DEFINE_HANDLE(XrDebugUtilsMessengerEXT) #define XR_EXT_debug_utils_SPEC_VERSION 4 #define XR_EXT_DEBUG_UTILS_EXTENSION_NAME "XR_EXT_debug_utils" typedef XrFlags64 XrDebugUtilsMessageSeverityFlagsEXT; // Flag bits for XrDebugUtilsMessageSeverityFlagsEXT static const XrDebugUtilsMessageSeverityFlagsEXT XR_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT = 0x00000001; static const XrDebugUtilsMessageSeverityFlagsEXT XR_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT = 0x00000010; static const XrDebugUtilsMessageSeverityFlagsEXT XR_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT = 0x00000100; static const XrDebugUtilsMessageSeverityFlagsEXT XR_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT = 0x00001000; typedef XrFlags64 XrDebugUtilsMessageTypeFlagsEXT; // Flag bits for XrDebugUtilsMessageTypeFlagsEXT static const XrDebugUtilsMessageTypeFlagsEXT XR_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT = 0x00000001; static const XrDebugUtilsMessageTypeFlagsEXT XR_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT = 0x00000002; static const XrDebugUtilsMessageTypeFlagsEXT XR_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT = 0x00000004; static const XrDebugUtilsMessageTypeFlagsEXT XR_DEBUG_UTILS_MESSAGE_TYPE_CONFORMANCE_BIT_EXT = 0x00000008; typedef struct XrDebugUtilsObjectNameInfoEXT { XrStructureType type; const void* XR_MAY_ALIAS next; XrObjectType objectType; uint64_t objectHandle; const char* objectName; } XrDebugUtilsObjectNameInfoEXT; typedef struct XrDebugUtilsLabelEXT { XrStructureType type; const void* XR_MAY_ALIAS next; const char* labelName; } XrDebugUtilsLabelEXT; typedef struct XrDebugUtilsMessengerCallbackDataEXT { XrStructureType type; const void* XR_MAY_ALIAS next; const char* messageId; const char* functionName; const char* message; uint32_t objectCount; XrDebugUtilsObjectNameInfoEXT* objects; uint32_t sessionLabelCount; XrDebugUtilsLabelEXT* sessionLabels; } XrDebugUtilsMessengerCallbackDataEXT; typedef XrBool32 (XRAPI_PTR *PFN_xrDebugUtilsMessengerCallbackEXT)( XrDebugUtilsMessageSeverityFlagsEXT messageSeverity, XrDebugUtilsMessageTypeFlagsEXT messageTypes, const XrDebugUtilsMessengerCallbackDataEXT* callbackData, void* userData); // XrDebugUtilsMessengerCreateInfoEXT extends XrInstanceCreateInfo typedef struct XrDebugUtilsMessengerCreateInfoEXT { XrStructureType type; const void* XR_MAY_ALIAS next; XrDebugUtilsMessageSeverityFlagsEXT messageSeverities; XrDebugUtilsMessageTypeFlagsEXT messageTypes; PFN_xrDebugUtilsMessengerCallbackEXT userCallback; void* XR_MAY_ALIAS userData; } XrDebugUtilsMessengerCreateInfoEXT; typedef XrResult (XRAPI_PTR *PFN_xrSetDebugUtilsObjectNameEXT)(XrInstance instance, const XrDebugUtilsObjectNameInfoEXT* nameInfo); typedef XrResult (XRAPI_PTR *PFN_xrCreateDebugUtilsMessengerEXT)(XrInstance instance, const XrDebugUtilsMessengerCreateInfoEXT* createInfo, XrDebugUtilsMessengerEXT* messenger); typedef XrResult (XRAPI_PTR *PFN_xrDestroyDebugUtilsMessengerEXT)(XrDebugUtilsMessengerEXT messenger); typedef XrResult (XRAPI_PTR *PFN_xrSubmitDebugUtilsMessageEXT)(XrInstance instance, XrDebugUtilsMessageSeverityFlagsEXT messageSeverity, XrDebugUtilsMessageTypeFlagsEXT messageTypes, const XrDebugUtilsMessengerCallbackDataEXT* callbackData); typedef XrResult (XRAPI_PTR *PFN_xrSessionBeginDebugUtilsLabelRegionEXT)(XrSession session, const XrDebugUtilsLabelEXT* labelInfo); typedef XrResult (XRAPI_PTR *PFN_xrSessionEndDebugUtilsLabelRegionEXT)(XrSession session); typedef XrResult (XRAPI_PTR *PFN_xrSessionInsertDebugUtilsLabelEXT)(XrSession session, const XrDebugUtilsLabelEXT* labelInfo); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrSetDebugUtilsObjectNameEXT( XrInstance instance, const XrDebugUtilsObjectNameInfoEXT* nameInfo); XRAPI_ATTR XrResult XRAPI_CALL xrCreateDebugUtilsMessengerEXT( XrInstance instance, const XrDebugUtilsMessengerCreateInfoEXT* createInfo, XrDebugUtilsMessengerEXT* messenger); XRAPI_ATTR XrResult XRAPI_CALL xrDestroyDebugUtilsMessengerEXT( XrDebugUtilsMessengerEXT messenger); XRAPI_ATTR XrResult XRAPI_CALL xrSubmitDebugUtilsMessageEXT( XrInstance instance, XrDebugUtilsMessageSeverityFlagsEXT messageSeverity, XrDebugUtilsMessageTypeFlagsEXT messageTypes, const XrDebugUtilsMessengerCallbackDataEXT* callbackData); XRAPI_ATTR XrResult XRAPI_CALL xrSessionBeginDebugUtilsLabelRegionEXT( XrSession session, const XrDebugUtilsLabelEXT* labelInfo); XRAPI_ATTR XrResult XRAPI_CALL xrSessionEndDebugUtilsLabelRegionEXT( XrSession session); XRAPI_ATTR XrResult XRAPI_CALL xrSessionInsertDebugUtilsLabelEXT( XrSession session, const XrDebugUtilsLabelEXT* labelInfo); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_EXT_eye_gaze_interaction 1 #define XR_EXT_eye_gaze_interaction_SPEC_VERSION 1 #define XR_EXT_EYE_GAZE_INTERACTION_EXTENSION_NAME "XR_EXT_eye_gaze_interaction" // XrSystemEyeGazeInteractionPropertiesEXT extends XrSystemProperties typedef struct XrSystemEyeGazeInteractionPropertiesEXT { XrStructureType type; void* XR_MAY_ALIAS next; XrBool32 supportsEyeGazeInteraction; } XrSystemEyeGazeInteractionPropertiesEXT; // XrEyeGazeSampleTimeEXT extends XrSpaceLocation typedef struct XrEyeGazeSampleTimeEXT { XrStructureType type; void* XR_MAY_ALIAS next; XrTime time; } XrEyeGazeSampleTimeEXT; #define XR_EXTX_overlay 1 #define XR_EXTX_overlay_SPEC_VERSION 5 #define XR_EXTX_OVERLAY_EXTENSION_NAME "XR_EXTX_overlay" typedef XrFlags64 XrOverlaySessionCreateFlagsEXTX; // Flag bits for XrOverlaySessionCreateFlagsEXTX typedef XrFlags64 XrOverlayMainSessionFlagsEXTX; // Flag bits for XrOverlayMainSessionFlagsEXTX static const XrOverlayMainSessionFlagsEXTX XR_OVERLAY_MAIN_SESSION_ENABLED_COMPOSITION_LAYER_INFO_DEPTH_BIT_EXTX = 0x00000001; // XrSessionCreateInfoOverlayEXTX extends XrSessionCreateInfo typedef struct XrSessionCreateInfoOverlayEXTX { XrStructureType type; const void* XR_MAY_ALIAS next; XrOverlaySessionCreateFlagsEXTX createFlags; uint32_t sessionLayersPlacement; } XrSessionCreateInfoOverlayEXTX; typedef struct XrEventDataMainSessionVisibilityChangedEXTX { XrStructureType type; const void* XR_MAY_ALIAS next; XrBool32 visible; XrOverlayMainSessionFlagsEXTX flags; } XrEventDataMainSessionVisibilityChangedEXTX; #define XR_VARJO_quad_views 1 #define XR_VARJO_quad_views_SPEC_VERSION 1 #define XR_VARJO_QUAD_VIEWS_EXTENSION_NAME "XR_VARJO_quad_views" #define XR_MSFT_unbounded_reference_space 1 #define XR_MSFT_unbounded_reference_space_SPEC_VERSION 1 #define XR_MSFT_UNBOUNDED_REFERENCE_SPACE_EXTENSION_NAME "XR_MSFT_unbounded_reference_space" #define XR_MSFT_spatial_anchor 1 XR_DEFINE_HANDLE(XrSpatialAnchorMSFT) #define XR_MSFT_spatial_anchor_SPEC_VERSION 2 #define XR_MSFT_SPATIAL_ANCHOR_EXTENSION_NAME "XR_MSFT_spatial_anchor" typedef struct XrSpatialAnchorCreateInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; XrSpace space; XrPosef pose; XrTime time; } XrSpatialAnchorCreateInfoMSFT; typedef struct XrSpatialAnchorSpaceCreateInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; XrSpatialAnchorMSFT anchor; XrPosef poseInAnchorSpace; } XrSpatialAnchorSpaceCreateInfoMSFT; typedef XrResult (XRAPI_PTR *PFN_xrCreateSpatialAnchorMSFT)(XrSession session, const XrSpatialAnchorCreateInfoMSFT* createInfo, XrSpatialAnchorMSFT* anchor); typedef XrResult (XRAPI_PTR *PFN_xrCreateSpatialAnchorSpaceMSFT)(XrSession session, const XrSpatialAnchorSpaceCreateInfoMSFT* createInfo, XrSpace* space); typedef XrResult (XRAPI_PTR *PFN_xrDestroySpatialAnchorMSFT)(XrSpatialAnchorMSFT anchor); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrCreateSpatialAnchorMSFT( XrSession session, const XrSpatialAnchorCreateInfoMSFT* createInfo, XrSpatialAnchorMSFT* anchor); XRAPI_ATTR XrResult XRAPI_CALL xrCreateSpatialAnchorSpaceMSFT( XrSession session, const XrSpatialAnchorSpaceCreateInfoMSFT* createInfo, XrSpace* space); XRAPI_ATTR XrResult XRAPI_CALL xrDestroySpatialAnchorMSFT( XrSpatialAnchorMSFT anchor); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_FB_composition_layer_image_layout 1 #define XR_FB_composition_layer_image_layout_SPEC_VERSION 1 #define XR_FB_COMPOSITION_LAYER_IMAGE_LAYOUT_EXTENSION_NAME "XR_FB_composition_layer_image_layout" typedef XrFlags64 XrCompositionLayerImageLayoutFlagsFB; // Flag bits for XrCompositionLayerImageLayoutFlagsFB static const XrCompositionLayerImageLayoutFlagsFB XR_COMPOSITION_LAYER_IMAGE_LAYOUT_VERTICAL_FLIP_BIT_FB = 0x00000001; // XrCompositionLayerImageLayoutFB extends XrCompositionLayerBaseHeader typedef struct XrCompositionLayerImageLayoutFB { XrStructureType type; void* XR_MAY_ALIAS next; XrCompositionLayerImageLayoutFlagsFB flags; } XrCompositionLayerImageLayoutFB; #define XR_FB_composition_layer_alpha_blend 1 #define XR_FB_composition_layer_alpha_blend_SPEC_VERSION 2 #define XR_FB_COMPOSITION_LAYER_ALPHA_BLEND_EXTENSION_NAME "XR_FB_composition_layer_alpha_blend" typedef enum XrBlendFactorFB { XR_BLEND_FACTOR_ZERO_FB = 0, XR_BLEND_FACTOR_ONE_FB = 1, XR_BLEND_FACTOR_SRC_ALPHA_FB = 2, XR_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA_FB = 3, XR_BLEND_FACTOR_DST_ALPHA_FB = 4, XR_BLEND_FACTOR_ONE_MINUS_DST_ALPHA_FB = 5, XR_BLEND_FACTOR_MAX_ENUM_FB = 0x7FFFFFFF } XrBlendFactorFB; // XrCompositionLayerAlphaBlendFB extends XrCompositionLayerBaseHeader typedef struct XrCompositionLayerAlphaBlendFB { XrStructureType type; void* XR_MAY_ALIAS next; XrBlendFactorFB srcFactorColor; XrBlendFactorFB dstFactorColor; XrBlendFactorFB srcFactorAlpha; XrBlendFactorFB dstFactorAlpha; } XrCompositionLayerAlphaBlendFB; #define XR_MND_headless 1 #define XR_MND_headless_SPEC_VERSION 2 #define XR_MND_HEADLESS_EXTENSION_NAME "XR_MND_headless" #define XR_OCULUS_android_session_state_enable 1 #define XR_OCULUS_android_session_state_enable_SPEC_VERSION 1 #define XR_OCULUS_ANDROID_SESSION_STATE_ENABLE_EXTENSION_NAME "XR_OCULUS_android_session_state_enable" #define XR_EXT_view_configuration_depth_range 1 #define XR_EXT_view_configuration_depth_range_SPEC_VERSION 1 #define XR_EXT_VIEW_CONFIGURATION_DEPTH_RANGE_EXTENSION_NAME "XR_EXT_view_configuration_depth_range" // XrViewConfigurationDepthRangeEXT extends XrViewConfigurationView typedef struct XrViewConfigurationDepthRangeEXT { XrStructureType type; void* XR_MAY_ALIAS next; float recommendedNearZ; float minNearZ; float recommendedFarZ; float maxFarZ; } XrViewConfigurationDepthRangeEXT; #define XR_EXT_conformance_automation 1 #define XR_EXT_conformance_automation_SPEC_VERSION 3 #define XR_EXT_CONFORMANCE_AUTOMATION_EXTENSION_NAME "XR_EXT_conformance_automation" typedef XrResult (XRAPI_PTR *PFN_xrSetInputDeviceActiveEXT)(XrSession session, XrPath interactionProfile, XrPath topLevelPath, XrBool32 isActive); typedef XrResult (XRAPI_PTR *PFN_xrSetInputDeviceStateBoolEXT)(XrSession session, XrPath topLevelPath, XrPath inputSourcePath, XrBool32 state); typedef XrResult (XRAPI_PTR *PFN_xrSetInputDeviceStateFloatEXT)(XrSession session, XrPath topLevelPath, XrPath inputSourcePath, float state); typedef XrResult (XRAPI_PTR *PFN_xrSetInputDeviceStateVector2fEXT)(XrSession session, XrPath topLevelPath, XrPath inputSourcePath, XrVector2f state); typedef XrResult (XRAPI_PTR *PFN_xrSetInputDeviceLocationEXT)(XrSession session, XrPath topLevelPath, XrPath inputSourcePath, XrSpace space, XrPosef pose); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrSetInputDeviceActiveEXT( XrSession session, XrPath interactionProfile, XrPath topLevelPath, XrBool32 isActive); XRAPI_ATTR XrResult XRAPI_CALL xrSetInputDeviceStateBoolEXT( XrSession session, XrPath topLevelPath, XrPath inputSourcePath, XrBool32 state); XRAPI_ATTR XrResult XRAPI_CALL xrSetInputDeviceStateFloatEXT( XrSession session, XrPath topLevelPath, XrPath inputSourcePath, float state); XRAPI_ATTR XrResult XRAPI_CALL xrSetInputDeviceStateVector2fEXT( XrSession session, XrPath topLevelPath, XrPath inputSourcePath, XrVector2f state); XRAPI_ATTR XrResult XRAPI_CALL xrSetInputDeviceLocationEXT( XrSession session, XrPath topLevelPath, XrPath inputSourcePath, XrSpace space, XrPosef pose); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_MSFT_spatial_graph_bridge 1 #define XR_MSFT_spatial_graph_bridge_SPEC_VERSION 1 #define XR_MSFT_SPATIAL_GRAPH_BRIDGE_EXTENSION_NAME "XR_MSFT_spatial_graph_bridge" typedef enum XrSpatialGraphNodeTypeMSFT { XR_SPATIAL_GRAPH_NODE_TYPE_STATIC_MSFT = 1, XR_SPATIAL_GRAPH_NODE_TYPE_DYNAMIC_MSFT = 2, XR_SPATIAL_GRAPH_NODE_TYPE_MAX_ENUM_MSFT = 0x7FFFFFFF } XrSpatialGraphNodeTypeMSFT; typedef struct XrSpatialGraphNodeSpaceCreateInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; XrSpatialGraphNodeTypeMSFT nodeType; uint8_t nodeId[16]; XrPosef pose; } XrSpatialGraphNodeSpaceCreateInfoMSFT; typedef XrResult (XRAPI_PTR *PFN_xrCreateSpatialGraphNodeSpaceMSFT)(XrSession session, const XrSpatialGraphNodeSpaceCreateInfoMSFT* createInfo, XrSpace* space); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrCreateSpatialGraphNodeSpaceMSFT( XrSession session, const XrSpatialGraphNodeSpaceCreateInfoMSFT* createInfo, XrSpace* space); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_MSFT_hand_interaction 1 #define XR_MSFT_hand_interaction_SPEC_VERSION 1 #define XR_MSFT_HAND_INTERACTION_EXTENSION_NAME "XR_MSFT_hand_interaction" #define XR_EXT_hand_tracking 1 #define XR_HAND_JOINT_COUNT_EXT 26 XR_DEFINE_HANDLE(XrHandTrackerEXT) #define XR_EXT_hand_tracking_SPEC_VERSION 4 #define XR_EXT_HAND_TRACKING_EXTENSION_NAME "XR_EXT_hand_tracking" typedef enum XrHandEXT { XR_HAND_LEFT_EXT = 1, XR_HAND_RIGHT_EXT = 2, XR_HAND_MAX_ENUM_EXT = 0x7FFFFFFF } XrHandEXT; typedef enum XrHandJointEXT { XR_HAND_JOINT_PALM_EXT = 0, XR_HAND_JOINT_WRIST_EXT = 1, XR_HAND_JOINT_THUMB_METACARPAL_EXT = 2, XR_HAND_JOINT_THUMB_PROXIMAL_EXT = 3, XR_HAND_JOINT_THUMB_DISTAL_EXT = 4, XR_HAND_JOINT_THUMB_TIP_EXT = 5, XR_HAND_JOINT_INDEX_METACARPAL_EXT = 6, XR_HAND_JOINT_INDEX_PROXIMAL_EXT = 7, XR_HAND_JOINT_INDEX_INTERMEDIATE_EXT = 8, XR_HAND_JOINT_INDEX_DISTAL_EXT = 9, XR_HAND_JOINT_INDEX_TIP_EXT = 10, XR_HAND_JOINT_MIDDLE_METACARPAL_EXT = 11, XR_HAND_JOINT_MIDDLE_PROXIMAL_EXT = 12, XR_HAND_JOINT_MIDDLE_INTERMEDIATE_EXT = 13, XR_HAND_JOINT_MIDDLE_DISTAL_EXT = 14, XR_HAND_JOINT_MIDDLE_TIP_EXT = 15, XR_HAND_JOINT_RING_METACARPAL_EXT = 16, XR_HAND_JOINT_RING_PROXIMAL_EXT = 17, XR_HAND_JOINT_RING_INTERMEDIATE_EXT = 18, XR_HAND_JOINT_RING_DISTAL_EXT = 19, XR_HAND_JOINT_RING_TIP_EXT = 20, XR_HAND_JOINT_LITTLE_METACARPAL_EXT = 21, XR_HAND_JOINT_LITTLE_PROXIMAL_EXT = 22, XR_HAND_JOINT_LITTLE_INTERMEDIATE_EXT = 23, XR_HAND_JOINT_LITTLE_DISTAL_EXT = 24, XR_HAND_JOINT_LITTLE_TIP_EXT = 25, XR_HAND_JOINT_MAX_ENUM_EXT = 0x7FFFFFFF } XrHandJointEXT; typedef enum XrHandJointSetEXT { XR_HAND_JOINT_SET_DEFAULT_EXT = 0, XR_HAND_JOINT_SET_MAX_ENUM_EXT = 0x7FFFFFFF } XrHandJointSetEXT; // XrSystemHandTrackingPropertiesEXT extends XrSystemProperties typedef struct XrSystemHandTrackingPropertiesEXT { XrStructureType type; void* XR_MAY_ALIAS next; XrBool32 supportsHandTracking; } XrSystemHandTrackingPropertiesEXT; typedef struct XrHandTrackerCreateInfoEXT { XrStructureType type; const void* XR_MAY_ALIAS next; XrHandEXT hand; XrHandJointSetEXT handJointSet; } XrHandTrackerCreateInfoEXT; typedef struct XrHandJointsLocateInfoEXT { XrStructureType type; const void* XR_MAY_ALIAS next; XrSpace baseSpace; XrTime time; } XrHandJointsLocateInfoEXT; typedef struct XrHandJointLocationEXT { XrSpaceLocationFlags locationFlags; XrPosef pose; float radius; } XrHandJointLocationEXT; typedef struct XrHandJointVelocityEXT { XrSpaceVelocityFlags velocityFlags; XrVector3f linearVelocity; XrVector3f angularVelocity; } XrHandJointVelocityEXT; typedef struct XrHandJointLocationsEXT { XrStructureType type; void* XR_MAY_ALIAS next; XrBool32 isActive; uint32_t jointCount; XrHandJointLocationEXT* jointLocations; } XrHandJointLocationsEXT; // XrHandJointVelocitiesEXT extends XrHandJointLocationsEXT typedef struct XrHandJointVelocitiesEXT { XrStructureType type; void* XR_MAY_ALIAS next; uint32_t jointCount; XrHandJointVelocityEXT* jointVelocities; } XrHandJointVelocitiesEXT; typedef XrResult (XRAPI_PTR *PFN_xrCreateHandTrackerEXT)(XrSession session, const XrHandTrackerCreateInfoEXT* createInfo, XrHandTrackerEXT* handTracker); typedef XrResult (XRAPI_PTR *PFN_xrDestroyHandTrackerEXT)(XrHandTrackerEXT handTracker); typedef XrResult (XRAPI_PTR *PFN_xrLocateHandJointsEXT)(XrHandTrackerEXT handTracker, const XrHandJointsLocateInfoEXT* locateInfo, XrHandJointLocationsEXT* locations); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrCreateHandTrackerEXT( XrSession session, const XrHandTrackerCreateInfoEXT* createInfo, XrHandTrackerEXT* handTracker); XRAPI_ATTR XrResult XRAPI_CALL xrDestroyHandTrackerEXT( XrHandTrackerEXT handTracker); XRAPI_ATTR XrResult XRAPI_CALL xrLocateHandJointsEXT( XrHandTrackerEXT handTracker, const XrHandJointsLocateInfoEXT* locateInfo, XrHandJointLocationsEXT* locations); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_MSFT_hand_tracking_mesh 1 #define XR_MSFT_hand_tracking_mesh_SPEC_VERSION 3 #define XR_MSFT_HAND_TRACKING_MESH_EXTENSION_NAME "XR_MSFT_hand_tracking_mesh" typedef enum XrHandPoseTypeMSFT { XR_HAND_POSE_TYPE_TRACKED_MSFT = 0, XR_HAND_POSE_TYPE_REFERENCE_OPEN_PALM_MSFT = 1, XR_HAND_POSE_TYPE_MAX_ENUM_MSFT = 0x7FFFFFFF } XrHandPoseTypeMSFT; // XrSystemHandTrackingMeshPropertiesMSFT extends XrSystemProperties typedef struct XrSystemHandTrackingMeshPropertiesMSFT { XrStructureType type; void* XR_MAY_ALIAS next; XrBool32 supportsHandTrackingMesh; uint32_t maxHandMeshIndexCount; uint32_t maxHandMeshVertexCount; } XrSystemHandTrackingMeshPropertiesMSFT; typedef struct XrHandMeshSpaceCreateInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; XrHandPoseTypeMSFT handPoseType; XrPosef poseInHandMeshSpace; } XrHandMeshSpaceCreateInfoMSFT; typedef struct XrHandMeshUpdateInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; XrTime time; XrHandPoseTypeMSFT handPoseType; } XrHandMeshUpdateInfoMSFT; typedef struct XrHandMeshIndexBufferMSFT { uint32_t indexBufferKey; uint32_t indexCapacityInput; uint32_t indexCountOutput; uint32_t* indices; } XrHandMeshIndexBufferMSFT; typedef struct XrHandMeshVertexMSFT { XrVector3f position; XrVector3f normal; } XrHandMeshVertexMSFT; typedef struct XrHandMeshVertexBufferMSFT { XrTime vertexUpdateTime; uint32_t vertexCapacityInput; uint32_t vertexCountOutput; XrHandMeshVertexMSFT* vertices; } XrHandMeshVertexBufferMSFT; typedef struct XrHandMeshMSFT { XrStructureType type; void* XR_MAY_ALIAS next; XrBool32 isActive; XrBool32 indexBufferChanged; XrBool32 vertexBufferChanged; XrHandMeshIndexBufferMSFT indexBuffer; XrHandMeshVertexBufferMSFT vertexBuffer; } XrHandMeshMSFT; // XrHandPoseTypeInfoMSFT extends XrHandTrackerCreateInfoEXT typedef struct XrHandPoseTypeInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; XrHandPoseTypeMSFT handPoseType; } XrHandPoseTypeInfoMSFT; typedef XrResult (XRAPI_PTR *PFN_xrCreateHandMeshSpaceMSFT)(XrHandTrackerEXT handTracker, const XrHandMeshSpaceCreateInfoMSFT* createInfo, XrSpace* space); typedef XrResult (XRAPI_PTR *PFN_xrUpdateHandMeshMSFT)(XrHandTrackerEXT handTracker, const XrHandMeshUpdateInfoMSFT* updateInfo, XrHandMeshMSFT* handMesh); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrCreateHandMeshSpaceMSFT( XrHandTrackerEXT handTracker, const XrHandMeshSpaceCreateInfoMSFT* createInfo, XrSpace* space); XRAPI_ATTR XrResult XRAPI_CALL xrUpdateHandMeshMSFT( XrHandTrackerEXT handTracker, const XrHandMeshUpdateInfoMSFT* updateInfo, XrHandMeshMSFT* handMesh); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_MSFT_secondary_view_configuration 1 #define XR_MSFT_secondary_view_configuration_SPEC_VERSION 1 #define XR_MSFT_SECONDARY_VIEW_CONFIGURATION_EXTENSION_NAME "XR_MSFT_secondary_view_configuration" // XrSecondaryViewConfigurationSessionBeginInfoMSFT extends XrSessionBeginInfo typedef struct XrSecondaryViewConfigurationSessionBeginInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; uint32_t viewConfigurationCount; const XrViewConfigurationType* enabledViewConfigurationTypes; } XrSecondaryViewConfigurationSessionBeginInfoMSFT; typedef struct XrSecondaryViewConfigurationStateMSFT { XrStructureType type; void* XR_MAY_ALIAS next; XrViewConfigurationType viewConfigurationType; XrBool32 active; } XrSecondaryViewConfigurationStateMSFT; // XrSecondaryViewConfigurationFrameStateMSFT extends XrFrameState typedef struct XrSecondaryViewConfigurationFrameStateMSFT { XrStructureType type; void* XR_MAY_ALIAS next; uint32_t viewConfigurationCount; XrSecondaryViewConfigurationStateMSFT* viewConfigurationStates; } XrSecondaryViewConfigurationFrameStateMSFT; typedef struct XrSecondaryViewConfigurationLayerInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; XrViewConfigurationType viewConfigurationType; XrEnvironmentBlendMode environmentBlendMode; uint32_t layerCount; const XrCompositionLayerBaseHeader* const* layers; } XrSecondaryViewConfigurationLayerInfoMSFT; // XrSecondaryViewConfigurationFrameEndInfoMSFT extends XrFrameEndInfo typedef struct XrSecondaryViewConfigurationFrameEndInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; uint32_t viewConfigurationCount; const XrSecondaryViewConfigurationLayerInfoMSFT* viewConfigurationLayersInfo; } XrSecondaryViewConfigurationFrameEndInfoMSFT; // XrSecondaryViewConfigurationSwapchainCreateInfoMSFT extends XrSwapchainCreateInfo typedef struct XrSecondaryViewConfigurationSwapchainCreateInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; XrViewConfigurationType viewConfigurationType; } XrSecondaryViewConfigurationSwapchainCreateInfoMSFT; #define XR_MSFT_first_person_observer 1 #define XR_MSFT_first_person_observer_SPEC_VERSION 1 #define XR_MSFT_FIRST_PERSON_OBSERVER_EXTENSION_NAME "XR_MSFT_first_person_observer" #define XR_MSFT_controller_model 1 #define XR_NULL_CONTROLLER_MODEL_KEY_MSFT 0 XR_DEFINE_ATOM(XrControllerModelKeyMSFT) #define XR_MSFT_controller_model_SPEC_VERSION 2 #define XR_MSFT_CONTROLLER_MODEL_EXTENSION_NAME "XR_MSFT_controller_model" #define XR_MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT 64 typedef struct XrControllerModelKeyStateMSFT { XrStructureType type; void* XR_MAY_ALIAS next; XrControllerModelKeyMSFT modelKey; } XrControllerModelKeyStateMSFT; typedef struct XrControllerModelNodePropertiesMSFT { XrStructureType type; void* XR_MAY_ALIAS next; char parentNodeName[XR_MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT]; char nodeName[XR_MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT]; } XrControllerModelNodePropertiesMSFT; typedef struct XrControllerModelPropertiesMSFT { XrStructureType type; void* XR_MAY_ALIAS next; uint32_t nodeCapacityInput; uint32_t nodeCountOutput; XrControllerModelNodePropertiesMSFT* nodeProperties; } XrControllerModelPropertiesMSFT; typedef struct XrControllerModelNodeStateMSFT { XrStructureType type; void* XR_MAY_ALIAS next; XrPosef nodePose; } XrControllerModelNodeStateMSFT; typedef struct XrControllerModelStateMSFT { XrStructureType type; void* XR_MAY_ALIAS next; uint32_t nodeCapacityInput; uint32_t nodeCountOutput; XrControllerModelNodeStateMSFT* nodeStates; } XrControllerModelStateMSFT; typedef XrResult (XRAPI_PTR *PFN_xrGetControllerModelKeyMSFT)(XrSession session, XrPath topLevelUserPath, XrControllerModelKeyStateMSFT* controllerModelKeyState); typedef XrResult (XRAPI_PTR *PFN_xrLoadControllerModelMSFT)(XrSession session, XrControllerModelKeyMSFT modelKey, uint32_t bufferCapacityInput, uint32_t* bufferCountOutput, uint8_t* buffer); typedef XrResult (XRAPI_PTR *PFN_xrGetControllerModelPropertiesMSFT)(XrSession session, XrControllerModelKeyMSFT modelKey, XrControllerModelPropertiesMSFT* properties); typedef XrResult (XRAPI_PTR *PFN_xrGetControllerModelStateMSFT)(XrSession session, XrControllerModelKeyMSFT modelKey, XrControllerModelStateMSFT* state); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrGetControllerModelKeyMSFT( XrSession session, XrPath topLevelUserPath, XrControllerModelKeyStateMSFT* controllerModelKeyState); XRAPI_ATTR XrResult XRAPI_CALL xrLoadControllerModelMSFT( XrSession session, XrControllerModelKeyMSFT modelKey, uint32_t bufferCapacityInput, uint32_t* bufferCountOutput, uint8_t* buffer); XRAPI_ATTR XrResult XRAPI_CALL xrGetControllerModelPropertiesMSFT( XrSession session, XrControllerModelKeyMSFT modelKey, XrControllerModelPropertiesMSFT* properties); XRAPI_ATTR XrResult XRAPI_CALL xrGetControllerModelStateMSFT( XrSession session, XrControllerModelKeyMSFT modelKey, XrControllerModelStateMSFT* state); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_EXT_win32_appcontainer_compatible 1 #define XR_EXT_win32_appcontainer_compatible_SPEC_VERSION 1 #define XR_EXT_WIN32_APPCONTAINER_COMPATIBLE_EXTENSION_NAME "XR_EXT_win32_appcontainer_compatible" #define XR_EPIC_view_configuration_fov 1 #define XR_EPIC_view_configuration_fov_SPEC_VERSION 2 #define XR_EPIC_VIEW_CONFIGURATION_FOV_EXTENSION_NAME "XR_EPIC_view_configuration_fov" // XrViewConfigurationViewFovEPIC extends XrViewConfigurationView typedef struct XrViewConfigurationViewFovEPIC { XrStructureType type; const void* XR_MAY_ALIAS next; XrFovf recommendedFov; XrFovf maxMutableFov; } XrViewConfigurationViewFovEPIC; #define XR_MSFT_composition_layer_reprojection 1 #define XR_MSFT_composition_layer_reprojection_SPEC_VERSION 1 #define XR_MSFT_COMPOSITION_LAYER_REPROJECTION_EXTENSION_NAME "XR_MSFT_composition_layer_reprojection" typedef enum XrReprojectionModeMSFT { XR_REPROJECTION_MODE_DEPTH_MSFT = 1, XR_REPROJECTION_MODE_PLANAR_FROM_DEPTH_MSFT = 2, XR_REPROJECTION_MODE_PLANAR_MANUAL_MSFT = 3, XR_REPROJECTION_MODE_ORIENTATION_ONLY_MSFT = 4, XR_REPROJECTION_MODE_MAX_ENUM_MSFT = 0x7FFFFFFF } XrReprojectionModeMSFT; // XrCompositionLayerReprojectionInfoMSFT extends XrCompositionLayerProjection typedef struct XrCompositionLayerReprojectionInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; XrReprojectionModeMSFT reprojectionMode; } XrCompositionLayerReprojectionInfoMSFT; // XrCompositionLayerReprojectionPlaneOverrideMSFT extends XrCompositionLayerProjection typedef struct XrCompositionLayerReprojectionPlaneOverrideMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; XrVector3f position; XrVector3f normal; XrVector3f velocity; } XrCompositionLayerReprojectionPlaneOverrideMSFT; typedef XrResult (XRAPI_PTR *PFN_xrEnumerateReprojectionModesMSFT)(XrInstance instance, XrSystemId systemId, XrViewConfigurationType viewConfigurationType, uint32_t modeCapacityInput, uint32_t* modeCountOutput, XrReprojectionModeMSFT* modes); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateReprojectionModesMSFT( XrInstance instance, XrSystemId systemId, XrViewConfigurationType viewConfigurationType, uint32_t modeCapacityInput, uint32_t* modeCountOutput, XrReprojectionModeMSFT* modes); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_HUAWEI_controller_interaction 1 #define XR_HUAWEI_controller_interaction_SPEC_VERSION 1 #define XR_HUAWEI_CONTROLLER_INTERACTION_EXTENSION_NAME "XR_HUAWEI_controller_interaction" #define XR_FB_swapchain_update_state 1 #define XR_FB_swapchain_update_state_SPEC_VERSION 3 #define XR_FB_SWAPCHAIN_UPDATE_STATE_EXTENSION_NAME "XR_FB_swapchain_update_state" typedef struct XR_MAY_ALIAS XrSwapchainStateBaseHeaderFB { XrStructureType type; void* XR_MAY_ALIAS next; } XrSwapchainStateBaseHeaderFB; typedef XrResult (XRAPI_PTR *PFN_xrUpdateSwapchainFB)(XrSwapchain swapchain, const XrSwapchainStateBaseHeaderFB* state); typedef XrResult (XRAPI_PTR *PFN_xrGetSwapchainStateFB)(XrSwapchain swapchain, XrSwapchainStateBaseHeaderFB* state); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrUpdateSwapchainFB( XrSwapchain swapchain, const XrSwapchainStateBaseHeaderFB* state); XRAPI_ATTR XrResult XRAPI_CALL xrGetSwapchainStateFB( XrSwapchain swapchain, XrSwapchainStateBaseHeaderFB* state); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_FB_composition_layer_secure_content 1 #define XR_FB_composition_layer_secure_content_SPEC_VERSION 1 #define XR_FB_COMPOSITION_LAYER_SECURE_CONTENT_EXTENSION_NAME "XR_FB_composition_layer_secure_content" typedef XrFlags64 XrCompositionLayerSecureContentFlagsFB; // Flag bits for XrCompositionLayerSecureContentFlagsFB static const XrCompositionLayerSecureContentFlagsFB XR_COMPOSITION_LAYER_SECURE_CONTENT_EXCLUDE_LAYER_BIT_FB = 0x00000001; static const XrCompositionLayerSecureContentFlagsFB XR_COMPOSITION_LAYER_SECURE_CONTENT_REPLACE_LAYER_BIT_FB = 0x00000002; // XrCompositionLayerSecureContentFB extends XrCompositionLayerBaseHeader typedef struct XrCompositionLayerSecureContentFB { XrStructureType type; const void* XR_MAY_ALIAS next; XrCompositionLayerSecureContentFlagsFB flags; } XrCompositionLayerSecureContentFB; #define XR_VALVE_analog_threshold 1 #define XR_VALVE_analog_threshold_SPEC_VERSION 2 #define XR_VALVE_ANALOG_THRESHOLD_EXTENSION_NAME "XR_VALVE_analog_threshold" typedef struct XrInteractionProfileAnalogThresholdVALVE { XrStructureType type; const void* XR_MAY_ALIAS next; XrAction action; XrPath binding; float onThreshold; float offThreshold; const XrHapticBaseHeader* onHaptic; const XrHapticBaseHeader* offHaptic; } XrInteractionProfileAnalogThresholdVALVE; #define XR_EXT_hand_joints_motion_range 1 #define XR_EXT_hand_joints_motion_range_SPEC_VERSION 1 #define XR_EXT_HAND_JOINTS_MOTION_RANGE_EXTENSION_NAME "XR_EXT_hand_joints_motion_range" typedef enum XrHandJointsMotionRangeEXT { XR_HAND_JOINTS_MOTION_RANGE_UNOBSTRUCTED_EXT = 1, XR_HAND_JOINTS_MOTION_RANGE_CONFORMING_TO_CONTROLLER_EXT = 2, XR_HAND_JOINTS_MOTION_RANGE_MAX_ENUM_EXT = 0x7FFFFFFF } XrHandJointsMotionRangeEXT; // XrHandJointsMotionRangeInfoEXT extends XrHandJointsLocateInfoEXT typedef struct XrHandJointsMotionRangeInfoEXT { XrStructureType type; const void* XR_MAY_ALIAS next; XrHandJointsMotionRangeEXT handJointsMotionRange; } XrHandJointsMotionRangeInfoEXT; #define XR_EXT_samsung_odyssey_controller 1 #define XR_EXT_samsung_odyssey_controller_SPEC_VERSION 1 #define XR_EXT_SAMSUNG_ODYSSEY_CONTROLLER_EXTENSION_NAME "XR_EXT_samsung_odyssey_controller" #define XR_EXT_hp_mixed_reality_controller 1 #define XR_EXT_hp_mixed_reality_controller_SPEC_VERSION 1 #define XR_EXT_HP_MIXED_REALITY_CONTROLLER_EXTENSION_NAME "XR_EXT_hp_mixed_reality_controller" #define XR_MND_swapchain_usage_input_attachment_bit 1 #define XR_MND_swapchain_usage_input_attachment_bit_SPEC_VERSION 2 #define XR_MND_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_EXTENSION_NAME "XR_MND_swapchain_usage_input_attachment_bit" #define XR_MSFT_scene_understanding 1 XR_DEFINE_HANDLE(XrSceneObserverMSFT) XR_DEFINE_HANDLE(XrSceneMSFT) #define XR_MSFT_scene_understanding_SPEC_VERSION 1 #define XR_MSFT_SCENE_UNDERSTANDING_EXTENSION_NAME "XR_MSFT_scene_understanding" typedef enum XrSceneComputeFeatureMSFT { XR_SCENE_COMPUTE_FEATURE_PLANE_MSFT = 1, XR_SCENE_COMPUTE_FEATURE_PLANE_MESH_MSFT = 2, XR_SCENE_COMPUTE_FEATURE_VISUAL_MESH_MSFT = 3, XR_SCENE_COMPUTE_FEATURE_COLLIDER_MESH_MSFT = 4, XR_SCENE_COMPUTE_FEATURE_SERIALIZE_SCENE_MSFT = 1000098000, XR_SCENE_COMPUTE_FEATURE_MAX_ENUM_MSFT = 0x7FFFFFFF } XrSceneComputeFeatureMSFT; typedef enum XrSceneComputeConsistencyMSFT { XR_SCENE_COMPUTE_CONSISTENCY_SNAPSHOT_COMPLETE_MSFT = 1, XR_SCENE_COMPUTE_CONSISTENCY_SNAPSHOT_INCOMPLETE_FAST_MSFT = 2, XR_SCENE_COMPUTE_CONSISTENCY_OCCLUSION_OPTIMIZED_MSFT = 3, XR_SCENE_COMPUTE_CONSISTENCY_MAX_ENUM_MSFT = 0x7FFFFFFF } XrSceneComputeConsistencyMSFT; typedef enum XrMeshComputeLodMSFT { XR_MESH_COMPUTE_LOD_COARSE_MSFT = 1, XR_MESH_COMPUTE_LOD_MEDIUM_MSFT = 2, XR_MESH_COMPUTE_LOD_FINE_MSFT = 3, XR_MESH_COMPUTE_LOD_UNLIMITED_MSFT = 4, XR_MESH_COMPUTE_LOD_MAX_ENUM_MSFT = 0x7FFFFFFF } XrMeshComputeLodMSFT; typedef enum XrSceneComponentTypeMSFT { XR_SCENE_COMPONENT_TYPE_INVALID_MSFT = -1, XR_SCENE_COMPONENT_TYPE_OBJECT_MSFT = 1, XR_SCENE_COMPONENT_TYPE_PLANE_MSFT = 2, XR_SCENE_COMPONENT_TYPE_VISUAL_MESH_MSFT = 3, XR_SCENE_COMPONENT_TYPE_COLLIDER_MESH_MSFT = 4, XR_SCENE_COMPONENT_TYPE_SERIALIZED_SCENE_FRAGMENT_MSFT = 1000098000, XR_SCENE_COMPONENT_TYPE_MAX_ENUM_MSFT = 0x7FFFFFFF } XrSceneComponentTypeMSFT; typedef enum XrSceneObjectTypeMSFT { XR_SCENE_OBJECT_TYPE_UNCATEGORIZED_MSFT = -1, XR_SCENE_OBJECT_TYPE_BACKGROUND_MSFT = 1, XR_SCENE_OBJECT_TYPE_WALL_MSFT = 2, XR_SCENE_OBJECT_TYPE_FLOOR_MSFT = 3, XR_SCENE_OBJECT_TYPE_CEILING_MSFT = 4, XR_SCENE_OBJECT_TYPE_PLATFORM_MSFT = 5, XR_SCENE_OBJECT_TYPE_INFERRED_MSFT = 6, XR_SCENE_OBJECT_TYPE_MAX_ENUM_MSFT = 0x7FFFFFFF } XrSceneObjectTypeMSFT; typedef enum XrScenePlaneAlignmentTypeMSFT { XR_SCENE_PLANE_ALIGNMENT_TYPE_NON_ORTHOGONAL_MSFT = 0, XR_SCENE_PLANE_ALIGNMENT_TYPE_HORIZONTAL_MSFT = 1, XR_SCENE_PLANE_ALIGNMENT_TYPE_VERTICAL_MSFT = 2, XR_SCENE_PLANE_ALIGNMENT_TYPE_MAX_ENUM_MSFT = 0x7FFFFFFF } XrScenePlaneAlignmentTypeMSFT; typedef enum XrSceneComputeStateMSFT { XR_SCENE_COMPUTE_STATE_NONE_MSFT = 0, XR_SCENE_COMPUTE_STATE_UPDATING_MSFT = 1, XR_SCENE_COMPUTE_STATE_COMPLETED_MSFT = 2, XR_SCENE_COMPUTE_STATE_COMPLETED_WITH_ERROR_MSFT = 3, XR_SCENE_COMPUTE_STATE_MAX_ENUM_MSFT = 0x7FFFFFFF } XrSceneComputeStateMSFT; typedef struct XrUuidMSFT { uint8_t bytes[16]; } XrUuidMSFT; typedef struct XrSceneObserverCreateInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; } XrSceneObserverCreateInfoMSFT; typedef struct XrSceneCreateInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; } XrSceneCreateInfoMSFT; typedef struct XrSceneSphereBoundMSFT { XrVector3f center; float radius; } XrSceneSphereBoundMSFT; typedef struct XrSceneOrientedBoxBoundMSFT { XrPosef pose; XrVector3f extents; } XrSceneOrientedBoxBoundMSFT; typedef struct XrSceneFrustumBoundMSFT { XrPosef pose; XrFovf fov; float farDistance; } XrSceneFrustumBoundMSFT; typedef struct XrSceneBoundsMSFT { XrSpace space; XrTime time; uint32_t sphereCount; const XrSceneSphereBoundMSFT* spheres; uint32_t boxCount; const XrSceneOrientedBoxBoundMSFT* boxes; uint32_t frustumCount; const XrSceneFrustumBoundMSFT* frustums; } XrSceneBoundsMSFT; typedef struct XrNewSceneComputeInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; uint32_t requestedFeatureCount; const XrSceneComputeFeatureMSFT* requestedFeatures; XrSceneComputeConsistencyMSFT consistency; XrSceneBoundsMSFT bounds; } XrNewSceneComputeInfoMSFT; // XrVisualMeshComputeLodInfoMSFT extends XrNewSceneComputeInfoMSFT typedef struct XrVisualMeshComputeLodInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; XrMeshComputeLodMSFT lod; } XrVisualMeshComputeLodInfoMSFT; typedef struct XrSceneComponentMSFT { XrSceneComponentTypeMSFT componentType; XrUuidMSFT id; XrUuidMSFT parentId; XrTime updateTime; } XrSceneComponentMSFT; typedef struct XrSceneComponentsMSFT { XrStructureType type; void* XR_MAY_ALIAS next; uint32_t componentCapacityInput; uint32_t componentCountOutput; XrSceneComponentMSFT* components; } XrSceneComponentsMSFT; typedef struct XrSceneComponentsGetInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; XrSceneComponentTypeMSFT componentType; } XrSceneComponentsGetInfoMSFT; typedef struct XrSceneComponentLocationMSFT { XrSpaceLocationFlags flags; XrPosef pose; } XrSceneComponentLocationMSFT; typedef struct XrSceneComponentLocationsMSFT { XrStructureType type; void* XR_MAY_ALIAS next; uint32_t locationCount; XrSceneComponentLocationMSFT* locations; } XrSceneComponentLocationsMSFT; typedef struct XrSceneComponentsLocateInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; XrSpace baseSpace; XrTime time; uint32_t componentIdCount; const XrUuidMSFT* componentIds; } XrSceneComponentsLocateInfoMSFT; typedef struct XrSceneObjectMSFT { XrSceneObjectTypeMSFT objectType; } XrSceneObjectMSFT; // XrSceneObjectsMSFT extends XrSceneComponentsMSFT typedef struct XrSceneObjectsMSFT { XrStructureType type; void* XR_MAY_ALIAS next; uint32_t sceneObjectCount; XrSceneObjectMSFT* sceneObjects; } XrSceneObjectsMSFT; // XrSceneComponentParentFilterInfoMSFT extends XrSceneComponentsGetInfoMSFT typedef struct XrSceneComponentParentFilterInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; XrUuidMSFT parentId; } XrSceneComponentParentFilterInfoMSFT; // XrSceneObjectTypesFilterInfoMSFT extends XrSceneComponentsGetInfoMSFT typedef struct XrSceneObjectTypesFilterInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; uint32_t objectTypeCount; const XrSceneObjectTypeMSFT* objectTypes; } XrSceneObjectTypesFilterInfoMSFT; typedef struct XrScenePlaneMSFT { XrScenePlaneAlignmentTypeMSFT alignment; XrExtent2Df size; uint64_t meshBufferId; XrBool32 supportsIndicesUint16; } XrScenePlaneMSFT; // XrScenePlanesMSFT extends XrSceneComponentsMSFT typedef struct XrScenePlanesMSFT { XrStructureType type; void* XR_MAY_ALIAS next; uint32_t scenePlaneCount; XrScenePlaneMSFT* scenePlanes; } XrScenePlanesMSFT; // XrScenePlaneAlignmentFilterInfoMSFT extends XrSceneComponentsGetInfoMSFT typedef struct XrScenePlaneAlignmentFilterInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; uint32_t alignmentCount; const XrScenePlaneAlignmentTypeMSFT* alignments; } XrScenePlaneAlignmentFilterInfoMSFT; typedef struct XrSceneMeshMSFT { uint64_t meshBufferId; XrBool32 supportsIndicesUint16; } XrSceneMeshMSFT; // XrSceneMeshesMSFT extends XrSceneComponentsMSFT typedef struct XrSceneMeshesMSFT { XrStructureType type; void* XR_MAY_ALIAS next; uint32_t sceneMeshCount; XrSceneMeshMSFT* sceneMeshes; } XrSceneMeshesMSFT; typedef struct XrSceneMeshBuffersGetInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; uint64_t meshBufferId; } XrSceneMeshBuffersGetInfoMSFT; typedef struct XrSceneMeshBuffersMSFT { XrStructureType type; void* XR_MAY_ALIAS next; } XrSceneMeshBuffersMSFT; typedef struct XrSceneMeshVertexBufferMSFT { XrStructureType type; void* XR_MAY_ALIAS next; uint32_t vertexCapacityInput; uint32_t vertexCountOutput; XrVector3f* vertices; } XrSceneMeshVertexBufferMSFT; typedef struct XrSceneMeshIndicesUint32MSFT { XrStructureType type; void* XR_MAY_ALIAS next; uint32_t indexCapacityInput; uint32_t indexCountOutput; uint32_t* indices; } XrSceneMeshIndicesUint32MSFT; typedef struct XrSceneMeshIndicesUint16MSFT { XrStructureType type; void* XR_MAY_ALIAS next; uint32_t indexCapacityInput; uint32_t indexCountOutput; uint16_t* indices; } XrSceneMeshIndicesUint16MSFT; typedef XrResult (XRAPI_PTR *PFN_xrEnumerateSceneComputeFeaturesMSFT)(XrInstance instance, XrSystemId systemId, uint32_t featureCapacityInput, uint32_t* featureCountOutput, XrSceneComputeFeatureMSFT* features); typedef XrResult (XRAPI_PTR *PFN_xrCreateSceneObserverMSFT)(XrSession session, const XrSceneObserverCreateInfoMSFT* createInfo, XrSceneObserverMSFT* sceneObserver); typedef XrResult (XRAPI_PTR *PFN_xrDestroySceneObserverMSFT)(XrSceneObserverMSFT sceneObserver); typedef XrResult (XRAPI_PTR *PFN_xrCreateSceneMSFT)(XrSceneObserverMSFT sceneObserver, const XrSceneCreateInfoMSFT* createInfo, XrSceneMSFT* scene); typedef XrResult (XRAPI_PTR *PFN_xrDestroySceneMSFT)(XrSceneMSFT scene); typedef XrResult (XRAPI_PTR *PFN_xrComputeNewSceneMSFT)(XrSceneObserverMSFT sceneObserver, const XrNewSceneComputeInfoMSFT* computeInfo); typedef XrResult (XRAPI_PTR *PFN_xrGetSceneComputeStateMSFT)(XrSceneObserverMSFT sceneObserver, XrSceneComputeStateMSFT* state); typedef XrResult (XRAPI_PTR *PFN_xrGetSceneComponentsMSFT)(XrSceneMSFT scene, const XrSceneComponentsGetInfoMSFT* getInfo, XrSceneComponentsMSFT* components); typedef XrResult (XRAPI_PTR *PFN_xrLocateSceneComponentsMSFT)(XrSceneMSFT scene, const XrSceneComponentsLocateInfoMSFT* locateInfo, XrSceneComponentLocationsMSFT* locations); typedef XrResult (XRAPI_PTR *PFN_xrGetSceneMeshBuffersMSFT)(XrSceneMSFT scene, const XrSceneMeshBuffersGetInfoMSFT* getInfo, XrSceneMeshBuffersMSFT* buffers); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateSceneComputeFeaturesMSFT( XrInstance instance, XrSystemId systemId, uint32_t featureCapacityInput, uint32_t* featureCountOutput, XrSceneComputeFeatureMSFT* features); XRAPI_ATTR XrResult XRAPI_CALL xrCreateSceneObserverMSFT( XrSession session, const XrSceneObserverCreateInfoMSFT* createInfo, XrSceneObserverMSFT* sceneObserver); XRAPI_ATTR XrResult XRAPI_CALL xrDestroySceneObserverMSFT( XrSceneObserverMSFT sceneObserver); XRAPI_ATTR XrResult XRAPI_CALL xrCreateSceneMSFT( XrSceneObserverMSFT sceneObserver, const XrSceneCreateInfoMSFT* createInfo, XrSceneMSFT* scene); XRAPI_ATTR XrResult XRAPI_CALL xrDestroySceneMSFT( XrSceneMSFT scene); XRAPI_ATTR XrResult XRAPI_CALL xrComputeNewSceneMSFT( XrSceneObserverMSFT sceneObserver, const XrNewSceneComputeInfoMSFT* computeInfo); XRAPI_ATTR XrResult XRAPI_CALL xrGetSceneComputeStateMSFT( XrSceneObserverMSFT sceneObserver, XrSceneComputeStateMSFT* state); XRAPI_ATTR XrResult XRAPI_CALL xrGetSceneComponentsMSFT( XrSceneMSFT scene, const XrSceneComponentsGetInfoMSFT* getInfo, XrSceneComponentsMSFT* components); XRAPI_ATTR XrResult XRAPI_CALL xrLocateSceneComponentsMSFT( XrSceneMSFT scene, const XrSceneComponentsLocateInfoMSFT* locateInfo, XrSceneComponentLocationsMSFT* locations); XRAPI_ATTR XrResult XRAPI_CALL xrGetSceneMeshBuffersMSFT( XrSceneMSFT scene, const XrSceneMeshBuffersGetInfoMSFT* getInfo, XrSceneMeshBuffersMSFT* buffers); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_MSFT_scene_understanding_serialization 1 #define XR_MSFT_scene_understanding_serialization_SPEC_VERSION 1 #define XR_MSFT_SCENE_UNDERSTANDING_SERIALIZATION_EXTENSION_NAME "XR_MSFT_scene_understanding_serialization" typedef struct XrSerializedSceneFragmentDataGetInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; XrUuidMSFT sceneFragmentId; } XrSerializedSceneFragmentDataGetInfoMSFT; typedef struct XrDeserializeSceneFragmentMSFT { uint32_t bufferSize; const uint8_t* buffer; } XrDeserializeSceneFragmentMSFT; typedef struct XrSceneDeserializeInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; uint32_t fragmentCount; const XrDeserializeSceneFragmentMSFT* fragments; } XrSceneDeserializeInfoMSFT; typedef XrResult (XRAPI_PTR *PFN_xrDeserializeSceneMSFT)(XrSceneObserverMSFT sceneObserver, const XrSceneDeserializeInfoMSFT* deserializeInfo); typedef XrResult (XRAPI_PTR *PFN_xrGetSerializedSceneFragmentDataMSFT)(XrSceneMSFT scene, const XrSerializedSceneFragmentDataGetInfoMSFT* getInfo, uint32_t countInput, uint32_t* readOutput, uint8_t* buffer); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrDeserializeSceneMSFT( XrSceneObserverMSFT sceneObserver, const XrSceneDeserializeInfoMSFT* deserializeInfo); XRAPI_ATTR XrResult XRAPI_CALL xrGetSerializedSceneFragmentDataMSFT( XrSceneMSFT scene, const XrSerializedSceneFragmentDataGetInfoMSFT* getInfo, uint32_t countInput, uint32_t* readOutput, uint8_t* buffer); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_FB_display_refresh_rate 1 #define XR_FB_display_refresh_rate_SPEC_VERSION 1 #define XR_FB_DISPLAY_REFRESH_RATE_EXTENSION_NAME "XR_FB_display_refresh_rate" typedef struct XrEventDataDisplayRefreshRateChangedFB { XrStructureType type; const void* XR_MAY_ALIAS next; float fromDisplayRefreshRate; float toDisplayRefreshRate; } XrEventDataDisplayRefreshRateChangedFB; typedef XrResult (XRAPI_PTR *PFN_xrEnumerateDisplayRefreshRatesFB)(XrSession session, uint32_t displayRefreshRateCapacityInput, uint32_t* displayRefreshRateCountOutput, float* displayRefreshRates); typedef XrResult (XRAPI_PTR *PFN_xrGetDisplayRefreshRateFB)(XrSession session, float* displayRefreshRate); typedef XrResult (XRAPI_PTR *PFN_xrRequestDisplayRefreshRateFB)(XrSession session, float displayRefreshRate); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateDisplayRefreshRatesFB( XrSession session, uint32_t displayRefreshRateCapacityInput, uint32_t* displayRefreshRateCountOutput, float* displayRefreshRates); XRAPI_ATTR XrResult XRAPI_CALL xrGetDisplayRefreshRateFB( XrSession session, float* displayRefreshRate); XRAPI_ATTR XrResult XRAPI_CALL xrRequestDisplayRefreshRateFB( XrSession session, float displayRefreshRate); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_HTC_vive_cosmos_controller_interaction 1 #define XR_HTC_vive_cosmos_controller_interaction_SPEC_VERSION 1 #define XR_HTC_VIVE_COSMOS_CONTROLLER_INTERACTION_EXTENSION_NAME "XR_HTC_vive_cosmos_controller_interaction" #define XR_HTCX_vive_tracker_interaction 1 #define XR_HTCX_vive_tracker_interaction_SPEC_VERSION 1 #define XR_HTCX_VIVE_TRACKER_INTERACTION_EXTENSION_NAME "XR_HTCX_vive_tracker_interaction" typedef struct XrViveTrackerPathsHTCX { XrStructureType type; void* XR_MAY_ALIAS next; XrPath persistentPath; XrPath rolePath; } XrViveTrackerPathsHTCX; typedef struct XrEventDataViveTrackerConnectedHTCX { XrStructureType type; const void* XR_MAY_ALIAS next; XrViveTrackerPathsHTCX* paths; } XrEventDataViveTrackerConnectedHTCX; typedef XrResult (XRAPI_PTR *PFN_xrEnumerateViveTrackerPathsHTCX)(XrInstance instance, uint32_t pathCapacityInput, uint32_t* pathCountOutput, XrViveTrackerPathsHTCX* paths); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateViveTrackerPathsHTCX( XrInstance instance, uint32_t pathCapacityInput, uint32_t* pathCountOutput, XrViveTrackerPathsHTCX* paths); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_FB_color_space 1 #define XR_FB_color_space_SPEC_VERSION 2 #define XR_FB_COLOR_SPACE_EXTENSION_NAME "XR_FB_color_space" typedef enum XrColorSpaceFB { XR_COLOR_SPACE_UNMANAGED_FB = 0, XR_COLOR_SPACE_REC2020_FB = 1, XR_COLOR_SPACE_REC709_FB = 2, XR_COLOR_SPACE_RIFT_CV1_FB = 3, XR_COLOR_SPACE_RIFT_S_FB = 4, XR_COLOR_SPACE_QUEST_FB = 5, XR_COLOR_SPACE_P3_FB = 6, XR_COLOR_SPACE_ADOBE_RGB_FB = 7, XR_COLOR_SPACE_MAX_ENUM_FB = 0x7FFFFFFF } XrColorSpaceFB; // XrSystemColorSpacePropertiesFB extends XrSystemProperties typedef struct XrSystemColorSpacePropertiesFB { XrStructureType type; void* XR_MAY_ALIAS next; XrColorSpaceFB colorSpace; } XrSystemColorSpacePropertiesFB; typedef XrResult (XRAPI_PTR *PFN_xrEnumerateColorSpacesFB)(XrSession session, uint32_t colorSpaceCapacityInput, uint32_t* colorSpaceCountOutput, XrColorSpaceFB* colorSpaces); typedef XrResult (XRAPI_PTR *PFN_xrSetColorSpaceFB)(XrSession session, const XrColorSpaceFB colorspace); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateColorSpacesFB( XrSession session, uint32_t colorSpaceCapacityInput, uint32_t* colorSpaceCountOutput, XrColorSpaceFB* colorSpaces); XRAPI_ATTR XrResult XRAPI_CALL xrSetColorSpaceFB( XrSession session, const XrColorSpaceFB colorspace); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_FB_hand_tracking_mesh 1 #define XR_FB_hand_tracking_mesh_SPEC_VERSION 1 #define XR_FB_HAND_TRACKING_MESH_EXTENSION_NAME "XR_FB_hand_tracking_mesh" typedef struct XrVector4sFB { int16_t x; int16_t y; int16_t z; int16_t w; } XrVector4sFB; typedef struct XrHandTrackingMeshFB { XrStructureType type; void* XR_MAY_ALIAS next; uint32_t jointCapacityInput; uint32_t jointCountOutput; XrPosef* jointBindPoses; float* jointRadii; XrHandJointEXT* jointParents; uint32_t vertexCapacityInput; uint32_t vertexCountOutput; XrVector3f* vertexPositions; XrVector3f* vertexNormals; XrVector2f* vertexUVs; XrVector4sFB* vertexBlendIndices; XrVector4f* vertexBlendWeights; uint32_t indexCapacityInput; uint32_t indexCountOutput; int16_t* indices; } XrHandTrackingMeshFB; // XrHandTrackingScaleFB extends XrHandJointsLocateInfoEXT typedef struct XrHandTrackingScaleFB { XrStructureType type; void* XR_MAY_ALIAS next; float sensorOutput; float currentOutput; XrBool32 overrideHandScale; float overrideValueInput; } XrHandTrackingScaleFB; typedef XrResult (XRAPI_PTR *PFN_xrGetHandMeshFB)(XrHandTrackerEXT handTracker, XrHandTrackingMeshFB* mesh); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrGetHandMeshFB( XrHandTrackerEXT handTracker, XrHandTrackingMeshFB* mesh); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_FB_hand_tracking_aim 1 #define XR_FB_hand_tracking_aim_SPEC_VERSION 1 #define XR_FB_HAND_TRACKING_AIM_EXTENSION_NAME "XR_FB_hand_tracking_aim" typedef XrFlags64 XrHandTrackingAimFlagsFB; // Flag bits for XrHandTrackingAimFlagsFB static const XrHandTrackingAimFlagsFB XR_HAND_TRACKING_AIM_COMPUTED_BIT_FB = 0x00000001; static const XrHandTrackingAimFlagsFB XR_HAND_TRACKING_AIM_VALID_BIT_FB = 0x00000002; static const XrHandTrackingAimFlagsFB XR_HAND_TRACKING_AIM_INDEX_PINCHING_BIT_FB = 0x00000004; static const XrHandTrackingAimFlagsFB XR_HAND_TRACKING_AIM_MIDDLE_PINCHING_BIT_FB = 0x00000008; static const XrHandTrackingAimFlagsFB XR_HAND_TRACKING_AIM_RING_PINCHING_BIT_FB = 0x00000010; static const XrHandTrackingAimFlagsFB XR_HAND_TRACKING_AIM_LITTLE_PINCHING_BIT_FB = 0x00000020; static const XrHandTrackingAimFlagsFB XR_HAND_TRACKING_AIM_SYSTEM_GESTURE_BIT_FB = 0x00000040; static const XrHandTrackingAimFlagsFB XR_HAND_TRACKING_AIM_DOMINANT_HAND_BIT_FB = 0x00000080; static const XrHandTrackingAimFlagsFB XR_HAND_TRACKING_AIM_MENU_PRESSED_BIT_FB = 0x00000100; // XrHandTrackingAimStateFB extends XrHandJointsLocateInfoEXT typedef struct XrHandTrackingAimStateFB { XrStructureType type; void* XR_MAY_ALIAS next; XrHandTrackingAimFlagsFB status; XrPosef aimPose; float pinchStrengthIndex; float pinchStrengthMiddle; float pinchStrengthRing; float pinchStrengthLittle; } XrHandTrackingAimStateFB; #define XR_FB_hand_tracking_capsules 1 #define XR_FB_HAND_TRACKING_CAPSULE_POINT_COUNT 2 #define XR_FB_HAND_TRACKING_CAPSULE_COUNT 19 #define XR_FB_hand_tracking_capsules_SPEC_VERSION 1 #define XR_FB_HAND_TRACKING_CAPSULES_EXTENSION_NAME "XR_FB_hand_tracking_capsules" typedef struct XrHandCapsuleFB { XrVector3f points[XR_FB_HAND_TRACKING_CAPSULE_POINT_COUNT]; float radius; XrHandJointEXT joint; } XrHandCapsuleFB; // XrHandTrackingCapsulesStateFB extends XrHandJointsLocateInfoEXT typedef struct XrHandTrackingCapsulesStateFB { XrStructureType type; void* XR_MAY_ALIAS next; XrHandCapsuleFB capsules[XR_FB_HAND_TRACKING_CAPSULE_COUNT]; } XrHandTrackingCapsulesStateFB; #define XR_FB_foveation 1 XR_DEFINE_HANDLE(XrFoveationProfileFB) #define XR_FB_foveation_SPEC_VERSION 1 #define XR_FB_FOVEATION_EXTENSION_NAME "XR_FB_foveation" typedef XrFlags64 XrSwapchainCreateFoveationFlagsFB; // Flag bits for XrSwapchainCreateFoveationFlagsFB static const XrSwapchainCreateFoveationFlagsFB XR_SWAPCHAIN_CREATE_FOVEATION_SCALED_BIN_BIT_FB = 0x00000001; static const XrSwapchainCreateFoveationFlagsFB XR_SWAPCHAIN_CREATE_FOVEATION_FRAGMENT_DENSITY_MAP_BIT_FB = 0x00000002; typedef XrFlags64 XrSwapchainStateFoveationFlagsFB; // Flag bits for XrSwapchainStateFoveationFlagsFB typedef struct XrFoveationProfileCreateInfoFB { XrStructureType type; void* XR_MAY_ALIAS next; } XrFoveationProfileCreateInfoFB; // XrSwapchainCreateInfoFoveationFB extends XrSwapchainCreateInfo typedef struct XrSwapchainCreateInfoFoveationFB { XrStructureType type; void* XR_MAY_ALIAS next; XrSwapchainCreateFoveationFlagsFB flags; } XrSwapchainCreateInfoFoveationFB; typedef struct XrSwapchainStateFoveationFB { XrStructureType type; void* XR_MAY_ALIAS next; XrSwapchainStateFoveationFlagsFB flags; XrFoveationProfileFB profile; } XrSwapchainStateFoveationFB; typedef XrResult (XRAPI_PTR *PFN_xrCreateFoveationProfileFB)(XrSession session, const XrFoveationProfileCreateInfoFB* createInfo, XrFoveationProfileFB* profile); typedef XrResult (XRAPI_PTR *PFN_xrDestroyFoveationProfileFB)(XrFoveationProfileFB profile); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrCreateFoveationProfileFB( XrSession session, const XrFoveationProfileCreateInfoFB* createInfo, XrFoveationProfileFB* profile); XRAPI_ATTR XrResult XRAPI_CALL xrDestroyFoveationProfileFB( XrFoveationProfileFB profile); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_FB_foveation_configuration 1 #define XR_FB_foveation_configuration_SPEC_VERSION 1 #define XR_FB_FOVEATION_CONFIGURATION_EXTENSION_NAME "XR_FB_foveation_configuration" typedef enum XrFoveationLevelFB { XR_FOVEATION_LEVEL_NONE_FB = 0, XR_FOVEATION_LEVEL_LOW_FB = 1, XR_FOVEATION_LEVEL_MEDIUM_FB = 2, XR_FOVEATION_LEVEL_HIGH_FB = 3, XR_FOVEATION_LEVEL_MAX_ENUM_FB = 0x7FFFFFFF } XrFoveationLevelFB; typedef enum XrFoveationDynamicFB { XR_FOVEATION_DYNAMIC_DISABLED_FB = 0, XR_FOVEATION_DYNAMIC_LEVEL_ENABLED_FB = 1, XR_FOVEATION_DYNAMIC_MAX_ENUM_FB = 0x7FFFFFFF } XrFoveationDynamicFB; // XrFoveationLevelProfileCreateInfoFB extends XrFoveationProfileCreateInfoFB typedef struct XrFoveationLevelProfileCreateInfoFB { XrStructureType type; void* XR_MAY_ALIAS next; XrFoveationLevelFB level; float verticalOffset; XrFoveationDynamicFB dynamic; } XrFoveationLevelProfileCreateInfoFB; #define XR_FB_triangle_mesh 1 XR_DEFINE_HANDLE(XrTriangleMeshFB) #define XR_FB_triangle_mesh_SPEC_VERSION 1 #define XR_FB_TRIANGLE_MESH_EXTENSION_NAME "XR_FB_triangle_mesh" typedef enum XrWindingOrderFB { XR_WINDING_ORDER_UNKNOWN_FB = 0, XR_WINDING_ORDER_CW_FB = 1, XR_WINDING_ORDER_CCW_FB = 2, XR_WINDING_ORDER_MAX_ENUM_FB = 0x7FFFFFFF } XrWindingOrderFB; typedef XrFlags64 XrTriangleMeshFlagsFB; // Flag bits for XrTriangleMeshFlagsFB static const XrTriangleMeshFlagsFB XR_TRIANGLE_MESH_MUTABLE_BIT_FB = 0x00000001; typedef struct XrTriangleMeshCreateInfoFB { XrStructureType type; const void* XR_MAY_ALIAS next; XrTriangleMeshFlagsFB flags; XrWindingOrderFB windingOrder; uint32_t vertexCount; const XrVector3f* vertexBuffer; uint32_t triangleCount; const uint32_t* indexBuffer; } XrTriangleMeshCreateInfoFB; typedef XrResult (XRAPI_PTR *PFN_xrCreateTriangleMeshFB)(XrSession session, const XrTriangleMeshCreateInfoFB* createInfo, XrTriangleMeshFB* outTriangleMesh); typedef XrResult (XRAPI_PTR *PFN_xrDestroyTriangleMeshFB)(XrTriangleMeshFB mesh); typedef XrResult (XRAPI_PTR *PFN_xrTriangleMeshGetVertexBufferFB)(XrTriangleMeshFB mesh, XrVector3f** outVertexBuffer); typedef XrResult (XRAPI_PTR *PFN_xrTriangleMeshGetIndexBufferFB)(XrTriangleMeshFB mesh, uint32_t** outIndexBuffer); typedef XrResult (XRAPI_PTR *PFN_xrTriangleMeshBeginUpdateFB)(XrTriangleMeshFB mesh); typedef XrResult (XRAPI_PTR *PFN_xrTriangleMeshEndUpdateFB)(XrTriangleMeshFB mesh, uint32_t vertexCount, uint32_t triangleCount); typedef XrResult (XRAPI_PTR *PFN_xrTriangleMeshBeginVertexBufferUpdateFB)(XrTriangleMeshFB mesh, uint32_t* outVertexCount); typedef XrResult (XRAPI_PTR *PFN_xrTriangleMeshEndVertexBufferUpdateFB)(XrTriangleMeshFB mesh); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrCreateTriangleMeshFB( XrSession session, const XrTriangleMeshCreateInfoFB* createInfo, XrTriangleMeshFB* outTriangleMesh); XRAPI_ATTR XrResult XRAPI_CALL xrDestroyTriangleMeshFB( XrTriangleMeshFB mesh); XRAPI_ATTR XrResult XRAPI_CALL xrTriangleMeshGetVertexBufferFB( XrTriangleMeshFB mesh, XrVector3f** outVertexBuffer); XRAPI_ATTR XrResult XRAPI_CALL xrTriangleMeshGetIndexBufferFB( XrTriangleMeshFB mesh, uint32_t** outIndexBuffer); XRAPI_ATTR XrResult XRAPI_CALL xrTriangleMeshBeginUpdateFB( XrTriangleMeshFB mesh); XRAPI_ATTR XrResult XRAPI_CALL xrTriangleMeshEndUpdateFB( XrTriangleMeshFB mesh, uint32_t vertexCount, uint32_t triangleCount); XRAPI_ATTR XrResult XRAPI_CALL xrTriangleMeshBeginVertexBufferUpdateFB( XrTriangleMeshFB mesh, uint32_t* outVertexCount); XRAPI_ATTR XrResult XRAPI_CALL xrTriangleMeshEndVertexBufferUpdateFB( XrTriangleMeshFB mesh); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_FB_passthrough 1 XR_DEFINE_HANDLE(XrPassthroughFB) XR_DEFINE_HANDLE(XrPassthroughLayerFB) XR_DEFINE_HANDLE(XrGeometryInstanceFB) #define XR_FB_passthrough_SPEC_VERSION 1 #define XR_FB_PASSTHROUGH_EXTENSION_NAME "XR_FB_passthrough" #define XR_PASSTHROUGH_COLOR_MAP_MONO_SIZE_FB 256 typedef enum XrPassthroughLayerPurposeFB { XR_PASSTHROUGH_LAYER_PURPOSE_RECONSTRUCTION_FB = 0, XR_PASSTHROUGH_LAYER_PURPOSE_PROJECTED_FB = 1, XR_PASSTHROUGH_LAYER_PURPOSE_MAX_ENUM_FB = 0x7FFFFFFF } XrPassthroughLayerPurposeFB; typedef XrFlags64 XrPassthroughFlagsFB; // Flag bits for XrPassthroughFlagsFB static const XrPassthroughFlagsFB XR_PASSTHROUGH_IS_RUNNING_AT_CREATION_BIT_FB = 0x00000001; typedef XrFlags64 XrPassthroughStateChangedFlagsFB; // Flag bits for XrPassthroughStateChangedFlagsFB static const XrPassthroughStateChangedFlagsFB XR_PASSTHROUGH_STATE_CHANGED_REINIT_REQUIRED_BIT_FB = 0x00000001; static const XrPassthroughStateChangedFlagsFB XR_PASSTHROUGH_STATE_CHANGED_NON_RECOVERABLE_ERROR_BIT_FB = 0x00000002; static const XrPassthroughStateChangedFlagsFB XR_PASSTHROUGH_STATE_CHANGED_RECOVERABLE_ERROR_BIT_FB = 0x00000004; static const XrPassthroughStateChangedFlagsFB XR_PASSTHROUGH_STATE_CHANGED_RESTORED_ERROR_BIT_FB = 0x00000008; // XrSystemPassthroughPropertiesFB extends XrSystemProperties typedef struct XrSystemPassthroughPropertiesFB { XrStructureType type; const void* XR_MAY_ALIAS next; XrBool32 supportsPassthrough; } XrSystemPassthroughPropertiesFB; typedef struct XrPassthroughCreateInfoFB { XrStructureType type; const void* XR_MAY_ALIAS next; XrPassthroughFlagsFB flags; } XrPassthroughCreateInfoFB; typedef struct XrPassthroughLayerCreateInfoFB { XrStructureType type; const void* XR_MAY_ALIAS next; XrPassthroughFB passthrough; XrPassthroughFlagsFB flags; XrPassthroughLayerPurposeFB purpose; } XrPassthroughLayerCreateInfoFB; // XrCompositionLayerPassthroughFB extends XrCompositionLayerBaseHeader typedef struct XrCompositionLayerPassthroughFB { XrStructureType type; const void* XR_MAY_ALIAS next; XrCompositionLayerFlags flags; XrSpace space; XrPassthroughLayerFB layerHandle; } XrCompositionLayerPassthroughFB; typedef struct XrGeometryInstanceCreateInfoFB { XrStructureType type; const void* XR_MAY_ALIAS next; XrPassthroughLayerFB layer; XrTriangleMeshFB mesh; XrSpace baseSpace; XrPosef pose; XrVector3f scale; } XrGeometryInstanceCreateInfoFB; typedef struct XrGeometryInstanceTransformFB { XrStructureType type; const void* XR_MAY_ALIAS next; XrSpace baseSpace; XrTime time; XrPosef pose; XrVector3f scale; } XrGeometryInstanceTransformFB; typedef struct XrPassthroughStyleFB { XrStructureType type; const void* XR_MAY_ALIAS next; float textureOpacityFactor; XrColor4f edgeColor; } XrPassthroughStyleFB; typedef struct XrPassthroughColorMapMonoToRgbaFB { XrStructureType type; const void* XR_MAY_ALIAS next; XrColor4f textureColorMap[XR_PASSTHROUGH_COLOR_MAP_MONO_SIZE_FB]; } XrPassthroughColorMapMonoToRgbaFB; typedef struct XrPassthroughColorMapMonoToMonoFB { XrStructureType type; const void* XR_MAY_ALIAS next; uint8_t textureColorMap[XR_PASSTHROUGH_COLOR_MAP_MONO_SIZE_FB]; } XrPassthroughColorMapMonoToMonoFB; typedef struct XrEventDataPassthroughStateChangedFB { XrStructureType type; const void* XR_MAY_ALIAS next; XrPassthroughStateChangedFlagsFB flags; } XrEventDataPassthroughStateChangedFB; typedef XrResult (XRAPI_PTR *PFN_xrCreatePassthroughFB)(XrSession session, const XrPassthroughCreateInfoFB* createInfo, XrPassthroughFB* outPassthrough); typedef XrResult (XRAPI_PTR *PFN_xrDestroyPassthroughFB)(XrPassthroughFB passthrough); typedef XrResult (XRAPI_PTR *PFN_xrPassthroughStartFB)(XrPassthroughFB passthrough); typedef XrResult (XRAPI_PTR *PFN_xrPassthroughPauseFB)(XrPassthroughFB passthrough); typedef XrResult (XRAPI_PTR *PFN_xrCreatePassthroughLayerFB)(XrSession session, const XrPassthroughLayerCreateInfoFB* createInfo, XrPassthroughLayerFB* outLayer); typedef XrResult (XRAPI_PTR *PFN_xrDestroyPassthroughLayerFB)(XrPassthroughLayerFB layer); typedef XrResult (XRAPI_PTR *PFN_xrPassthroughLayerPauseFB)(XrPassthroughLayerFB layer); typedef XrResult (XRAPI_PTR *PFN_xrPassthroughLayerResumeFB)(XrPassthroughLayerFB layer); typedef XrResult (XRAPI_PTR *PFN_xrPassthroughLayerSetStyleFB)(XrPassthroughLayerFB layer, const XrPassthroughStyleFB* style); typedef XrResult (XRAPI_PTR *PFN_xrCreateGeometryInstanceFB)(XrSession session, const XrGeometryInstanceCreateInfoFB* createInfo, XrGeometryInstanceFB* outGeometryInstance); typedef XrResult (XRAPI_PTR *PFN_xrDestroyGeometryInstanceFB)(XrGeometryInstanceFB instance); typedef XrResult (XRAPI_PTR *PFN_xrGeometryInstanceSetTransformFB)(XrGeometryInstanceFB instance, const XrGeometryInstanceTransformFB* transformation); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrCreatePassthroughFB( XrSession session, const XrPassthroughCreateInfoFB* createInfo, XrPassthroughFB* outPassthrough); XRAPI_ATTR XrResult XRAPI_CALL xrDestroyPassthroughFB( XrPassthroughFB passthrough); XRAPI_ATTR XrResult XRAPI_CALL xrPassthroughStartFB( XrPassthroughFB passthrough); XRAPI_ATTR XrResult XRAPI_CALL xrPassthroughPauseFB( XrPassthroughFB passthrough); XRAPI_ATTR XrResult XRAPI_CALL xrCreatePassthroughLayerFB( XrSession session, const XrPassthroughLayerCreateInfoFB* createInfo, XrPassthroughLayerFB* outLayer); XRAPI_ATTR XrResult XRAPI_CALL xrDestroyPassthroughLayerFB( XrPassthroughLayerFB layer); XRAPI_ATTR XrResult XRAPI_CALL xrPassthroughLayerPauseFB( XrPassthroughLayerFB layer); XRAPI_ATTR XrResult XRAPI_CALL xrPassthroughLayerResumeFB( XrPassthroughLayerFB layer); XRAPI_ATTR XrResult XRAPI_CALL xrPassthroughLayerSetStyleFB( XrPassthroughLayerFB layer, const XrPassthroughStyleFB* style); XRAPI_ATTR XrResult XRAPI_CALL xrCreateGeometryInstanceFB( XrSession session, const XrGeometryInstanceCreateInfoFB* createInfo, XrGeometryInstanceFB* outGeometryInstance); XRAPI_ATTR XrResult XRAPI_CALL xrDestroyGeometryInstanceFB( XrGeometryInstanceFB instance); XRAPI_ATTR XrResult XRAPI_CALL xrGeometryInstanceSetTransformFB( XrGeometryInstanceFB instance, const XrGeometryInstanceTransformFB* transformation); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_VARJO_foveated_rendering 1 #define XR_VARJO_foveated_rendering_SPEC_VERSION 2 #define XR_VARJO_FOVEATED_RENDERING_EXTENSION_NAME "XR_VARJO_foveated_rendering" // XrViewLocateFoveatedRenderingVARJO extends XrViewLocateInfo typedef struct XrViewLocateFoveatedRenderingVARJO { XrStructureType type; const void* XR_MAY_ALIAS next; XrBool32 foveatedRenderingActive; } XrViewLocateFoveatedRenderingVARJO; // XrFoveatedViewConfigurationViewVARJO extends XrViewConfigurationView typedef struct XrFoveatedViewConfigurationViewVARJO { XrStructureType type; void* XR_MAY_ALIAS next; XrBool32 foveatedRenderingActive; } XrFoveatedViewConfigurationViewVARJO; // XrSystemFoveatedRenderingPropertiesVARJO extends XrSystemProperties typedef struct XrSystemFoveatedRenderingPropertiesVARJO { XrStructureType type; void* XR_MAY_ALIAS next; XrBool32 supportsFoveatedRendering; } XrSystemFoveatedRenderingPropertiesVARJO; #define XR_VARJO_composition_layer_depth_test 1 #define XR_VARJO_composition_layer_depth_test_SPEC_VERSION 2 #define XR_VARJO_COMPOSITION_LAYER_DEPTH_TEST_EXTENSION_NAME "XR_VARJO_composition_layer_depth_test" // XrCompositionLayerDepthTestVARJO extends XrCompositionLayerProjection typedef struct XrCompositionLayerDepthTestVARJO { XrStructureType type; const void* XR_MAY_ALIAS next; float depthTestRangeNearZ; float depthTestRangeFarZ; } XrCompositionLayerDepthTestVARJO; #define XR_VARJO_environment_depth_estimation 1 #define XR_VARJO_environment_depth_estimation_SPEC_VERSION 1 #define XR_VARJO_ENVIRONMENT_DEPTH_ESTIMATION_EXTENSION_NAME "XR_VARJO_environment_depth_estimation" typedef XrResult (XRAPI_PTR *PFN_xrSetEnvironmentDepthEstimationVARJO)(XrSession session, XrBool32 enabled); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrSetEnvironmentDepthEstimationVARJO( XrSession session, XrBool32 enabled); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_VARJO_marker_tracking 1 #define XR_VARJO_marker_tracking_SPEC_VERSION 1 #define XR_VARJO_MARKER_TRACKING_EXTENSION_NAME "XR_VARJO_marker_tracking" // XrSystemMarkerTrackingPropertiesVARJO extends XrSystemProperties typedef struct XrSystemMarkerTrackingPropertiesVARJO { XrStructureType type; void* XR_MAY_ALIAS next; XrBool32 supportsMarkerTracking; } XrSystemMarkerTrackingPropertiesVARJO; typedef struct XrEventDataMarkerTrackingUpdateVARJO { XrStructureType type; const void* XR_MAY_ALIAS next; uint64_t markerId; XrBool32 isActive; XrBool32 isPredicted; XrTime time; } XrEventDataMarkerTrackingUpdateVARJO; typedef struct XrMarkerSpaceCreateInfoVARJO { XrStructureType type; const void* XR_MAY_ALIAS next; uint64_t markerId; XrPosef poseInMarkerSpace; } XrMarkerSpaceCreateInfoVARJO; typedef XrResult (XRAPI_PTR *PFN_xrSetMarkerTrackingVARJO)(XrSession session, XrBool32 enabled); typedef XrResult (XRAPI_PTR *PFN_xrSetMarkerTrackingTimeoutVARJO)(XrSession session, uint64_t markerId, XrDuration timeout); typedef XrResult (XRAPI_PTR *PFN_xrSetMarkerTrackingPredictionVARJO)(XrSession session, uint64_t markerId, XrBool32 enabled); typedef XrResult (XRAPI_PTR *PFN_xrGetMarkerSizeVARJO)(XrSession session, uint64_t markerId, XrExtent2Df* size); typedef XrResult (XRAPI_PTR *PFN_xrCreateMarkerSpaceVARJO)(XrSession session, const XrMarkerSpaceCreateInfoVARJO* createInfo, XrSpace* space); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrSetMarkerTrackingVARJO( XrSession session, XrBool32 enabled); XRAPI_ATTR XrResult XRAPI_CALL xrSetMarkerTrackingTimeoutVARJO( XrSession session, uint64_t markerId, XrDuration timeout); XRAPI_ATTR XrResult XRAPI_CALL xrSetMarkerTrackingPredictionVARJO( XrSession session, uint64_t markerId, XrBool32 enabled); XRAPI_ATTR XrResult XRAPI_CALL xrGetMarkerSizeVARJO( XrSession session, uint64_t markerId, XrExtent2Df* size); XRAPI_ATTR XrResult XRAPI_CALL xrCreateMarkerSpaceVARJO( XrSession session, const XrMarkerSpaceCreateInfoVARJO* createInfo, XrSpace* space); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_MSFT_spatial_anchor_persistence 1 XR_DEFINE_HANDLE(XrSpatialAnchorStoreConnectionMSFT) #define XR_MAX_SPATIAL_ANCHOR_NAME_SIZE_MSFT 256 #define XR_MSFT_spatial_anchor_persistence_SPEC_VERSION 2 #define XR_MSFT_SPATIAL_ANCHOR_PERSISTENCE_EXTENSION_NAME "XR_MSFT_spatial_anchor_persistence" typedef struct XrSpatialAnchorPersistenceNameMSFT { char name[XR_MAX_SPATIAL_ANCHOR_NAME_SIZE_MSFT]; } XrSpatialAnchorPersistenceNameMSFT; typedef struct XrSpatialAnchorPersistenceInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; XrSpatialAnchorPersistenceNameMSFT spatialAnchorPersistenceName; XrSpatialAnchorMSFT spatialAnchor; } XrSpatialAnchorPersistenceInfoMSFT; typedef struct XrSpatialAnchorFromPersistedAnchorCreateInfoMSFT { XrStructureType type; const void* XR_MAY_ALIAS next; XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore; XrSpatialAnchorPersistenceNameMSFT spatialAnchorPersistenceName; } XrSpatialAnchorFromPersistedAnchorCreateInfoMSFT; typedef XrResult (XRAPI_PTR *PFN_xrCreateSpatialAnchorStoreConnectionMSFT)(XrSession session, XrSpatialAnchorStoreConnectionMSFT* spatialAnchorStore); typedef XrResult (XRAPI_PTR *PFN_xrDestroySpatialAnchorStoreConnectionMSFT)(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore); typedef XrResult (XRAPI_PTR *PFN_xrPersistSpatialAnchorMSFT)(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, const XrSpatialAnchorPersistenceInfoMSFT* spatialAnchorPersistenceInfo); typedef XrResult (XRAPI_PTR *PFN_xrEnumeratePersistedSpatialAnchorNamesMSFT)(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, uint32_t spatialAnchorNamesCapacityInput, uint32_t* spatialAnchorNamesCountOutput, XrSpatialAnchorPersistenceNameMSFT* persistedAnchorNames); typedef XrResult (XRAPI_PTR *PFN_xrCreateSpatialAnchorFromPersistedNameMSFT)(XrSession session, const XrSpatialAnchorFromPersistedAnchorCreateInfoMSFT* spatialAnchorCreateInfo, XrSpatialAnchorMSFT* spatialAnchor); typedef XrResult (XRAPI_PTR *PFN_xrUnpersistSpatialAnchorMSFT)(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, const XrSpatialAnchorPersistenceNameMSFT* spatialAnchorPersistenceName); typedef XrResult (XRAPI_PTR *PFN_xrClearSpatialAnchorStoreMSFT)(XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore); #ifndef XR_NO_PROTOTYPES #ifdef XR_EXTENSION_PROTOTYPES XRAPI_ATTR XrResult XRAPI_CALL xrCreateSpatialAnchorStoreConnectionMSFT( XrSession session, XrSpatialAnchorStoreConnectionMSFT* spatialAnchorStore); XRAPI_ATTR XrResult XRAPI_CALL xrDestroySpatialAnchorStoreConnectionMSFT( XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore); XRAPI_ATTR XrResult XRAPI_CALL xrPersistSpatialAnchorMSFT( XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, const XrSpatialAnchorPersistenceInfoMSFT* spatialAnchorPersistenceInfo); XRAPI_ATTR XrResult XRAPI_CALL xrEnumeratePersistedSpatialAnchorNamesMSFT( XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, uint32_t spatialAnchorNamesCapacityInput, uint32_t* spatialAnchorNamesCountOutput, XrSpatialAnchorPersistenceNameMSFT* persistedAnchorNames); XRAPI_ATTR XrResult XRAPI_CALL xrCreateSpatialAnchorFromPersistedNameMSFT( XrSession session, const XrSpatialAnchorFromPersistedAnchorCreateInfoMSFT* spatialAnchorCreateInfo, XrSpatialAnchorMSFT* spatialAnchor); XRAPI_ATTR XrResult XRAPI_CALL xrUnpersistSpatialAnchorMSFT( XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore, const XrSpatialAnchorPersistenceNameMSFT* spatialAnchorPersistenceName); XRAPI_ATTR XrResult XRAPI_CALL xrClearSpatialAnchorStoreMSFT( XrSpatialAnchorStoreConnectionMSFT spatialAnchorStore); #endif /* XR_EXTENSION_PROTOTYPES */ #endif /* !XR_NO_PROTOTYPES */ #define XR_FB_space_warp 1 #define XR_FB_space_warp_SPEC_VERSION 1 #define XR_FB_SPACE_WARP_EXTENSION_NAME "XR_FB_space_warp" typedef XrFlags64 XrCompositionLayerSpaceWarpInfoFlagsFB; // Flag bits for XrCompositionLayerSpaceWarpInfoFlagsFB // XrCompositionLayerSpaceWarpInfoFB extends XrCompositionLayerProjectionView typedef struct XrCompositionLayerSpaceWarpInfoFB { XrStructureType type; const void* XR_MAY_ALIAS next; XrCompositionLayerSpaceWarpInfoFlagsFB layerFlags; XrSwapchainSubImage motionVectorSubImage; XrPosef appSpaceDeltaPose; XrSwapchainSubImage depthSubImage; float minDepth; float maxDepth; float nearZ; float farZ; } XrCompositionLayerSpaceWarpInfoFB; // XrSystemSpaceWarpPropertiesFB extends XrSystemProperties typedef struct XrSystemSpaceWarpPropertiesFB { XrStructureType type; void* XR_MAY_ALIAS next; uint32_t recommendedMotionVectorImageRectWidth; uint32_t recommendedMotionVectorImageRectHeight; } XrSystemSpaceWarpPropertiesFB; #ifdef __cplusplus } #endif #endif
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/sources/thirdparty/openxr/include/openxr/openxr_reflection.h
#ifndef OPENXR_REFLECTION_H_ #define OPENXR_REFLECTION_H_ 1 /* ** Copyright (c) 2017-2021, The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 OR MIT */ /* ** This header is generated from the Khronos OpenXR XML API Registry. ** */ #include "openxr.h" /* This file contains expansion macros (X Macros) for OpenXR enumerations and structures. Example of how to use expansion macros to make an enum-to-string function: #define XR_ENUM_CASE_STR(name, val) case name: return #name; #define XR_ENUM_STR(enumType) \ constexpr const char* XrEnumStr(enumType e) { \ switch (e) { \ XR_LIST_ENUM_##enumType(XR_ENUM_CASE_STR) \ default: return "Unknown"; \ } \ } \ XR_ENUM_STR(XrResult); */ #define XR_LIST_ENUM_XrResult(_) \ _(XR_SUCCESS, 0) \ _(XR_TIMEOUT_EXPIRED, 1) \ _(XR_SESSION_LOSS_PENDING, 3) \ _(XR_EVENT_UNAVAILABLE, 4) \ _(XR_SPACE_BOUNDS_UNAVAILABLE, 7) \ _(XR_SESSION_NOT_FOCUSED, 8) \ _(XR_FRAME_DISCARDED, 9) \ _(XR_ERROR_VALIDATION_FAILURE, -1) \ _(XR_ERROR_RUNTIME_FAILURE, -2) \ _(XR_ERROR_OUT_OF_MEMORY, -3) \ _(XR_ERROR_API_VERSION_UNSUPPORTED, -4) \ _(XR_ERROR_INITIALIZATION_FAILED, -6) \ _(XR_ERROR_FUNCTION_UNSUPPORTED, -7) \ _(XR_ERROR_FEATURE_UNSUPPORTED, -8) \ _(XR_ERROR_EXTENSION_NOT_PRESENT, -9) \ _(XR_ERROR_LIMIT_REACHED, -10) \ _(XR_ERROR_SIZE_INSUFFICIENT, -11) \ _(XR_ERROR_HANDLE_INVALID, -12) \ _(XR_ERROR_INSTANCE_LOST, -13) \ _(XR_ERROR_SESSION_RUNNING, -14) \ _(XR_ERROR_SESSION_NOT_RUNNING, -16) \ _(XR_ERROR_SESSION_LOST, -17) \ _(XR_ERROR_SYSTEM_INVALID, -18) \ _(XR_ERROR_PATH_INVALID, -19) \ _(XR_ERROR_PATH_COUNT_EXCEEDED, -20) \ _(XR_ERROR_PATH_FORMAT_INVALID, -21) \ _(XR_ERROR_PATH_UNSUPPORTED, -22) \ _(XR_ERROR_LAYER_INVALID, -23) \ _(XR_ERROR_LAYER_LIMIT_EXCEEDED, -24) \ _(XR_ERROR_SWAPCHAIN_RECT_INVALID, -25) \ _(XR_ERROR_SWAPCHAIN_FORMAT_UNSUPPORTED, -26) \ _(XR_ERROR_ACTION_TYPE_MISMATCH, -27) \ _(XR_ERROR_SESSION_NOT_READY, -28) \ _(XR_ERROR_SESSION_NOT_STOPPING, -29) \ _(XR_ERROR_TIME_INVALID, -30) \ _(XR_ERROR_REFERENCE_SPACE_UNSUPPORTED, -31) \ _(XR_ERROR_FILE_ACCESS_ERROR, -32) \ _(XR_ERROR_FILE_CONTENTS_INVALID, -33) \ _(XR_ERROR_FORM_FACTOR_UNSUPPORTED, -34) \ _(XR_ERROR_FORM_FACTOR_UNAVAILABLE, -35) \ _(XR_ERROR_API_LAYER_NOT_PRESENT, -36) \ _(XR_ERROR_CALL_ORDER_INVALID, -37) \ _(XR_ERROR_GRAPHICS_DEVICE_INVALID, -38) \ _(XR_ERROR_POSE_INVALID, -39) \ _(XR_ERROR_INDEX_OUT_OF_RANGE, -40) \ _(XR_ERROR_VIEW_CONFIGURATION_TYPE_UNSUPPORTED, -41) \ _(XR_ERROR_ENVIRONMENT_BLEND_MODE_UNSUPPORTED, -42) \ _(XR_ERROR_NAME_DUPLICATED, -44) \ _(XR_ERROR_NAME_INVALID, -45) \ _(XR_ERROR_ACTIONSET_NOT_ATTACHED, -46) \ _(XR_ERROR_ACTIONSETS_ALREADY_ATTACHED, -47) \ _(XR_ERROR_LOCALIZED_NAME_DUPLICATED, -48) \ _(XR_ERROR_LOCALIZED_NAME_INVALID, -49) \ _(XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING, -50) \ _(XR_ERROR_RUNTIME_UNAVAILABLE, -51) \ _(XR_ERROR_ANDROID_THREAD_SETTINGS_ID_INVALID_KHR, -1000003000) \ _(XR_ERROR_ANDROID_THREAD_SETTINGS_FAILURE_KHR, -1000003001) \ _(XR_ERROR_CREATE_SPATIAL_ANCHOR_FAILED_MSFT, -1000039001) \ _(XR_ERROR_SECONDARY_VIEW_CONFIGURATION_TYPE_NOT_ENABLED_MSFT, -1000053000) \ _(XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT, -1000055000) \ _(XR_ERROR_REPROJECTION_MODE_UNSUPPORTED_MSFT, -1000066000) \ _(XR_ERROR_COMPUTE_NEW_SCENE_NOT_COMPLETED_MSFT, -1000097000) \ _(XR_ERROR_SCENE_COMPONENT_ID_INVALID_MSFT, -1000097001) \ _(XR_ERROR_SCENE_COMPONENT_TYPE_MISMATCH_MSFT, -1000097002) \ _(XR_ERROR_SCENE_MESH_BUFFER_ID_INVALID_MSFT, -1000097003) \ _(XR_ERROR_SCENE_COMPUTE_FEATURE_INCOMPATIBLE_MSFT, -1000097004) \ _(XR_ERROR_SCENE_COMPUTE_CONSISTENCY_MISMATCH_MSFT, -1000097005) \ _(XR_ERROR_DISPLAY_REFRESH_RATE_UNSUPPORTED_FB, -1000101000) \ _(XR_ERROR_COLOR_SPACE_UNSUPPORTED_FB, -1000108000) \ _(XR_ERROR_UNEXPECTED_STATE_PASSTHROUGH_FB, -1000118000) \ _(XR_ERROR_FEATURE_ALREADY_CREATED_PASSTHROUGH_FB, -1000118001) \ _(XR_ERROR_FEATURE_REQUIRED_PASSTHROUGH_FB, -1000118002) \ _(XR_ERROR_NOT_PERMITTED_PASSTHROUGH_FB, -1000118003) \ _(XR_ERROR_INSUFFICIENT_RESOURCES_PASSTHROUGH_FB, -1000118004) \ _(XR_ERROR_UNKNOWN_PASSTHROUGH_FB, -1000118050) \ _(XR_ERROR_MARKER_NOT_TRACKED_VARJO, -1000124000) \ _(XR_ERROR_MARKER_ID_INVALID_VARJO, -1000124001) \ _(XR_ERROR_SPATIAL_ANCHOR_NAME_NOT_FOUND_MSFT, -1000142001) \ _(XR_ERROR_SPATIAL_ANCHOR_NAME_INVALID_MSFT, -1000142002) \ _(XR_RESULT_MAX_ENUM, 0x7FFFFFFF) #define XR_LIST_ENUM_XrStructureType(_) \ _(XR_TYPE_UNKNOWN, 0) \ _(XR_TYPE_API_LAYER_PROPERTIES, 1) \ _(XR_TYPE_EXTENSION_PROPERTIES, 2) \ _(XR_TYPE_INSTANCE_CREATE_INFO, 3) \ _(XR_TYPE_SYSTEM_GET_INFO, 4) \ _(XR_TYPE_SYSTEM_PROPERTIES, 5) \ _(XR_TYPE_VIEW_LOCATE_INFO, 6) \ _(XR_TYPE_VIEW, 7) \ _(XR_TYPE_SESSION_CREATE_INFO, 8) \ _(XR_TYPE_SWAPCHAIN_CREATE_INFO, 9) \ _(XR_TYPE_SESSION_BEGIN_INFO, 10) \ _(XR_TYPE_VIEW_STATE, 11) \ _(XR_TYPE_FRAME_END_INFO, 12) \ _(XR_TYPE_HAPTIC_VIBRATION, 13) \ _(XR_TYPE_EVENT_DATA_BUFFER, 16) \ _(XR_TYPE_EVENT_DATA_INSTANCE_LOSS_PENDING, 17) \ _(XR_TYPE_EVENT_DATA_SESSION_STATE_CHANGED, 18) \ _(XR_TYPE_ACTION_STATE_BOOLEAN, 23) \ _(XR_TYPE_ACTION_STATE_FLOAT, 24) \ _(XR_TYPE_ACTION_STATE_VECTOR2F, 25) \ _(XR_TYPE_ACTION_STATE_POSE, 27) \ _(XR_TYPE_ACTION_SET_CREATE_INFO, 28) \ _(XR_TYPE_ACTION_CREATE_INFO, 29) \ _(XR_TYPE_INSTANCE_PROPERTIES, 32) \ _(XR_TYPE_FRAME_WAIT_INFO, 33) \ _(XR_TYPE_COMPOSITION_LAYER_PROJECTION, 35) \ _(XR_TYPE_COMPOSITION_LAYER_QUAD, 36) \ _(XR_TYPE_REFERENCE_SPACE_CREATE_INFO, 37) \ _(XR_TYPE_ACTION_SPACE_CREATE_INFO, 38) \ _(XR_TYPE_EVENT_DATA_REFERENCE_SPACE_CHANGE_PENDING, 40) \ _(XR_TYPE_VIEW_CONFIGURATION_VIEW, 41) \ _(XR_TYPE_SPACE_LOCATION, 42) \ _(XR_TYPE_SPACE_VELOCITY, 43) \ _(XR_TYPE_FRAME_STATE, 44) \ _(XR_TYPE_VIEW_CONFIGURATION_PROPERTIES, 45) \ _(XR_TYPE_FRAME_BEGIN_INFO, 46) \ _(XR_TYPE_COMPOSITION_LAYER_PROJECTION_VIEW, 48) \ _(XR_TYPE_EVENT_DATA_EVENTS_LOST, 49) \ _(XR_TYPE_INTERACTION_PROFILE_SUGGESTED_BINDING, 51) \ _(XR_TYPE_EVENT_DATA_INTERACTION_PROFILE_CHANGED, 52) \ _(XR_TYPE_INTERACTION_PROFILE_STATE, 53) \ _(XR_TYPE_SWAPCHAIN_IMAGE_ACQUIRE_INFO, 55) \ _(XR_TYPE_SWAPCHAIN_IMAGE_WAIT_INFO, 56) \ _(XR_TYPE_SWAPCHAIN_IMAGE_RELEASE_INFO, 57) \ _(XR_TYPE_ACTION_STATE_GET_INFO, 58) \ _(XR_TYPE_HAPTIC_ACTION_INFO, 59) \ _(XR_TYPE_SESSION_ACTION_SETS_ATTACH_INFO, 60) \ _(XR_TYPE_ACTIONS_SYNC_INFO, 61) \ _(XR_TYPE_BOUND_SOURCES_FOR_ACTION_ENUMERATE_INFO, 62) \ _(XR_TYPE_INPUT_SOURCE_LOCALIZED_NAME_GET_INFO, 63) \ _(XR_TYPE_COMPOSITION_LAYER_CUBE_KHR, 1000006000) \ _(XR_TYPE_INSTANCE_CREATE_INFO_ANDROID_KHR, 1000008000) \ _(XR_TYPE_COMPOSITION_LAYER_DEPTH_INFO_KHR, 1000010000) \ _(XR_TYPE_VULKAN_SWAPCHAIN_FORMAT_LIST_CREATE_INFO_KHR, 1000014000) \ _(XR_TYPE_EVENT_DATA_PERF_SETTINGS_EXT, 1000015000) \ _(XR_TYPE_COMPOSITION_LAYER_CYLINDER_KHR, 1000017000) \ _(XR_TYPE_COMPOSITION_LAYER_EQUIRECT_KHR, 1000018000) \ _(XR_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT, 1000019000) \ _(XR_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT, 1000019001) \ _(XR_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT, 1000019002) \ _(XR_TYPE_DEBUG_UTILS_LABEL_EXT, 1000019003) \ _(XR_TYPE_GRAPHICS_BINDING_OPENGL_WIN32_KHR, 1000023000) \ _(XR_TYPE_GRAPHICS_BINDING_OPENGL_XLIB_KHR, 1000023001) \ _(XR_TYPE_GRAPHICS_BINDING_OPENGL_XCB_KHR, 1000023002) \ _(XR_TYPE_GRAPHICS_BINDING_OPENGL_WAYLAND_KHR, 1000023003) \ _(XR_TYPE_SWAPCHAIN_IMAGE_OPENGL_KHR, 1000023004) \ _(XR_TYPE_GRAPHICS_REQUIREMENTS_OPENGL_KHR, 1000023005) \ _(XR_TYPE_GRAPHICS_BINDING_OPENGL_ES_ANDROID_KHR, 1000024001) \ _(XR_TYPE_SWAPCHAIN_IMAGE_OPENGL_ES_KHR, 1000024002) \ _(XR_TYPE_GRAPHICS_REQUIREMENTS_OPENGL_ES_KHR, 1000024003) \ _(XR_TYPE_GRAPHICS_BINDING_VULKAN_KHR, 1000025000) \ _(XR_TYPE_SWAPCHAIN_IMAGE_VULKAN_KHR, 1000025001) \ _(XR_TYPE_GRAPHICS_REQUIREMENTS_VULKAN_KHR, 1000025002) \ _(XR_TYPE_GRAPHICS_BINDING_D3D11_KHR, 1000027000) \ _(XR_TYPE_SWAPCHAIN_IMAGE_D3D11_KHR, 1000027001) \ _(XR_TYPE_GRAPHICS_REQUIREMENTS_D3D11_KHR, 1000027002) \ _(XR_TYPE_GRAPHICS_BINDING_D3D12_KHR, 1000028000) \ _(XR_TYPE_SWAPCHAIN_IMAGE_D3D12_KHR, 1000028001) \ _(XR_TYPE_GRAPHICS_REQUIREMENTS_D3D12_KHR, 1000028002) \ _(XR_TYPE_SYSTEM_EYE_GAZE_INTERACTION_PROPERTIES_EXT, 1000030000) \ _(XR_TYPE_EYE_GAZE_SAMPLE_TIME_EXT, 1000030001) \ _(XR_TYPE_VISIBILITY_MASK_KHR, 1000031000) \ _(XR_TYPE_EVENT_DATA_VISIBILITY_MASK_CHANGED_KHR, 1000031001) \ _(XR_TYPE_SESSION_CREATE_INFO_OVERLAY_EXTX, 1000033000) \ _(XR_TYPE_EVENT_DATA_MAIN_SESSION_VISIBILITY_CHANGED_EXTX, 1000033003) \ _(XR_TYPE_COMPOSITION_LAYER_COLOR_SCALE_BIAS_KHR, 1000034000) \ _(XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_MSFT, 1000039000) \ _(XR_TYPE_SPATIAL_ANCHOR_SPACE_CREATE_INFO_MSFT, 1000039001) \ _(XR_TYPE_COMPOSITION_LAYER_IMAGE_LAYOUT_FB, 1000040000) \ _(XR_TYPE_COMPOSITION_LAYER_ALPHA_BLEND_FB, 1000041001) \ _(XR_TYPE_VIEW_CONFIGURATION_DEPTH_RANGE_EXT, 1000046000) \ _(XR_TYPE_GRAPHICS_BINDING_EGL_MNDX, 1000048004) \ _(XR_TYPE_SPATIAL_GRAPH_NODE_SPACE_CREATE_INFO_MSFT, 1000049000) \ _(XR_TYPE_SYSTEM_HAND_TRACKING_PROPERTIES_EXT, 1000051000) \ _(XR_TYPE_HAND_TRACKER_CREATE_INFO_EXT, 1000051001) \ _(XR_TYPE_HAND_JOINTS_LOCATE_INFO_EXT, 1000051002) \ _(XR_TYPE_HAND_JOINT_LOCATIONS_EXT, 1000051003) \ _(XR_TYPE_HAND_JOINT_VELOCITIES_EXT, 1000051004) \ _(XR_TYPE_SYSTEM_HAND_TRACKING_MESH_PROPERTIES_MSFT, 1000052000) \ _(XR_TYPE_HAND_MESH_SPACE_CREATE_INFO_MSFT, 1000052001) \ _(XR_TYPE_HAND_MESH_UPDATE_INFO_MSFT, 1000052002) \ _(XR_TYPE_HAND_MESH_MSFT, 1000052003) \ _(XR_TYPE_HAND_POSE_TYPE_INFO_MSFT, 1000052004) \ _(XR_TYPE_SECONDARY_VIEW_CONFIGURATION_SESSION_BEGIN_INFO_MSFT, 1000053000) \ _(XR_TYPE_SECONDARY_VIEW_CONFIGURATION_STATE_MSFT, 1000053001) \ _(XR_TYPE_SECONDARY_VIEW_CONFIGURATION_FRAME_STATE_MSFT, 1000053002) \ _(XR_TYPE_SECONDARY_VIEW_CONFIGURATION_FRAME_END_INFO_MSFT, 1000053003) \ _(XR_TYPE_SECONDARY_VIEW_CONFIGURATION_LAYER_INFO_MSFT, 1000053004) \ _(XR_TYPE_SECONDARY_VIEW_CONFIGURATION_SWAPCHAIN_CREATE_INFO_MSFT, 1000053005) \ _(XR_TYPE_CONTROLLER_MODEL_KEY_STATE_MSFT, 1000055000) \ _(XR_TYPE_CONTROLLER_MODEL_NODE_PROPERTIES_MSFT, 1000055001) \ _(XR_TYPE_CONTROLLER_MODEL_PROPERTIES_MSFT, 1000055002) \ _(XR_TYPE_CONTROLLER_MODEL_NODE_STATE_MSFT, 1000055003) \ _(XR_TYPE_CONTROLLER_MODEL_STATE_MSFT, 1000055004) \ _(XR_TYPE_VIEW_CONFIGURATION_VIEW_FOV_EPIC, 1000059000) \ _(XR_TYPE_HOLOGRAPHIC_WINDOW_ATTACHMENT_MSFT, 1000063000) \ _(XR_TYPE_COMPOSITION_LAYER_REPROJECTION_INFO_MSFT, 1000066000) \ _(XR_TYPE_COMPOSITION_LAYER_REPROJECTION_PLANE_OVERRIDE_MSFT, 1000066001) \ _(XR_TYPE_ANDROID_SURFACE_SWAPCHAIN_CREATE_INFO_FB, 1000070000) \ _(XR_TYPE_COMPOSITION_LAYER_SECURE_CONTENT_FB, 1000072000) \ _(XR_TYPE_INTERACTION_PROFILE_ANALOG_THRESHOLD_VALVE, 1000079000) \ _(XR_TYPE_HAND_JOINTS_MOTION_RANGE_INFO_EXT, 1000080000) \ _(XR_TYPE_LOADER_INIT_INFO_ANDROID_KHR, 1000089000) \ _(XR_TYPE_VULKAN_INSTANCE_CREATE_INFO_KHR, 1000090000) \ _(XR_TYPE_VULKAN_DEVICE_CREATE_INFO_KHR, 1000090001) \ _(XR_TYPE_VULKAN_GRAPHICS_DEVICE_GET_INFO_KHR, 1000090003) \ _(XR_TYPE_COMPOSITION_LAYER_EQUIRECT2_KHR, 1000091000) \ _(XR_TYPE_SCENE_OBSERVER_CREATE_INFO_MSFT, 1000097000) \ _(XR_TYPE_SCENE_CREATE_INFO_MSFT, 1000097001) \ _(XR_TYPE_NEW_SCENE_COMPUTE_INFO_MSFT, 1000097002) \ _(XR_TYPE_VISUAL_MESH_COMPUTE_LOD_INFO_MSFT, 1000097003) \ _(XR_TYPE_SCENE_COMPONENTS_MSFT, 1000097004) \ _(XR_TYPE_SCENE_COMPONENTS_GET_INFO_MSFT, 1000097005) \ _(XR_TYPE_SCENE_COMPONENT_LOCATIONS_MSFT, 1000097006) \ _(XR_TYPE_SCENE_COMPONENTS_LOCATE_INFO_MSFT, 1000097007) \ _(XR_TYPE_SCENE_OBJECTS_MSFT, 1000097008) \ _(XR_TYPE_SCENE_COMPONENT_PARENT_FILTER_INFO_MSFT, 1000097009) \ _(XR_TYPE_SCENE_OBJECT_TYPES_FILTER_INFO_MSFT, 1000097010) \ _(XR_TYPE_SCENE_PLANES_MSFT, 1000097011) \ _(XR_TYPE_SCENE_PLANE_ALIGNMENT_FILTER_INFO_MSFT, 1000097012) \ _(XR_TYPE_SCENE_MESHES_MSFT, 1000097013) \ _(XR_TYPE_SCENE_MESH_BUFFERS_GET_INFO_MSFT, 1000097014) \ _(XR_TYPE_SCENE_MESH_BUFFERS_MSFT, 1000097015) \ _(XR_TYPE_SCENE_MESH_VERTEX_BUFFER_MSFT, 1000097016) \ _(XR_TYPE_SCENE_MESH_INDICES_UINT32_MSFT, 1000097017) \ _(XR_TYPE_SCENE_MESH_INDICES_UINT16_MSFT, 1000097018) \ _(XR_TYPE_SERIALIZED_SCENE_FRAGMENT_DATA_GET_INFO_MSFT, 1000098000) \ _(XR_TYPE_SCENE_DESERIALIZE_INFO_MSFT, 1000098001) \ _(XR_TYPE_EVENT_DATA_DISPLAY_REFRESH_RATE_CHANGED_FB, 1000101000) \ _(XR_TYPE_VIVE_TRACKER_PATHS_HTCX, 1000103000) \ _(XR_TYPE_EVENT_DATA_VIVE_TRACKER_CONNECTED_HTCX, 1000103001) \ _(XR_TYPE_SYSTEM_COLOR_SPACE_PROPERTIES_FB, 1000108000) \ _(XR_TYPE_HAND_TRACKING_MESH_FB, 1000110001) \ _(XR_TYPE_HAND_TRACKING_SCALE_FB, 1000110003) \ _(XR_TYPE_HAND_TRACKING_AIM_STATE_FB, 1000111001) \ _(XR_TYPE_HAND_TRACKING_CAPSULES_STATE_FB, 1000112000) \ _(XR_TYPE_FOVEATION_PROFILE_CREATE_INFO_FB, 1000114000) \ _(XR_TYPE_SWAPCHAIN_CREATE_INFO_FOVEATION_FB, 1000114001) \ _(XR_TYPE_SWAPCHAIN_STATE_FOVEATION_FB, 1000114002) \ _(XR_TYPE_FOVEATION_LEVEL_PROFILE_CREATE_INFO_FB, 1000115000) \ _(XR_TYPE_TRIANGLE_MESH_CREATE_INFO_FB, 1000117001) \ _(XR_TYPE_SYSTEM_PASSTHROUGH_PROPERTIES_FB, 1000118000) \ _(XR_TYPE_PASSTHROUGH_CREATE_INFO_FB, 1000118001) \ _(XR_TYPE_PASSTHROUGH_LAYER_CREATE_INFO_FB, 1000118002) \ _(XR_TYPE_COMPOSITION_LAYER_PASSTHROUGH_FB, 1000118003) \ _(XR_TYPE_GEOMETRY_INSTANCE_CREATE_INFO_FB, 1000118004) \ _(XR_TYPE_GEOMETRY_INSTANCE_TRANSFORM_FB, 1000118005) \ _(XR_TYPE_PASSTHROUGH_STYLE_FB, 1000118020) \ _(XR_TYPE_PASSTHROUGH_COLOR_MAP_MONO_TO_RGBA_FB, 1000118021) \ _(XR_TYPE_PASSTHROUGH_COLOR_MAP_MONO_TO_MONO_FB, 1000118022) \ _(XR_TYPE_EVENT_DATA_PASSTHROUGH_STATE_CHANGED_FB, 1000118030) \ _(XR_TYPE_BINDING_MODIFICATIONS_KHR, 1000120000) \ _(XR_TYPE_VIEW_LOCATE_FOVEATED_RENDERING_VARJO, 1000121000) \ _(XR_TYPE_FOVEATED_VIEW_CONFIGURATION_VIEW_VARJO, 1000121001) \ _(XR_TYPE_SYSTEM_FOVEATED_RENDERING_PROPERTIES_VARJO, 1000121002) \ _(XR_TYPE_COMPOSITION_LAYER_DEPTH_TEST_VARJO, 1000122000) \ _(XR_TYPE_SYSTEM_MARKER_TRACKING_PROPERTIES_VARJO, 1000124000) \ _(XR_TYPE_EVENT_DATA_MARKER_TRACKING_UPDATE_VARJO, 1000124001) \ _(XR_TYPE_MARKER_SPACE_CREATE_INFO_VARJO, 1000124002) \ _(XR_TYPE_SPATIAL_ANCHOR_PERSISTENCE_INFO_MSFT, 1000142000) \ _(XR_TYPE_SPATIAL_ANCHOR_FROM_PERSISTED_ANCHOR_CREATE_INFO_MSFT, 1000142001) \ _(XR_TYPE_SWAPCHAIN_IMAGE_FOVEATION_VULKAN_FB, 1000160000) \ _(XR_TYPE_SWAPCHAIN_STATE_ANDROID_SURFACE_DIMENSIONS_FB, 1000161000) \ _(XR_TYPE_SWAPCHAIN_STATE_SAMPLER_OPENGL_ES_FB, 1000162000) \ _(XR_TYPE_SWAPCHAIN_STATE_SAMPLER_VULKAN_FB, 1000163000) \ _(XR_TYPE_COMPOSITION_LAYER_SPACE_WARP_INFO_FB, 1000171000) \ _(XR_TYPE_SYSTEM_SPACE_WARP_PROPERTIES_FB, 1000171001) \ _(XR_STRUCTURE_TYPE_MAX_ENUM, 0x7FFFFFFF) #define XR_LIST_ENUM_XrFormFactor(_) \ _(XR_FORM_FACTOR_HEAD_MOUNTED_DISPLAY, 1) \ _(XR_FORM_FACTOR_HANDHELD_DISPLAY, 2) \ _(XR_FORM_FACTOR_MAX_ENUM, 0x7FFFFFFF) #define XR_LIST_ENUM_XrViewConfigurationType(_) \ _(XR_VIEW_CONFIGURATION_TYPE_PRIMARY_MONO, 1) \ _(XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO, 2) \ _(XR_VIEW_CONFIGURATION_TYPE_PRIMARY_QUAD_VARJO, 1000037000) \ _(XR_VIEW_CONFIGURATION_TYPE_SECONDARY_MONO_FIRST_PERSON_OBSERVER_MSFT, 1000054000) \ _(XR_VIEW_CONFIGURATION_TYPE_MAX_ENUM, 0x7FFFFFFF) #define XR_LIST_ENUM_XrEnvironmentBlendMode(_) \ _(XR_ENVIRONMENT_BLEND_MODE_OPAQUE, 1) \ _(XR_ENVIRONMENT_BLEND_MODE_ADDITIVE, 2) \ _(XR_ENVIRONMENT_BLEND_MODE_ALPHA_BLEND, 3) \ _(XR_ENVIRONMENT_BLEND_MODE_MAX_ENUM, 0x7FFFFFFF) #define XR_LIST_ENUM_XrReferenceSpaceType(_) \ _(XR_REFERENCE_SPACE_TYPE_VIEW, 1) \ _(XR_REFERENCE_SPACE_TYPE_LOCAL, 2) \ _(XR_REFERENCE_SPACE_TYPE_STAGE, 3) \ _(XR_REFERENCE_SPACE_TYPE_UNBOUNDED_MSFT, 1000038000) \ _(XR_REFERENCE_SPACE_TYPE_COMBINED_EYE_VARJO, 1000121000) \ _(XR_REFERENCE_SPACE_TYPE_MAX_ENUM, 0x7FFFFFFF) #define XR_LIST_ENUM_XrActionType(_) \ _(XR_ACTION_TYPE_BOOLEAN_INPUT, 1) \ _(XR_ACTION_TYPE_FLOAT_INPUT, 2) \ _(XR_ACTION_TYPE_VECTOR2F_INPUT, 3) \ _(XR_ACTION_TYPE_POSE_INPUT, 4) \ _(XR_ACTION_TYPE_VIBRATION_OUTPUT, 100) \ _(XR_ACTION_TYPE_MAX_ENUM, 0x7FFFFFFF) #define XR_LIST_ENUM_XrEyeVisibility(_) \ _(XR_EYE_VISIBILITY_BOTH, 0) \ _(XR_EYE_VISIBILITY_LEFT, 1) \ _(XR_EYE_VISIBILITY_RIGHT, 2) \ _(XR_EYE_VISIBILITY_MAX_ENUM, 0x7FFFFFFF) #define XR_LIST_ENUM_XrSessionState(_) \ _(XR_SESSION_STATE_UNKNOWN, 0) \ _(XR_SESSION_STATE_IDLE, 1) \ _(XR_SESSION_STATE_READY, 2) \ _(XR_SESSION_STATE_SYNCHRONIZED, 3) \ _(XR_SESSION_STATE_VISIBLE, 4) \ _(XR_SESSION_STATE_FOCUSED, 5) \ _(XR_SESSION_STATE_STOPPING, 6) \ _(XR_SESSION_STATE_LOSS_PENDING, 7) \ _(XR_SESSION_STATE_EXITING, 8) \ _(XR_SESSION_STATE_MAX_ENUM, 0x7FFFFFFF) #define XR_LIST_ENUM_XrObjectType(_) \ _(XR_OBJECT_TYPE_UNKNOWN, 0) \ _(XR_OBJECT_TYPE_INSTANCE, 1) \ _(XR_OBJECT_TYPE_SESSION, 2) \ _(XR_OBJECT_TYPE_SWAPCHAIN, 3) \ _(XR_OBJECT_TYPE_SPACE, 4) \ _(XR_OBJECT_TYPE_ACTION_SET, 5) \ _(XR_OBJECT_TYPE_ACTION, 6) \ _(XR_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT, 1000019000) \ _(XR_OBJECT_TYPE_SPATIAL_ANCHOR_MSFT, 1000039000) \ _(XR_OBJECT_TYPE_HAND_TRACKER_EXT, 1000051000) \ _(XR_OBJECT_TYPE_SCENE_OBSERVER_MSFT, 1000097000) \ _(XR_OBJECT_TYPE_SCENE_MSFT, 1000097001) \ _(XR_OBJECT_TYPE_FOVEATION_PROFILE_FB, 1000114000) \ _(XR_OBJECT_TYPE_TRIANGLE_MESH_FB, 1000117000) \ _(XR_OBJECT_TYPE_PASSTHROUGH_FB, 1000118000) \ _(XR_OBJECT_TYPE_PASSTHROUGH_LAYER_FB, 1000118002) \ _(XR_OBJECT_TYPE_GEOMETRY_INSTANCE_FB, 1000118004) \ _(XR_OBJECT_TYPE_SPATIAL_ANCHOR_STORE_CONNECTION_MSFT, 1000142000) \ _(XR_OBJECT_TYPE_MAX_ENUM, 0x7FFFFFFF) #define XR_LIST_ENUM_XrAndroidThreadTypeKHR(_) \ _(XR_ANDROID_THREAD_TYPE_APPLICATION_MAIN_KHR, 1) \ _(XR_ANDROID_THREAD_TYPE_APPLICATION_WORKER_KHR, 2) \ _(XR_ANDROID_THREAD_TYPE_RENDERER_MAIN_KHR, 3) \ _(XR_ANDROID_THREAD_TYPE_RENDERER_WORKER_KHR, 4) \ _(XR_ANDROID_THREAD_TYPE_MAX_ENUM_KHR, 0x7FFFFFFF) #define XR_LIST_ENUM_XrVisibilityMaskTypeKHR(_) \ _(XR_VISIBILITY_MASK_TYPE_HIDDEN_TRIANGLE_MESH_KHR, 1) \ _(XR_VISIBILITY_MASK_TYPE_VISIBLE_TRIANGLE_MESH_KHR, 2) \ _(XR_VISIBILITY_MASK_TYPE_LINE_LOOP_KHR, 3) \ _(XR_VISIBILITY_MASK_TYPE_MAX_ENUM_KHR, 0x7FFFFFFF) #define XR_LIST_ENUM_XrPerfSettingsDomainEXT(_) \ _(XR_PERF_SETTINGS_DOMAIN_CPU_EXT, 1) \ _(XR_PERF_SETTINGS_DOMAIN_GPU_EXT, 2) \ _(XR_PERF_SETTINGS_DOMAIN_MAX_ENUM_EXT, 0x7FFFFFFF) #define XR_LIST_ENUM_XrPerfSettingsSubDomainEXT(_) \ _(XR_PERF_SETTINGS_SUB_DOMAIN_COMPOSITING_EXT, 1) \ _(XR_PERF_SETTINGS_SUB_DOMAIN_RENDERING_EXT, 2) \ _(XR_PERF_SETTINGS_SUB_DOMAIN_THERMAL_EXT, 3) \ _(XR_PERF_SETTINGS_SUB_DOMAIN_MAX_ENUM_EXT, 0x7FFFFFFF) #define XR_LIST_ENUM_XrPerfSettingsLevelEXT(_) \ _(XR_PERF_SETTINGS_LEVEL_POWER_SAVINGS_EXT, 0) \ _(XR_PERF_SETTINGS_LEVEL_SUSTAINED_LOW_EXT, 25) \ _(XR_PERF_SETTINGS_LEVEL_SUSTAINED_HIGH_EXT, 50) \ _(XR_PERF_SETTINGS_LEVEL_BOOST_EXT, 75) \ _(XR_PERF_SETTINGS_LEVEL_MAX_ENUM_EXT, 0x7FFFFFFF) #define XR_LIST_ENUM_XrPerfSettingsNotificationLevelEXT(_) \ _(XR_PERF_SETTINGS_NOTIF_LEVEL_NORMAL_EXT, 0) \ _(XR_PERF_SETTINGS_NOTIF_LEVEL_WARNING_EXT, 25) \ _(XR_PERF_SETTINGS_NOTIF_LEVEL_IMPAIRED_EXT, 75) \ _(XR_PERF_SETTINGS_NOTIFICATION_LEVEL_MAX_ENUM_EXT, 0x7FFFFFFF) #define XR_LIST_ENUM_XrBlendFactorFB(_) \ _(XR_BLEND_FACTOR_ZERO_FB, 0) \ _(XR_BLEND_FACTOR_ONE_FB, 1) \ _(XR_BLEND_FACTOR_SRC_ALPHA_FB, 2) \ _(XR_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA_FB, 3) \ _(XR_BLEND_FACTOR_DST_ALPHA_FB, 4) \ _(XR_BLEND_FACTOR_ONE_MINUS_DST_ALPHA_FB, 5) \ _(XR_BLEND_FACTOR_MAX_ENUM_FB, 0x7FFFFFFF) #define XR_LIST_ENUM_XrSpatialGraphNodeTypeMSFT(_) \ _(XR_SPATIAL_GRAPH_NODE_TYPE_STATIC_MSFT, 1) \ _(XR_SPATIAL_GRAPH_NODE_TYPE_DYNAMIC_MSFT, 2) \ _(XR_SPATIAL_GRAPH_NODE_TYPE_MAX_ENUM_MSFT, 0x7FFFFFFF) #define XR_LIST_ENUM_XrHandEXT(_) \ _(XR_HAND_LEFT_EXT, 1) \ _(XR_HAND_RIGHT_EXT, 2) \ _(XR_HAND_MAX_ENUM_EXT, 0x7FFFFFFF) #define XR_LIST_ENUM_XrHandJointEXT(_) \ _(XR_HAND_JOINT_PALM_EXT, 0) \ _(XR_HAND_JOINT_WRIST_EXT, 1) \ _(XR_HAND_JOINT_THUMB_METACARPAL_EXT, 2) \ _(XR_HAND_JOINT_THUMB_PROXIMAL_EXT, 3) \ _(XR_HAND_JOINT_THUMB_DISTAL_EXT, 4) \ _(XR_HAND_JOINT_THUMB_TIP_EXT, 5) \ _(XR_HAND_JOINT_INDEX_METACARPAL_EXT, 6) \ _(XR_HAND_JOINT_INDEX_PROXIMAL_EXT, 7) \ _(XR_HAND_JOINT_INDEX_INTERMEDIATE_EXT, 8) \ _(XR_HAND_JOINT_INDEX_DISTAL_EXT, 9) \ _(XR_HAND_JOINT_INDEX_TIP_EXT, 10) \ _(XR_HAND_JOINT_MIDDLE_METACARPAL_EXT, 11) \ _(XR_HAND_JOINT_MIDDLE_PROXIMAL_EXT, 12) \ _(XR_HAND_JOINT_MIDDLE_INTERMEDIATE_EXT, 13) \ _(XR_HAND_JOINT_MIDDLE_DISTAL_EXT, 14) \ _(XR_HAND_JOINT_MIDDLE_TIP_EXT, 15) \ _(XR_HAND_JOINT_RING_METACARPAL_EXT, 16) \ _(XR_HAND_JOINT_RING_PROXIMAL_EXT, 17) \ _(XR_HAND_JOINT_RING_INTERMEDIATE_EXT, 18) \ _(XR_HAND_JOINT_RING_DISTAL_EXT, 19) \ _(XR_HAND_JOINT_RING_TIP_EXT, 20) \ _(XR_HAND_JOINT_LITTLE_METACARPAL_EXT, 21) \ _(XR_HAND_JOINT_LITTLE_PROXIMAL_EXT, 22) \ _(XR_HAND_JOINT_LITTLE_INTERMEDIATE_EXT, 23) \ _(XR_HAND_JOINT_LITTLE_DISTAL_EXT, 24) \ _(XR_HAND_JOINT_LITTLE_TIP_EXT, 25) \ _(XR_HAND_JOINT_MAX_ENUM_EXT, 0x7FFFFFFF) #define XR_LIST_ENUM_XrHandJointSetEXT(_) \ _(XR_HAND_JOINT_SET_DEFAULT_EXT, 0) \ _(XR_HAND_JOINT_SET_MAX_ENUM_EXT, 0x7FFFFFFF) #define XR_LIST_ENUM_XrHandPoseTypeMSFT(_) \ _(XR_HAND_POSE_TYPE_TRACKED_MSFT, 0) \ _(XR_HAND_POSE_TYPE_REFERENCE_OPEN_PALM_MSFT, 1) \ _(XR_HAND_POSE_TYPE_MAX_ENUM_MSFT, 0x7FFFFFFF) #define XR_LIST_ENUM_XrReprojectionModeMSFT(_) \ _(XR_REPROJECTION_MODE_DEPTH_MSFT, 1) \ _(XR_REPROJECTION_MODE_PLANAR_FROM_DEPTH_MSFT, 2) \ _(XR_REPROJECTION_MODE_PLANAR_MANUAL_MSFT, 3) \ _(XR_REPROJECTION_MODE_ORIENTATION_ONLY_MSFT, 4) \ _(XR_REPROJECTION_MODE_MAX_ENUM_MSFT, 0x7FFFFFFF) #define XR_LIST_ENUM_XrHandJointsMotionRangeEXT(_) \ _(XR_HAND_JOINTS_MOTION_RANGE_UNOBSTRUCTED_EXT, 1) \ _(XR_HAND_JOINTS_MOTION_RANGE_CONFORMING_TO_CONTROLLER_EXT, 2) \ _(XR_HAND_JOINTS_MOTION_RANGE_MAX_ENUM_EXT, 0x7FFFFFFF) #define XR_LIST_ENUM_XrSceneComputeFeatureMSFT(_) \ _(XR_SCENE_COMPUTE_FEATURE_PLANE_MSFT, 1) \ _(XR_SCENE_COMPUTE_FEATURE_PLANE_MESH_MSFT, 2) \ _(XR_SCENE_COMPUTE_FEATURE_VISUAL_MESH_MSFT, 3) \ _(XR_SCENE_COMPUTE_FEATURE_COLLIDER_MESH_MSFT, 4) \ _(XR_SCENE_COMPUTE_FEATURE_SERIALIZE_SCENE_MSFT, 1000098000) \ _(XR_SCENE_COMPUTE_FEATURE_MAX_ENUM_MSFT, 0x7FFFFFFF) #define XR_LIST_ENUM_XrSceneComputeConsistencyMSFT(_) \ _(XR_SCENE_COMPUTE_CONSISTENCY_SNAPSHOT_COMPLETE_MSFT, 1) \ _(XR_SCENE_COMPUTE_CONSISTENCY_SNAPSHOT_INCOMPLETE_FAST_MSFT, 2) \ _(XR_SCENE_COMPUTE_CONSISTENCY_OCCLUSION_OPTIMIZED_MSFT, 3) \ _(XR_SCENE_COMPUTE_CONSISTENCY_MAX_ENUM_MSFT, 0x7FFFFFFF) #define XR_LIST_ENUM_XrMeshComputeLodMSFT(_) \ _(XR_MESH_COMPUTE_LOD_COARSE_MSFT, 1) \ _(XR_MESH_COMPUTE_LOD_MEDIUM_MSFT, 2) \ _(XR_MESH_COMPUTE_LOD_FINE_MSFT, 3) \ _(XR_MESH_COMPUTE_LOD_UNLIMITED_MSFT, 4) \ _(XR_MESH_COMPUTE_LOD_MAX_ENUM_MSFT, 0x7FFFFFFF) #define XR_LIST_ENUM_XrSceneComponentTypeMSFT(_) \ _(XR_SCENE_COMPONENT_TYPE_INVALID_MSFT, -1) \ _(XR_SCENE_COMPONENT_TYPE_OBJECT_MSFT, 1) \ _(XR_SCENE_COMPONENT_TYPE_PLANE_MSFT, 2) \ _(XR_SCENE_COMPONENT_TYPE_VISUAL_MESH_MSFT, 3) \ _(XR_SCENE_COMPONENT_TYPE_COLLIDER_MESH_MSFT, 4) \ _(XR_SCENE_COMPONENT_TYPE_SERIALIZED_SCENE_FRAGMENT_MSFT, 1000098000) \ _(XR_SCENE_COMPONENT_TYPE_MAX_ENUM_MSFT, 0x7FFFFFFF) #define XR_LIST_ENUM_XrSceneObjectTypeMSFT(_) \ _(XR_SCENE_OBJECT_TYPE_UNCATEGORIZED_MSFT, -1) \ _(XR_SCENE_OBJECT_TYPE_BACKGROUND_MSFT, 1) \ _(XR_SCENE_OBJECT_TYPE_WALL_MSFT, 2) \ _(XR_SCENE_OBJECT_TYPE_FLOOR_MSFT, 3) \ _(XR_SCENE_OBJECT_TYPE_CEILING_MSFT, 4) \ _(XR_SCENE_OBJECT_TYPE_PLATFORM_MSFT, 5) \ _(XR_SCENE_OBJECT_TYPE_INFERRED_MSFT, 6) \ _(XR_SCENE_OBJECT_TYPE_MAX_ENUM_MSFT, 0x7FFFFFFF) #define XR_LIST_ENUM_XrScenePlaneAlignmentTypeMSFT(_) \ _(XR_SCENE_PLANE_ALIGNMENT_TYPE_NON_ORTHOGONAL_MSFT, 0) \ _(XR_SCENE_PLANE_ALIGNMENT_TYPE_HORIZONTAL_MSFT, 1) \ _(XR_SCENE_PLANE_ALIGNMENT_TYPE_VERTICAL_MSFT, 2) \ _(XR_SCENE_PLANE_ALIGNMENT_TYPE_MAX_ENUM_MSFT, 0x7FFFFFFF) #define XR_LIST_ENUM_XrSceneComputeStateMSFT(_) \ _(XR_SCENE_COMPUTE_STATE_NONE_MSFT, 0) \ _(XR_SCENE_COMPUTE_STATE_UPDATING_MSFT, 1) \ _(XR_SCENE_COMPUTE_STATE_COMPLETED_MSFT, 2) \ _(XR_SCENE_COMPUTE_STATE_COMPLETED_WITH_ERROR_MSFT, 3) \ _(XR_SCENE_COMPUTE_STATE_MAX_ENUM_MSFT, 0x7FFFFFFF) #define XR_LIST_ENUM_XrColorSpaceFB(_) \ _(XR_COLOR_SPACE_UNMANAGED_FB, 0) \ _(XR_COLOR_SPACE_REC2020_FB, 1) \ _(XR_COLOR_SPACE_REC709_FB, 2) \ _(XR_COLOR_SPACE_RIFT_CV1_FB, 3) \ _(XR_COLOR_SPACE_RIFT_S_FB, 4) \ _(XR_COLOR_SPACE_QUEST_FB, 5) \ _(XR_COLOR_SPACE_P3_FB, 6) \ _(XR_COLOR_SPACE_ADOBE_RGB_FB, 7) \ _(XR_COLOR_SPACE_MAX_ENUM_FB, 0x7FFFFFFF) #define XR_LIST_ENUM_XrFoveationLevelFB(_) \ _(XR_FOVEATION_LEVEL_NONE_FB, 0) \ _(XR_FOVEATION_LEVEL_LOW_FB, 1) \ _(XR_FOVEATION_LEVEL_MEDIUM_FB, 2) \ _(XR_FOVEATION_LEVEL_HIGH_FB, 3) \ _(XR_FOVEATION_LEVEL_MAX_ENUM_FB, 0x7FFFFFFF) #define XR_LIST_ENUM_XrFoveationDynamicFB(_) \ _(XR_FOVEATION_DYNAMIC_DISABLED_FB, 0) \ _(XR_FOVEATION_DYNAMIC_LEVEL_ENABLED_FB, 1) \ _(XR_FOVEATION_DYNAMIC_MAX_ENUM_FB, 0x7FFFFFFF) #define XR_LIST_ENUM_XrWindingOrderFB(_) \ _(XR_WINDING_ORDER_UNKNOWN_FB, 0) \ _(XR_WINDING_ORDER_CW_FB, 1) \ _(XR_WINDING_ORDER_CCW_FB, 2) \ _(XR_WINDING_ORDER_MAX_ENUM_FB, 0x7FFFFFFF) #define XR_LIST_ENUM_XrPassthroughLayerPurposeFB(_) \ _(XR_PASSTHROUGH_LAYER_PURPOSE_RECONSTRUCTION_FB, 0) \ _(XR_PASSTHROUGH_LAYER_PURPOSE_PROJECTED_FB, 1) \ _(XR_PASSTHROUGH_LAYER_PURPOSE_MAX_ENUM_FB, 0x7FFFFFFF) #define XR_LIST_BITS_XrInstanceCreateFlags(_) #define XR_LIST_BITS_XrSessionCreateFlags(_) #define XR_LIST_BITS_XrSpaceVelocityFlags(_) \ _(XR_SPACE_VELOCITY_LINEAR_VALID_BIT, 0x00000001) \ _(XR_SPACE_VELOCITY_ANGULAR_VALID_BIT, 0x00000002) \ #define XR_LIST_BITS_XrSpaceLocationFlags(_) \ _(XR_SPACE_LOCATION_ORIENTATION_VALID_BIT, 0x00000001) \ _(XR_SPACE_LOCATION_POSITION_VALID_BIT, 0x00000002) \ _(XR_SPACE_LOCATION_ORIENTATION_TRACKED_BIT, 0x00000004) \ _(XR_SPACE_LOCATION_POSITION_TRACKED_BIT, 0x00000008) \ #define XR_LIST_BITS_XrSwapchainCreateFlags(_) \ _(XR_SWAPCHAIN_CREATE_PROTECTED_CONTENT_BIT, 0x00000001) \ _(XR_SWAPCHAIN_CREATE_STATIC_IMAGE_BIT, 0x00000002) \ #define XR_LIST_BITS_XrSwapchainUsageFlags(_) \ _(XR_SWAPCHAIN_USAGE_COLOR_ATTACHMENT_BIT, 0x00000001) \ _(XR_SWAPCHAIN_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, 0x00000002) \ _(XR_SWAPCHAIN_USAGE_UNORDERED_ACCESS_BIT, 0x00000004) \ _(XR_SWAPCHAIN_USAGE_TRANSFER_SRC_BIT, 0x00000008) \ _(XR_SWAPCHAIN_USAGE_TRANSFER_DST_BIT, 0x00000010) \ _(XR_SWAPCHAIN_USAGE_SAMPLED_BIT, 0x00000020) \ _(XR_SWAPCHAIN_USAGE_MUTABLE_FORMAT_BIT, 0x00000040) \ _(XR_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_MND, 0x00000080) \ _(XR_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_KHR, XR_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_MND) \ #define XR_LIST_BITS_XrCompositionLayerFlags(_) \ _(XR_COMPOSITION_LAYER_CORRECT_CHROMATIC_ABERRATION_BIT, 0x00000001) \ _(XR_COMPOSITION_LAYER_BLEND_TEXTURE_SOURCE_ALPHA_BIT, 0x00000002) \ _(XR_COMPOSITION_LAYER_UNPREMULTIPLIED_ALPHA_BIT, 0x00000004) \ #define XR_LIST_BITS_XrViewStateFlags(_) \ _(XR_VIEW_STATE_ORIENTATION_VALID_BIT, 0x00000001) \ _(XR_VIEW_STATE_POSITION_VALID_BIT, 0x00000002) \ _(XR_VIEW_STATE_ORIENTATION_TRACKED_BIT, 0x00000004) \ _(XR_VIEW_STATE_POSITION_TRACKED_BIT, 0x00000008) \ #define XR_LIST_BITS_XrInputSourceLocalizedNameFlags(_) \ _(XR_INPUT_SOURCE_LOCALIZED_NAME_USER_PATH_BIT, 0x00000001) \ _(XR_INPUT_SOURCE_LOCALIZED_NAME_INTERACTION_PROFILE_BIT, 0x00000002) \ _(XR_INPUT_SOURCE_LOCALIZED_NAME_COMPONENT_BIT, 0x00000004) \ #define XR_LIST_BITS_XrVulkanInstanceCreateFlagsKHR(_) #define XR_LIST_BITS_XrVulkanDeviceCreateFlagsKHR(_) #define XR_LIST_BITS_XrDebugUtilsMessageSeverityFlagsEXT(_) \ _(XR_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT, 0x00000001) \ _(XR_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT, 0x00000010) \ _(XR_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT, 0x00000100) \ _(XR_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT, 0x00001000) \ #define XR_LIST_BITS_XrDebugUtilsMessageTypeFlagsEXT(_) \ _(XR_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT, 0x00000001) \ _(XR_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT, 0x00000002) \ _(XR_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT, 0x00000004) \ _(XR_DEBUG_UTILS_MESSAGE_TYPE_CONFORMANCE_BIT_EXT, 0x00000008) \ #define XR_LIST_BITS_XrOverlaySessionCreateFlagsEXTX(_) #define XR_LIST_BITS_XrOverlayMainSessionFlagsEXTX(_) \ _(XR_OVERLAY_MAIN_SESSION_ENABLED_COMPOSITION_LAYER_INFO_DEPTH_BIT_EXTX, 0x00000001) \ #define XR_LIST_BITS_XrCompositionLayerImageLayoutFlagsFB(_) \ _(XR_COMPOSITION_LAYER_IMAGE_LAYOUT_VERTICAL_FLIP_BIT_FB, 0x00000001) \ #define XR_LIST_BITS_XrAndroidSurfaceSwapchainFlagsFB(_) \ _(XR_ANDROID_SURFACE_SWAPCHAIN_SYNCHRONOUS_BIT_FB, 0x00000001) \ _(XR_ANDROID_SURFACE_SWAPCHAIN_USE_TIMESTAMPS_BIT_FB, 0x00000002) \ #define XR_LIST_BITS_XrCompositionLayerSecureContentFlagsFB(_) \ _(XR_COMPOSITION_LAYER_SECURE_CONTENT_EXCLUDE_LAYER_BIT_FB, 0x00000001) \ _(XR_COMPOSITION_LAYER_SECURE_CONTENT_REPLACE_LAYER_BIT_FB, 0x00000002) \ #define XR_LIST_BITS_XrHandTrackingAimFlagsFB(_) \ _(XR_HAND_TRACKING_AIM_COMPUTED_BIT_FB, 0x00000001) \ _(XR_HAND_TRACKING_AIM_VALID_BIT_FB, 0x00000002) \ _(XR_HAND_TRACKING_AIM_INDEX_PINCHING_BIT_FB, 0x00000004) \ _(XR_HAND_TRACKING_AIM_MIDDLE_PINCHING_BIT_FB, 0x00000008) \ _(XR_HAND_TRACKING_AIM_RING_PINCHING_BIT_FB, 0x00000010) \ _(XR_HAND_TRACKING_AIM_LITTLE_PINCHING_BIT_FB, 0x00000020) \ _(XR_HAND_TRACKING_AIM_SYSTEM_GESTURE_BIT_FB, 0x00000040) \ _(XR_HAND_TRACKING_AIM_DOMINANT_HAND_BIT_FB, 0x00000080) \ _(XR_HAND_TRACKING_AIM_MENU_PRESSED_BIT_FB, 0x00000100) \ #define XR_LIST_BITS_XrSwapchainCreateFoveationFlagsFB(_) \ _(XR_SWAPCHAIN_CREATE_FOVEATION_SCALED_BIN_BIT_FB, 0x00000001) \ _(XR_SWAPCHAIN_CREATE_FOVEATION_FRAGMENT_DENSITY_MAP_BIT_FB, 0x00000002) \ #define XR_LIST_BITS_XrSwapchainStateFoveationFlagsFB(_) #define XR_LIST_BITS_XrTriangleMeshFlagsFB(_) \ _(XR_TRIANGLE_MESH_MUTABLE_BIT_FB, 0x00000001) \ #define XR_LIST_BITS_XrPassthroughFlagsFB(_) \ _(XR_PASSTHROUGH_IS_RUNNING_AT_CREATION_BIT_FB, 0x00000001) \ #define XR_LIST_BITS_XrPassthroughStateChangedFlagsFB(_) \ _(XR_PASSTHROUGH_STATE_CHANGED_REINIT_REQUIRED_BIT_FB, 0x00000001) \ _(XR_PASSTHROUGH_STATE_CHANGED_NON_RECOVERABLE_ERROR_BIT_FB, 0x00000002) \ _(XR_PASSTHROUGH_STATE_CHANGED_RECOVERABLE_ERROR_BIT_FB, 0x00000004) \ _(XR_PASSTHROUGH_STATE_CHANGED_RESTORED_ERROR_BIT_FB, 0x00000008) \ #define XR_LIST_BITS_XrCompositionLayerSpaceWarpInfoFlagsFB(_) #define XR_LIST_STRUCT_XrApiLayerProperties(_) \ _(type) \ _(next) \ _(layerName) \ _(specVersion) \ _(layerVersion) \ _(description) \ #define XR_LIST_STRUCT_XrExtensionProperties(_) \ _(type) \ _(next) \ _(extensionName) \ _(extensionVersion) \ #define XR_LIST_STRUCT_XrApplicationInfo(_) \ _(applicationName) \ _(applicationVersion) \ _(engineName) \ _(engineVersion) \ _(apiVersion) \ #define XR_LIST_STRUCT_XrInstanceCreateInfo(_) \ _(type) \ _(next) \ _(createFlags) \ _(applicationInfo) \ _(enabledApiLayerCount) \ _(enabledApiLayerNames) \ _(enabledExtensionCount) \ _(enabledExtensionNames) \ #define XR_LIST_STRUCT_XrInstanceProperties(_) \ _(type) \ _(next) \ _(runtimeVersion) \ _(runtimeName) \ #define XR_LIST_STRUCT_XrEventDataBuffer(_) \ _(type) \ _(next) \ _(varying) \ #define XR_LIST_STRUCT_XrSystemGetInfo(_) \ _(type) \ _(next) \ _(formFactor) \ #define XR_LIST_STRUCT_XrSystemGraphicsProperties(_) \ _(maxSwapchainImageHeight) \ _(maxSwapchainImageWidth) \ _(maxLayerCount) \ #define XR_LIST_STRUCT_XrSystemTrackingProperties(_) \ _(orientationTracking) \ _(positionTracking) \ #define XR_LIST_STRUCT_XrSystemProperties(_) \ _(type) \ _(next) \ _(systemId) \ _(vendorId) \ _(systemName) \ _(graphicsProperties) \ _(trackingProperties) \ #define XR_LIST_STRUCT_XrSessionCreateInfo(_) \ _(type) \ _(next) \ _(createFlags) \ _(systemId) \ #define XR_LIST_STRUCT_XrVector3f(_) \ _(x) \ _(y) \ _(z) \ #define XR_LIST_STRUCT_XrSpaceVelocity(_) \ _(type) \ _(next) \ _(velocityFlags) \ _(linearVelocity) \ _(angularVelocity) \ #define XR_LIST_STRUCT_XrQuaternionf(_) \ _(x) \ _(y) \ _(z) \ _(w) \ #define XR_LIST_STRUCT_XrPosef(_) \ _(orientation) \ _(position) \ #define XR_LIST_STRUCT_XrReferenceSpaceCreateInfo(_) \ _(type) \ _(next) \ _(referenceSpaceType) \ _(poseInReferenceSpace) \ #define XR_LIST_STRUCT_XrExtent2Df(_) \ _(width) \ _(height) \ #define XR_LIST_STRUCT_XrActionSpaceCreateInfo(_) \ _(type) \ _(next) \ _(action) \ _(subactionPath) \ _(poseInActionSpace) \ #define XR_LIST_STRUCT_XrSpaceLocation(_) \ _(type) \ _(next) \ _(locationFlags) \ _(pose) \ #define XR_LIST_STRUCT_XrViewConfigurationProperties(_) \ _(type) \ _(next) \ _(viewConfigurationType) \ _(fovMutable) \ #define XR_LIST_STRUCT_XrViewConfigurationView(_) \ _(type) \ _(next) \ _(recommendedImageRectWidth) \ _(maxImageRectWidth) \ _(recommendedImageRectHeight) \ _(maxImageRectHeight) \ _(recommendedSwapchainSampleCount) \ _(maxSwapchainSampleCount) \ #define XR_LIST_STRUCT_XrSwapchainCreateInfo(_) \ _(type) \ _(next) \ _(createFlags) \ _(usageFlags) \ _(format) \ _(sampleCount) \ _(width) \ _(height) \ _(faceCount) \ _(arraySize) \ _(mipCount) \ #define XR_LIST_STRUCT_XrSwapchainImageBaseHeader(_) \ _(type) \ _(next) \ #define XR_LIST_STRUCT_XrSwapchainImageAcquireInfo(_) \ _(type) \ _(next) \ #define XR_LIST_STRUCT_XrSwapchainImageWaitInfo(_) \ _(type) \ _(next) \ _(timeout) \ #define XR_LIST_STRUCT_XrSwapchainImageReleaseInfo(_) \ _(type) \ _(next) \ #define XR_LIST_STRUCT_XrSessionBeginInfo(_) \ _(type) \ _(next) \ _(primaryViewConfigurationType) \ #define XR_LIST_STRUCT_XrFrameWaitInfo(_) \ _(type) \ _(next) \ #define XR_LIST_STRUCT_XrFrameState(_) \ _(type) \ _(next) \ _(predictedDisplayTime) \ _(predictedDisplayPeriod) \ _(shouldRender) \ #define XR_LIST_STRUCT_XrFrameBeginInfo(_) \ _(type) \ _(next) \ #define XR_LIST_STRUCT_XrCompositionLayerBaseHeader(_) \ _(type) \ _(next) \ _(layerFlags) \ _(space) \ #define XR_LIST_STRUCT_XrFrameEndInfo(_) \ _(type) \ _(next) \ _(displayTime) \ _(environmentBlendMode) \ _(layerCount) \ _(layers) \ #define XR_LIST_STRUCT_XrViewLocateInfo(_) \ _(type) \ _(next) \ _(viewConfigurationType) \ _(displayTime) \ _(space) \ #define XR_LIST_STRUCT_XrViewState(_) \ _(type) \ _(next) \ _(viewStateFlags) \ #define XR_LIST_STRUCT_XrFovf(_) \ _(angleLeft) \ _(angleRight) \ _(angleUp) \ _(angleDown) \ #define XR_LIST_STRUCT_XrView(_) \ _(type) \ _(next) \ _(pose) \ _(fov) \ #define XR_LIST_STRUCT_XrActionSetCreateInfo(_) \ _(type) \ _(next) \ _(actionSetName) \ _(localizedActionSetName) \ _(priority) \ #define XR_LIST_STRUCT_XrActionCreateInfo(_) \ _(type) \ _(next) \ _(actionName) \ _(actionType) \ _(countSubactionPaths) \ _(subactionPaths) \ _(localizedActionName) \ #define XR_LIST_STRUCT_XrActionSuggestedBinding(_) \ _(action) \ _(binding) \ #define XR_LIST_STRUCT_XrInteractionProfileSuggestedBinding(_) \ _(type) \ _(next) \ _(interactionProfile) \ _(countSuggestedBindings) \ _(suggestedBindings) \ #define XR_LIST_STRUCT_XrSessionActionSetsAttachInfo(_) \ _(type) \ _(next) \ _(countActionSets) \ _(actionSets) \ #define XR_LIST_STRUCT_XrInteractionProfileState(_) \ _(type) \ _(next) \ _(interactionProfile) \ #define XR_LIST_STRUCT_XrActionStateGetInfo(_) \ _(type) \ _(next) \ _(action) \ _(subactionPath) \ #define XR_LIST_STRUCT_XrActionStateBoolean(_) \ _(type) \ _(next) \ _(currentState) \ _(changedSinceLastSync) \ _(lastChangeTime) \ _(isActive) \ #define XR_LIST_STRUCT_XrActionStateFloat(_) \ _(type) \ _(next) \ _(currentState) \ _(changedSinceLastSync) \ _(lastChangeTime) \ _(isActive) \ #define XR_LIST_STRUCT_XrVector2f(_) \ _(x) \ _(y) \ #define XR_LIST_STRUCT_XrActionStateVector2f(_) \ _(type) \ _(next) \ _(currentState) \ _(changedSinceLastSync) \ _(lastChangeTime) \ _(isActive) \ #define XR_LIST_STRUCT_XrActionStatePose(_) \ _(type) \ _(next) \ _(isActive) \ #define XR_LIST_STRUCT_XrActiveActionSet(_) \ _(actionSet) \ _(subactionPath) \ #define XR_LIST_STRUCT_XrActionsSyncInfo(_) \ _(type) \ _(next) \ _(countActiveActionSets) \ _(activeActionSets) \ #define XR_LIST_STRUCT_XrBoundSourcesForActionEnumerateInfo(_) \ _(type) \ _(next) \ _(action) \ #define XR_LIST_STRUCT_XrInputSourceLocalizedNameGetInfo(_) \ _(type) \ _(next) \ _(sourcePath) \ _(whichComponents) \ #define XR_LIST_STRUCT_XrHapticActionInfo(_) \ _(type) \ _(next) \ _(action) \ _(subactionPath) \ #define XR_LIST_STRUCT_XrHapticBaseHeader(_) \ _(type) \ _(next) \ #define XR_LIST_STRUCT_XrBaseInStructure(_) \ _(type) \ _(next) \ #define XR_LIST_STRUCT_XrBaseOutStructure(_) \ _(type) \ _(next) \ #define XR_LIST_STRUCT_XrOffset2Di(_) \ _(x) \ _(y) \ #define XR_LIST_STRUCT_XrExtent2Di(_) \ _(width) \ _(height) \ #define XR_LIST_STRUCT_XrRect2Di(_) \ _(offset) \ _(extent) \ #define XR_LIST_STRUCT_XrSwapchainSubImage(_) \ _(swapchain) \ _(imageRect) \ _(imageArrayIndex) \ #define XR_LIST_STRUCT_XrCompositionLayerProjectionView(_) \ _(type) \ _(next) \ _(pose) \ _(fov) \ _(subImage) \ #define XR_LIST_STRUCT_XrCompositionLayerProjection(_) \ _(type) \ _(next) \ _(layerFlags) \ _(space) \ _(viewCount) \ _(views) \ #define XR_LIST_STRUCT_XrCompositionLayerQuad(_) \ _(type) \ _(next) \ _(layerFlags) \ _(space) \ _(eyeVisibility) \ _(subImage) \ _(pose) \ _(size) \ #define XR_LIST_STRUCT_XrEventDataBaseHeader(_) \ _(type) \ _(next) \ #define XR_LIST_STRUCT_XrEventDataEventsLost(_) \ _(type) \ _(next) \ _(lostEventCount) \ #define XR_LIST_STRUCT_XrEventDataInstanceLossPending(_) \ _(type) \ _(next) \ _(lossTime) \ #define XR_LIST_STRUCT_XrEventDataSessionStateChanged(_) \ _(type) \ _(next) \ _(session) \ _(state) \ _(time) \ #define XR_LIST_STRUCT_XrEventDataReferenceSpaceChangePending(_) \ _(type) \ _(next) \ _(session) \ _(referenceSpaceType) \ _(changeTime) \ _(poseValid) \ _(poseInPreviousSpace) \ #define XR_LIST_STRUCT_XrEventDataInteractionProfileChanged(_) \ _(type) \ _(next) \ _(session) \ #define XR_LIST_STRUCT_XrHapticVibration(_) \ _(type) \ _(next) \ _(duration) \ _(frequency) \ _(amplitude) \ #define XR_LIST_STRUCT_XrOffset2Df(_) \ _(x) \ _(y) \ #define XR_LIST_STRUCT_XrRect2Df(_) \ _(offset) \ _(extent) \ #define XR_LIST_STRUCT_XrVector4f(_) \ _(x) \ _(y) \ _(z) \ _(w) \ #define XR_LIST_STRUCT_XrColor4f(_) \ _(r) \ _(g) \ _(b) \ _(a) \ #define XR_LIST_STRUCT_XrCompositionLayerCubeKHR(_) \ _(type) \ _(next) \ _(layerFlags) \ _(space) \ _(eyeVisibility) \ _(swapchain) \ _(imageArrayIndex) \ _(orientation) \ #define XR_LIST_STRUCT_XrInstanceCreateInfoAndroidKHR(_) \ _(type) \ _(next) \ _(applicationVM) \ _(applicationActivity) \ #define XR_LIST_STRUCT_XrCompositionLayerDepthInfoKHR(_) \ _(type) \ _(next) \ _(subImage) \ _(minDepth) \ _(maxDepth) \ _(nearZ) \ _(farZ) \ #define XR_LIST_STRUCT_XrVulkanSwapchainFormatListCreateInfoKHR(_) \ _(type) \ _(next) \ _(viewFormatCount) \ _(viewFormats) \ #define XR_LIST_STRUCT_XrCompositionLayerCylinderKHR(_) \ _(type) \ _(next) \ _(layerFlags) \ _(space) \ _(eyeVisibility) \ _(subImage) \ _(pose) \ _(radius) \ _(centralAngle) \ _(aspectRatio) \ #define XR_LIST_STRUCT_XrCompositionLayerEquirectKHR(_) \ _(type) \ _(next) \ _(layerFlags) \ _(space) \ _(eyeVisibility) \ _(subImage) \ _(pose) \ _(radius) \ _(scale) \ _(bias) \ #define XR_LIST_STRUCT_XrGraphicsBindingOpenGLWin32KHR(_) \ _(type) \ _(next) \ _(hDC) \ _(hGLRC) \ #define XR_LIST_STRUCT_XrGraphicsBindingOpenGLXlibKHR(_) \ _(type) \ _(next) \ _(xDisplay) \ _(visualid) \ _(glxFBConfig) \ _(glxDrawable) \ _(glxContext) \ #define XR_LIST_STRUCT_XrGraphicsBindingOpenGLXcbKHR(_) \ _(type) \ _(next) \ _(connection) \ _(screenNumber) \ _(fbconfigid) \ _(visualid) \ _(glxDrawable) \ _(glxContext) \ #define XR_LIST_STRUCT_XrGraphicsBindingOpenGLWaylandKHR(_) \ _(type) \ _(next) \ _(display) \ #define XR_LIST_STRUCT_XrSwapchainImageOpenGLKHR(_) \ _(type) \ _(next) \ _(image) \ #define XR_LIST_STRUCT_XrGraphicsRequirementsOpenGLKHR(_) \ _(type) \ _(next) \ _(minApiVersionSupported) \ _(maxApiVersionSupported) \ #define XR_LIST_STRUCT_XrGraphicsBindingOpenGLESAndroidKHR(_) \ _(type) \ _(next) \ _(display) \ _(config) \ _(context) \ #define XR_LIST_STRUCT_XrSwapchainImageOpenGLESKHR(_) \ _(type) \ _(next) \ _(image) \ #define XR_LIST_STRUCT_XrGraphicsRequirementsOpenGLESKHR(_) \ _(type) \ _(next) \ _(minApiVersionSupported) \ _(maxApiVersionSupported) \ #define XR_LIST_STRUCT_XrGraphicsBindingVulkanKHR(_) \ _(type) \ _(next) \ _(instance) \ _(physicalDevice) \ _(device) \ _(queueFamilyIndex) \ _(queueIndex) \ #define XR_LIST_STRUCT_XrSwapchainImageVulkanKHR(_) \ _(type) \ _(next) \ _(image) \ #define XR_LIST_STRUCT_XrGraphicsRequirementsVulkanKHR(_) \ _(type) \ _(next) \ _(minApiVersionSupported) \ _(maxApiVersionSupported) \ #define XR_LIST_STRUCT_XrGraphicsBindingD3D11KHR(_) \ _(type) \ _(next) \ _(device) \ #define XR_LIST_STRUCT_XrSwapchainImageD3D11KHR(_) \ _(type) \ _(next) \ _(texture) \ #define XR_LIST_STRUCT_XrGraphicsRequirementsD3D11KHR(_) \ _(type) \ _(next) \ _(adapterLuid) \ _(minFeatureLevel) \ #define XR_LIST_STRUCT_XrGraphicsBindingD3D12KHR(_) \ _(type) \ _(next) \ _(device) \ _(queue) \ #define XR_LIST_STRUCT_XrSwapchainImageD3D12KHR(_) \ _(type) \ _(next) \ _(texture) \ #define XR_LIST_STRUCT_XrGraphicsRequirementsD3D12KHR(_) \ _(type) \ _(next) \ _(adapterLuid) \ _(minFeatureLevel) \ #define XR_LIST_STRUCT_XrVisibilityMaskKHR(_) \ _(type) \ _(next) \ _(vertexCapacityInput) \ _(vertexCountOutput) \ _(vertices) \ _(indexCapacityInput) \ _(indexCountOutput) \ _(indices) \ #define XR_LIST_STRUCT_XrEventDataVisibilityMaskChangedKHR(_) \ _(type) \ _(next) \ _(session) \ _(viewConfigurationType) \ _(viewIndex) \ #define XR_LIST_STRUCT_XrCompositionLayerColorScaleBiasKHR(_) \ _(type) \ _(next) \ _(colorScale) \ _(colorBias) \ #define XR_LIST_STRUCT_XrLoaderInitInfoBaseHeaderKHR(_) \ _(type) \ _(next) \ #define XR_LIST_STRUCT_XrLoaderInitInfoAndroidKHR(_) \ _(type) \ _(next) \ _(applicationVM) \ _(applicationContext) \ #define XR_LIST_STRUCT_XrVulkanInstanceCreateInfoKHR(_) \ _(type) \ _(next) \ _(systemId) \ _(createFlags) \ _(pfnGetInstanceProcAddr) \ _(vulkanCreateInfo) \ _(vulkanAllocator) \ #define XR_LIST_STRUCT_XrVulkanDeviceCreateInfoKHR(_) \ _(type) \ _(next) \ _(systemId) \ _(createFlags) \ _(pfnGetInstanceProcAddr) \ _(vulkanPhysicalDevice) \ _(vulkanCreateInfo) \ _(vulkanAllocator) \ #define XR_LIST_STRUCT_XrVulkanGraphicsDeviceGetInfoKHR(_) \ _(type) \ _(next) \ _(systemId) \ _(vulkanInstance) \ #define XR_LIST_STRUCT_XrCompositionLayerEquirect2KHR(_) \ _(type) \ _(next) \ _(layerFlags) \ _(space) \ _(eyeVisibility) \ _(subImage) \ _(pose) \ _(radius) \ _(centralHorizontalAngle) \ _(upperVerticalAngle) \ _(lowerVerticalAngle) \ #define XR_LIST_STRUCT_XrBindingModificationBaseHeaderKHR(_) \ _(type) \ _(next) \ #define XR_LIST_STRUCT_XrBindingModificationsKHR(_) \ _(type) \ _(next) \ _(bindingModificationCount) \ _(bindingModifications) \ #define XR_LIST_STRUCT_XrEventDataPerfSettingsEXT(_) \ _(type) \ _(next) \ _(domain) \ _(subDomain) \ _(fromLevel) \ _(toLevel) \ #define XR_LIST_STRUCT_XrDebugUtilsObjectNameInfoEXT(_) \ _(type) \ _(next) \ _(objectType) \ _(objectHandle) \ _(objectName) \ #define XR_LIST_STRUCT_XrDebugUtilsLabelEXT(_) \ _(type) \ _(next) \ _(labelName) \ #define XR_LIST_STRUCT_XrDebugUtilsMessengerCallbackDataEXT(_) \ _(type) \ _(next) \ _(messageId) \ _(functionName) \ _(message) \ _(objectCount) \ _(objects) \ _(sessionLabelCount) \ _(sessionLabels) \ #define XR_LIST_STRUCT_XrDebugUtilsMessengerCreateInfoEXT(_) \ _(type) \ _(next) \ _(messageSeverities) \ _(messageTypes) \ _(userCallback) \ _(userData) \ #define XR_LIST_STRUCT_XrSystemEyeGazeInteractionPropertiesEXT(_) \ _(type) \ _(next) \ _(supportsEyeGazeInteraction) \ #define XR_LIST_STRUCT_XrEyeGazeSampleTimeEXT(_) \ _(type) \ _(next) \ _(time) \ #define XR_LIST_STRUCT_XrSessionCreateInfoOverlayEXTX(_) \ _(type) \ _(next) \ _(createFlags) \ _(sessionLayersPlacement) \ #define XR_LIST_STRUCT_XrEventDataMainSessionVisibilityChangedEXTX(_) \ _(type) \ _(next) \ _(visible) \ _(flags) \ #define XR_LIST_STRUCT_XrSpatialAnchorCreateInfoMSFT(_) \ _(type) \ _(next) \ _(space) \ _(pose) \ _(time) \ #define XR_LIST_STRUCT_XrSpatialAnchorSpaceCreateInfoMSFT(_) \ _(type) \ _(next) \ _(anchor) \ _(poseInAnchorSpace) \ #define XR_LIST_STRUCT_XrCompositionLayerImageLayoutFB(_) \ _(type) \ _(next) \ _(flags) \ #define XR_LIST_STRUCT_XrCompositionLayerAlphaBlendFB(_) \ _(type) \ _(next) \ _(srcFactorColor) \ _(dstFactorColor) \ _(srcFactorAlpha) \ _(dstFactorAlpha) \ #define XR_LIST_STRUCT_XrViewConfigurationDepthRangeEXT(_) \ _(type) \ _(next) \ _(recommendedNearZ) \ _(minNearZ) \ _(recommendedFarZ) \ _(maxFarZ) \ #define XR_LIST_STRUCT_XrGraphicsBindingEGLMNDX(_) \ _(type) \ _(next) \ _(getProcAddress) \ _(display) \ _(config) \ _(context) \ #define XR_LIST_STRUCT_XrSpatialGraphNodeSpaceCreateInfoMSFT(_) \ _(type) \ _(next) \ _(nodeType) \ _(nodeId) \ _(pose) \ #define XR_LIST_STRUCT_XrSystemHandTrackingPropertiesEXT(_) \ _(type) \ _(next) \ _(supportsHandTracking) \ #define XR_LIST_STRUCT_XrHandTrackerCreateInfoEXT(_) \ _(type) \ _(next) \ _(hand) \ _(handJointSet) \ #define XR_LIST_STRUCT_XrHandJointsLocateInfoEXT(_) \ _(type) \ _(next) \ _(baseSpace) \ _(time) \ #define XR_LIST_STRUCT_XrHandJointLocationEXT(_) \ _(locationFlags) \ _(pose) \ _(radius) \ #define XR_LIST_STRUCT_XrHandJointVelocityEXT(_) \ _(velocityFlags) \ _(linearVelocity) \ _(angularVelocity) \ #define XR_LIST_STRUCT_XrHandJointLocationsEXT(_) \ _(type) \ _(next) \ _(isActive) \ _(jointCount) \ _(jointLocations) \ #define XR_LIST_STRUCT_XrHandJointVelocitiesEXT(_) \ _(type) \ _(next) \ _(jointCount) \ _(jointVelocities) \ #define XR_LIST_STRUCT_XrSystemHandTrackingMeshPropertiesMSFT(_) \ _(type) \ _(next) \ _(supportsHandTrackingMesh) \ _(maxHandMeshIndexCount) \ _(maxHandMeshVertexCount) \ #define XR_LIST_STRUCT_XrHandMeshSpaceCreateInfoMSFT(_) \ _(type) \ _(next) \ _(handPoseType) \ _(poseInHandMeshSpace) \ #define XR_LIST_STRUCT_XrHandMeshUpdateInfoMSFT(_) \ _(type) \ _(next) \ _(time) \ _(handPoseType) \ #define XR_LIST_STRUCT_XrHandMeshIndexBufferMSFT(_) \ _(indexBufferKey) \ _(indexCapacityInput) \ _(indexCountOutput) \ _(indices) \ #define XR_LIST_STRUCT_XrHandMeshVertexMSFT(_) \ _(position) \ _(normal) \ #define XR_LIST_STRUCT_XrHandMeshVertexBufferMSFT(_) \ _(vertexUpdateTime) \ _(vertexCapacityInput) \ _(vertexCountOutput) \ _(vertices) \ #define XR_LIST_STRUCT_XrHandMeshMSFT(_) \ _(type) \ _(next) \ _(isActive) \ _(indexBufferChanged) \ _(vertexBufferChanged) \ _(indexBuffer) \ _(vertexBuffer) \ #define XR_LIST_STRUCT_XrHandPoseTypeInfoMSFT(_) \ _(type) \ _(next) \ _(handPoseType) \ #define XR_LIST_STRUCT_XrSecondaryViewConfigurationSessionBeginInfoMSFT(_) \ _(type) \ _(next) \ _(viewConfigurationCount) \ _(enabledViewConfigurationTypes) \ #define XR_LIST_STRUCT_XrSecondaryViewConfigurationStateMSFT(_) \ _(type) \ _(next) \ _(viewConfigurationType) \ _(active) \ #define XR_LIST_STRUCT_XrSecondaryViewConfigurationFrameStateMSFT(_) \ _(type) \ _(next) \ _(viewConfigurationCount) \ _(viewConfigurationStates) \ #define XR_LIST_STRUCT_XrSecondaryViewConfigurationLayerInfoMSFT(_) \ _(type) \ _(next) \ _(viewConfigurationType) \ _(environmentBlendMode) \ _(layerCount) \ _(layers) \ #define XR_LIST_STRUCT_XrSecondaryViewConfigurationFrameEndInfoMSFT(_) \ _(type) \ _(next) \ _(viewConfigurationCount) \ _(viewConfigurationLayersInfo) \ #define XR_LIST_STRUCT_XrSecondaryViewConfigurationSwapchainCreateInfoMSFT(_) \ _(type) \ _(next) \ _(viewConfigurationType) \ #define XR_LIST_STRUCT_XrControllerModelKeyStateMSFT(_) \ _(type) \ _(next) \ _(modelKey) \ #define XR_LIST_STRUCT_XrControllerModelNodePropertiesMSFT(_) \ _(type) \ _(next) \ _(parentNodeName) \ _(nodeName) \ #define XR_LIST_STRUCT_XrControllerModelPropertiesMSFT(_) \ _(type) \ _(next) \ _(nodeCapacityInput) \ _(nodeCountOutput) \ _(nodeProperties) \ #define XR_LIST_STRUCT_XrControllerModelNodeStateMSFT(_) \ _(type) \ _(next) \ _(nodePose) \ #define XR_LIST_STRUCT_XrControllerModelStateMSFT(_) \ _(type) \ _(next) \ _(nodeCapacityInput) \ _(nodeCountOutput) \ _(nodeStates) \ #define XR_LIST_STRUCT_XrViewConfigurationViewFovEPIC(_) \ _(type) \ _(next) \ _(recommendedFov) \ _(maxMutableFov) \ #define XR_LIST_STRUCT_XrHolographicWindowAttachmentMSFT(_) \ _(type) \ _(next) \ _(holographicSpace) \ _(coreWindow) \ #define XR_LIST_STRUCT_XrCompositionLayerReprojectionInfoMSFT(_) \ _(type) \ _(next) \ _(reprojectionMode) \ #define XR_LIST_STRUCT_XrCompositionLayerReprojectionPlaneOverrideMSFT(_) \ _(type) \ _(next) \ _(position) \ _(normal) \ _(velocity) \ #define XR_LIST_STRUCT_XrAndroidSurfaceSwapchainCreateInfoFB(_) \ _(type) \ _(next) \ _(createFlags) \ #define XR_LIST_STRUCT_XrSwapchainStateBaseHeaderFB(_) \ _(type) \ _(next) \ #define XR_LIST_STRUCT_XrCompositionLayerSecureContentFB(_) \ _(type) \ _(next) \ _(flags) \ #define XR_LIST_STRUCT_XrInteractionProfileAnalogThresholdVALVE(_) \ _(type) \ _(next) \ _(action) \ _(binding) \ _(onThreshold) \ _(offThreshold) \ _(onHaptic) \ _(offHaptic) \ #define XR_LIST_STRUCT_XrHandJointsMotionRangeInfoEXT(_) \ _(type) \ _(next) \ _(handJointsMotionRange) \ #define XR_LIST_STRUCT_XrUuidMSFT(_) \ _(bytes) \ #define XR_LIST_STRUCT_XrSceneObserverCreateInfoMSFT(_) \ _(type) \ _(next) \ #define XR_LIST_STRUCT_XrSceneCreateInfoMSFT(_) \ _(type) \ _(next) \ #define XR_LIST_STRUCT_XrSceneSphereBoundMSFT(_) \ _(center) \ _(radius) \ #define XR_LIST_STRUCT_XrSceneOrientedBoxBoundMSFT(_) \ _(pose) \ _(extents) \ #define XR_LIST_STRUCT_XrSceneFrustumBoundMSFT(_) \ _(pose) \ _(fov) \ _(farDistance) \ #define XR_LIST_STRUCT_XrSceneBoundsMSFT(_) \ _(space) \ _(time) \ _(sphereCount) \ _(spheres) \ _(boxCount) \ _(boxes) \ _(frustumCount) \ _(frustums) \ #define XR_LIST_STRUCT_XrNewSceneComputeInfoMSFT(_) \ _(type) \ _(next) \ _(requestedFeatureCount) \ _(requestedFeatures) \ _(consistency) \ _(bounds) \ #define XR_LIST_STRUCT_XrVisualMeshComputeLodInfoMSFT(_) \ _(type) \ _(next) \ _(lod) \ #define XR_LIST_STRUCT_XrSceneComponentMSFT(_) \ _(componentType) \ _(id) \ _(parentId) \ _(updateTime) \ #define XR_LIST_STRUCT_XrSceneComponentsMSFT(_) \ _(type) \ _(next) \ _(componentCapacityInput) \ _(componentCountOutput) \ _(components) \ #define XR_LIST_STRUCT_XrSceneComponentsGetInfoMSFT(_) \ _(type) \ _(next) \ _(componentType) \ #define XR_LIST_STRUCT_XrSceneComponentLocationMSFT(_) \ _(flags) \ _(pose) \ #define XR_LIST_STRUCT_XrSceneComponentLocationsMSFT(_) \ _(type) \ _(next) \ _(locationCount) \ _(locations) \ #define XR_LIST_STRUCT_XrSceneComponentsLocateInfoMSFT(_) \ _(type) \ _(next) \ _(baseSpace) \ _(time) \ _(componentIdCount) \ _(componentIds) \ #define XR_LIST_STRUCT_XrSceneObjectMSFT(_) \ _(objectType) \ #define XR_LIST_STRUCT_XrSceneObjectsMSFT(_) \ _(type) \ _(next) \ _(sceneObjectCount) \ _(sceneObjects) \ #define XR_LIST_STRUCT_XrSceneComponentParentFilterInfoMSFT(_) \ _(type) \ _(next) \ _(parentId) \ #define XR_LIST_STRUCT_XrSceneObjectTypesFilterInfoMSFT(_) \ _(type) \ _(next) \ _(objectTypeCount) \ _(objectTypes) \ #define XR_LIST_STRUCT_XrScenePlaneMSFT(_) \ _(alignment) \ _(size) \ _(meshBufferId) \ _(supportsIndicesUint16) \ #define XR_LIST_STRUCT_XrScenePlanesMSFT(_) \ _(type) \ _(next) \ _(scenePlaneCount) \ _(scenePlanes) \ #define XR_LIST_STRUCT_XrScenePlaneAlignmentFilterInfoMSFT(_) \ _(type) \ _(next) \ _(alignmentCount) \ _(alignments) \ #define XR_LIST_STRUCT_XrSceneMeshMSFT(_) \ _(meshBufferId) \ _(supportsIndicesUint16) \ #define XR_LIST_STRUCT_XrSceneMeshesMSFT(_) \ _(type) \ _(next) \ _(sceneMeshCount) \ _(sceneMeshes) \ #define XR_LIST_STRUCT_XrSceneMeshBuffersGetInfoMSFT(_) \ _(type) \ _(next) \ _(meshBufferId) \ #define XR_LIST_STRUCT_XrSceneMeshBuffersMSFT(_) \ _(type) \ _(next) \ #define XR_LIST_STRUCT_XrSceneMeshVertexBufferMSFT(_) \ _(type) \ _(next) \ _(vertexCapacityInput) \ _(vertexCountOutput) \ _(vertices) \ #define XR_LIST_STRUCT_XrSceneMeshIndicesUint32MSFT(_) \ _(type) \ _(next) \ _(indexCapacityInput) \ _(indexCountOutput) \ _(indices) \ #define XR_LIST_STRUCT_XrSceneMeshIndicesUint16MSFT(_) \ _(type) \ _(next) \ _(indexCapacityInput) \ _(indexCountOutput) \ _(indices) \ #define XR_LIST_STRUCT_XrSerializedSceneFragmentDataGetInfoMSFT(_) \ _(type) \ _(next) \ _(sceneFragmentId) \ #define XR_LIST_STRUCT_XrDeserializeSceneFragmentMSFT(_) \ _(bufferSize) \ _(buffer) \ #define XR_LIST_STRUCT_XrSceneDeserializeInfoMSFT(_) \ _(type) \ _(next) \ _(fragmentCount) \ _(fragments) \ #define XR_LIST_STRUCT_XrEventDataDisplayRefreshRateChangedFB(_) \ _(type) \ _(next) \ _(fromDisplayRefreshRate) \ _(toDisplayRefreshRate) \ #define XR_LIST_STRUCT_XrViveTrackerPathsHTCX(_) \ _(type) \ _(next) \ _(persistentPath) \ _(rolePath) \ #define XR_LIST_STRUCT_XrEventDataViveTrackerConnectedHTCX(_) \ _(type) \ _(next) \ _(paths) \ #define XR_LIST_STRUCT_XrSystemColorSpacePropertiesFB(_) \ _(type) \ _(next) \ _(colorSpace) \ #define XR_LIST_STRUCT_XrVector4sFB(_) \ _(x) \ _(y) \ _(z) \ _(w) \ #define XR_LIST_STRUCT_XrHandTrackingMeshFB(_) \ _(type) \ _(next) \ _(jointCapacityInput) \ _(jointCountOutput) \ _(jointBindPoses) \ _(jointRadii) \ _(jointParents) \ _(vertexCapacityInput) \ _(vertexCountOutput) \ _(vertexPositions) \ _(vertexNormals) \ _(vertexUVs) \ _(vertexBlendIndices) \ _(vertexBlendWeights) \ _(indexCapacityInput) \ _(indexCountOutput) \ _(indices) \ #define XR_LIST_STRUCT_XrHandTrackingScaleFB(_) \ _(type) \ _(next) \ _(sensorOutput) \ _(currentOutput) \ _(overrideHandScale) \ _(overrideValueInput) \ #define XR_LIST_STRUCT_XrHandTrackingAimStateFB(_) \ _(type) \ _(next) \ _(status) \ _(aimPose) \ _(pinchStrengthIndex) \ _(pinchStrengthMiddle) \ _(pinchStrengthRing) \ _(pinchStrengthLittle) \ #define XR_LIST_STRUCT_XrHandCapsuleFB(_) \ _(points) \ _(radius) \ _(joint) \ #define XR_LIST_STRUCT_XrHandTrackingCapsulesStateFB(_) \ _(type) \ _(next) \ _(capsules) \ #define XR_LIST_STRUCT_XrFoveationProfileCreateInfoFB(_) \ _(type) \ _(next) \ #define XR_LIST_STRUCT_XrSwapchainCreateInfoFoveationFB(_) \ _(type) \ _(next) \ _(flags) \ #define XR_LIST_STRUCT_XrSwapchainStateFoveationFB(_) \ _(type) \ _(next) \ _(flags) \ _(profile) \ #define XR_LIST_STRUCT_XrFoveationLevelProfileCreateInfoFB(_) \ _(type) \ _(next) \ _(level) \ _(verticalOffset) \ _(dynamic) \ #define XR_LIST_STRUCT_XrTriangleMeshCreateInfoFB(_) \ _(type) \ _(next) \ _(flags) \ _(windingOrder) \ _(vertexCount) \ _(vertexBuffer) \ _(triangleCount) \ _(indexBuffer) \ #define XR_LIST_STRUCT_XrSystemPassthroughPropertiesFB(_) \ _(type) \ _(next) \ _(supportsPassthrough) \ #define XR_LIST_STRUCT_XrPassthroughCreateInfoFB(_) \ _(type) \ _(next) \ _(flags) \ #define XR_LIST_STRUCT_XrPassthroughLayerCreateInfoFB(_) \ _(type) \ _(next) \ _(passthrough) \ _(flags) \ _(purpose) \ #define XR_LIST_STRUCT_XrCompositionLayerPassthroughFB(_) \ _(type) \ _(next) \ _(flags) \ _(space) \ _(layerHandle) \ #define XR_LIST_STRUCT_XrGeometryInstanceCreateInfoFB(_) \ _(type) \ _(next) \ _(layer) \ _(mesh) \ _(baseSpace) \ _(pose) \ _(scale) \ #define XR_LIST_STRUCT_XrGeometryInstanceTransformFB(_) \ _(type) \ _(next) \ _(baseSpace) \ _(time) \ _(pose) \ _(scale) \ #define XR_LIST_STRUCT_XrPassthroughStyleFB(_) \ _(type) \ _(next) \ _(textureOpacityFactor) \ _(edgeColor) \ #define XR_LIST_STRUCT_XrPassthroughColorMapMonoToRgbaFB(_) \ _(type) \ _(next) \ _(textureColorMap) \ #define XR_LIST_STRUCT_XrPassthroughColorMapMonoToMonoFB(_) \ _(type) \ _(next) \ _(textureColorMap) \ #define XR_LIST_STRUCT_XrEventDataPassthroughStateChangedFB(_) \ _(type) \ _(next) \ _(flags) \ #define XR_LIST_STRUCT_XrViewLocateFoveatedRenderingVARJO(_) \ _(type) \ _(next) \ _(foveatedRenderingActive) \ #define XR_LIST_STRUCT_XrFoveatedViewConfigurationViewVARJO(_) \ _(type) \ _(next) \ _(foveatedRenderingActive) \ #define XR_LIST_STRUCT_XrSystemFoveatedRenderingPropertiesVARJO(_) \ _(type) \ _(next) \ _(supportsFoveatedRendering) \ #define XR_LIST_STRUCT_XrCompositionLayerDepthTestVARJO(_) \ _(type) \ _(next) \ _(depthTestRangeNearZ) \ _(depthTestRangeFarZ) \ #define XR_LIST_STRUCT_XrSystemMarkerTrackingPropertiesVARJO(_) \ _(type) \ _(next) \ _(supportsMarkerTracking) \ #define XR_LIST_STRUCT_XrEventDataMarkerTrackingUpdateVARJO(_) \ _(type) \ _(next) \ _(markerId) \ _(isActive) \ _(isPredicted) \ _(time) \ #define XR_LIST_STRUCT_XrMarkerSpaceCreateInfoVARJO(_) \ _(type) \ _(next) \ _(markerId) \ _(poseInMarkerSpace) \ #define XR_LIST_STRUCT_XrSpatialAnchorPersistenceNameMSFT(_) \ _(name) \ #define XR_LIST_STRUCT_XrSpatialAnchorPersistenceInfoMSFT(_) \ _(type) \ _(next) \ _(spatialAnchorPersistenceName) \ _(spatialAnchor) \ #define XR_LIST_STRUCT_XrSpatialAnchorFromPersistedAnchorCreateInfoMSFT(_) \ _(type) \ _(next) \ _(spatialAnchorStore) \ _(spatialAnchorPersistenceName) \ #define XR_LIST_STRUCT_XrSwapchainImageFoveationVulkanFB(_) \ _(type) \ _(next) \ _(image) \ _(width) \ _(height) \ #define XR_LIST_STRUCT_XrSwapchainStateAndroidSurfaceDimensionsFB(_) \ _(type) \ _(next) \ _(width) \ _(height) \ #define XR_LIST_STRUCT_XrSwapchainStateSamplerOpenGLESFB(_) \ _(type) \ _(next) \ _(minFilter) \ _(magFilter) \ _(wrapModeS) \ _(wrapModeT) \ _(swizzleRed) \ _(swizzleGreen) \ _(swizzleBlue) \ _(swizzleAlpha) \ _(maxAnisotropy) \ _(borderColor) \ #define XR_LIST_STRUCT_XrSwapchainStateSamplerVulkanFB(_) \ _(type) \ _(next) \ _(minFilter) \ _(magFilter) \ _(mipmapMode) \ _(wrapModeS) \ _(wrapModeT) \ _(swizzleRed) \ _(swizzleGreen) \ _(swizzleBlue) \ _(swizzleAlpha) \ _(maxAnisotropy) \ _(borderColor) \ #define XR_LIST_STRUCT_XrCompositionLayerSpaceWarpInfoFB(_) \ _(type) \ _(next) \ _(layerFlags) \ _(motionVectorSubImage) \ _(appSpaceDeltaPose) \ _(depthSubImage) \ _(minDepth) \ _(maxDepth) \ _(nearZ) \ _(farZ) \ #define XR_LIST_STRUCT_XrSystemSpaceWarpPropertiesFB(_) \ _(type) \ _(next) \ _(recommendedMotionVectorImageRectWidth) \ _(recommendedMotionVectorImageRectHeight) \ #define XR_LIST_STRUCTURE_TYPES_CORE(_) \ _(XrApiLayerProperties, XR_TYPE_API_LAYER_PROPERTIES) \ _(XrExtensionProperties, XR_TYPE_EXTENSION_PROPERTIES) \ _(XrInstanceCreateInfo, XR_TYPE_INSTANCE_CREATE_INFO) \ _(XrInstanceProperties, XR_TYPE_INSTANCE_PROPERTIES) \ _(XrEventDataBuffer, XR_TYPE_EVENT_DATA_BUFFER) \ _(XrSystemGetInfo, XR_TYPE_SYSTEM_GET_INFO) \ _(XrSystemProperties, XR_TYPE_SYSTEM_PROPERTIES) \ _(XrSessionCreateInfo, XR_TYPE_SESSION_CREATE_INFO) \ _(XrSpaceVelocity, XR_TYPE_SPACE_VELOCITY) \ _(XrReferenceSpaceCreateInfo, XR_TYPE_REFERENCE_SPACE_CREATE_INFO) \ _(XrActionSpaceCreateInfo, XR_TYPE_ACTION_SPACE_CREATE_INFO) \ _(XrSpaceLocation, XR_TYPE_SPACE_LOCATION) \ _(XrViewConfigurationProperties, XR_TYPE_VIEW_CONFIGURATION_PROPERTIES) \ _(XrViewConfigurationView, XR_TYPE_VIEW_CONFIGURATION_VIEW) \ _(XrSwapchainCreateInfo, XR_TYPE_SWAPCHAIN_CREATE_INFO) \ _(XrSwapchainImageAcquireInfo, XR_TYPE_SWAPCHAIN_IMAGE_ACQUIRE_INFO) \ _(XrSwapchainImageWaitInfo, XR_TYPE_SWAPCHAIN_IMAGE_WAIT_INFO) \ _(XrSwapchainImageReleaseInfo, XR_TYPE_SWAPCHAIN_IMAGE_RELEASE_INFO) \ _(XrSessionBeginInfo, XR_TYPE_SESSION_BEGIN_INFO) \ _(XrFrameWaitInfo, XR_TYPE_FRAME_WAIT_INFO) \ _(XrFrameState, XR_TYPE_FRAME_STATE) \ _(XrFrameBeginInfo, XR_TYPE_FRAME_BEGIN_INFO) \ _(XrFrameEndInfo, XR_TYPE_FRAME_END_INFO) \ _(XrViewLocateInfo, XR_TYPE_VIEW_LOCATE_INFO) \ _(XrViewState, XR_TYPE_VIEW_STATE) \ _(XrView, XR_TYPE_VIEW) \ _(XrActionSetCreateInfo, XR_TYPE_ACTION_SET_CREATE_INFO) \ _(XrActionCreateInfo, XR_TYPE_ACTION_CREATE_INFO) \ _(XrInteractionProfileSuggestedBinding, XR_TYPE_INTERACTION_PROFILE_SUGGESTED_BINDING) \ _(XrSessionActionSetsAttachInfo, XR_TYPE_SESSION_ACTION_SETS_ATTACH_INFO) \ _(XrInteractionProfileState, XR_TYPE_INTERACTION_PROFILE_STATE) \ _(XrActionStateGetInfo, XR_TYPE_ACTION_STATE_GET_INFO) \ _(XrActionStateBoolean, XR_TYPE_ACTION_STATE_BOOLEAN) \ _(XrActionStateFloat, XR_TYPE_ACTION_STATE_FLOAT) \ _(XrActionStateVector2f, XR_TYPE_ACTION_STATE_VECTOR2F) \ _(XrActionStatePose, XR_TYPE_ACTION_STATE_POSE) \ _(XrActionsSyncInfo, XR_TYPE_ACTIONS_SYNC_INFO) \ _(XrBoundSourcesForActionEnumerateInfo, XR_TYPE_BOUND_SOURCES_FOR_ACTION_ENUMERATE_INFO) \ _(XrInputSourceLocalizedNameGetInfo, XR_TYPE_INPUT_SOURCE_LOCALIZED_NAME_GET_INFO) \ _(XrHapticActionInfo, XR_TYPE_HAPTIC_ACTION_INFO) \ _(XrCompositionLayerProjectionView, XR_TYPE_COMPOSITION_LAYER_PROJECTION_VIEW) \ _(XrCompositionLayerProjection, XR_TYPE_COMPOSITION_LAYER_PROJECTION) \ _(XrCompositionLayerQuad, XR_TYPE_COMPOSITION_LAYER_QUAD) \ _(XrEventDataEventsLost, XR_TYPE_EVENT_DATA_EVENTS_LOST) \ _(XrEventDataInstanceLossPending, XR_TYPE_EVENT_DATA_INSTANCE_LOSS_PENDING) \ _(XrEventDataSessionStateChanged, XR_TYPE_EVENT_DATA_SESSION_STATE_CHANGED) \ _(XrEventDataReferenceSpaceChangePending, XR_TYPE_EVENT_DATA_REFERENCE_SPACE_CHANGE_PENDING) \ _(XrEventDataInteractionProfileChanged, XR_TYPE_EVENT_DATA_INTERACTION_PROFILE_CHANGED) \ _(XrHapticVibration, XR_TYPE_HAPTIC_VIBRATION) \ _(XrCompositionLayerCubeKHR, XR_TYPE_COMPOSITION_LAYER_CUBE_KHR) \ _(XrCompositionLayerDepthInfoKHR, XR_TYPE_COMPOSITION_LAYER_DEPTH_INFO_KHR) \ _(XrCompositionLayerCylinderKHR, XR_TYPE_COMPOSITION_LAYER_CYLINDER_KHR) \ _(XrCompositionLayerEquirectKHR, XR_TYPE_COMPOSITION_LAYER_EQUIRECT_KHR) \ _(XrVisibilityMaskKHR, XR_TYPE_VISIBILITY_MASK_KHR) \ _(XrEventDataVisibilityMaskChangedKHR, XR_TYPE_EVENT_DATA_VISIBILITY_MASK_CHANGED_KHR) \ _(XrCompositionLayerColorScaleBiasKHR, XR_TYPE_COMPOSITION_LAYER_COLOR_SCALE_BIAS_KHR) \ _(XrCompositionLayerEquirect2KHR, XR_TYPE_COMPOSITION_LAYER_EQUIRECT2_KHR) \ _(XrBindingModificationsKHR, XR_TYPE_BINDING_MODIFICATIONS_KHR) \ _(XrEventDataPerfSettingsEXT, XR_TYPE_EVENT_DATA_PERF_SETTINGS_EXT) \ _(XrDebugUtilsObjectNameInfoEXT, XR_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT) \ _(XrDebugUtilsLabelEXT, XR_TYPE_DEBUG_UTILS_LABEL_EXT) \ _(XrDebugUtilsMessengerCallbackDataEXT, XR_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT) \ _(XrDebugUtilsMessengerCreateInfoEXT, XR_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT) \ _(XrSystemEyeGazeInteractionPropertiesEXT, XR_TYPE_SYSTEM_EYE_GAZE_INTERACTION_PROPERTIES_EXT) \ _(XrEyeGazeSampleTimeEXT, XR_TYPE_EYE_GAZE_SAMPLE_TIME_EXT) \ _(XrSessionCreateInfoOverlayEXTX, XR_TYPE_SESSION_CREATE_INFO_OVERLAY_EXTX) \ _(XrEventDataMainSessionVisibilityChangedEXTX, XR_TYPE_EVENT_DATA_MAIN_SESSION_VISIBILITY_CHANGED_EXTX) \ _(XrSpatialAnchorCreateInfoMSFT, XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_MSFT) \ _(XrSpatialAnchorSpaceCreateInfoMSFT, XR_TYPE_SPATIAL_ANCHOR_SPACE_CREATE_INFO_MSFT) \ _(XrCompositionLayerImageLayoutFB, XR_TYPE_COMPOSITION_LAYER_IMAGE_LAYOUT_FB) \ _(XrCompositionLayerAlphaBlendFB, XR_TYPE_COMPOSITION_LAYER_ALPHA_BLEND_FB) \ _(XrViewConfigurationDepthRangeEXT, XR_TYPE_VIEW_CONFIGURATION_DEPTH_RANGE_EXT) \ _(XrSpatialGraphNodeSpaceCreateInfoMSFT, XR_TYPE_SPATIAL_GRAPH_NODE_SPACE_CREATE_INFO_MSFT) \ _(XrSystemHandTrackingPropertiesEXT, XR_TYPE_SYSTEM_HAND_TRACKING_PROPERTIES_EXT) \ _(XrHandTrackerCreateInfoEXT, XR_TYPE_HAND_TRACKER_CREATE_INFO_EXT) \ _(XrHandJointsLocateInfoEXT, XR_TYPE_HAND_JOINTS_LOCATE_INFO_EXT) \ _(XrHandJointLocationsEXT, XR_TYPE_HAND_JOINT_LOCATIONS_EXT) \ _(XrHandJointVelocitiesEXT, XR_TYPE_HAND_JOINT_VELOCITIES_EXT) \ _(XrSystemHandTrackingMeshPropertiesMSFT, XR_TYPE_SYSTEM_HAND_TRACKING_MESH_PROPERTIES_MSFT) \ _(XrHandMeshSpaceCreateInfoMSFT, XR_TYPE_HAND_MESH_SPACE_CREATE_INFO_MSFT) \ _(XrHandMeshUpdateInfoMSFT, XR_TYPE_HAND_MESH_UPDATE_INFO_MSFT) \ _(XrHandMeshMSFT, XR_TYPE_HAND_MESH_MSFT) \ _(XrHandPoseTypeInfoMSFT, XR_TYPE_HAND_POSE_TYPE_INFO_MSFT) \ _(XrSecondaryViewConfigurationSessionBeginInfoMSFT, XR_TYPE_SECONDARY_VIEW_CONFIGURATION_SESSION_BEGIN_INFO_MSFT) \ _(XrSecondaryViewConfigurationStateMSFT, XR_TYPE_SECONDARY_VIEW_CONFIGURATION_STATE_MSFT) \ _(XrSecondaryViewConfigurationFrameStateMSFT, XR_TYPE_SECONDARY_VIEW_CONFIGURATION_FRAME_STATE_MSFT) \ _(XrSecondaryViewConfigurationLayerInfoMSFT, XR_TYPE_SECONDARY_VIEW_CONFIGURATION_LAYER_INFO_MSFT) \ _(XrSecondaryViewConfigurationFrameEndInfoMSFT, XR_TYPE_SECONDARY_VIEW_CONFIGURATION_FRAME_END_INFO_MSFT) \ _(XrSecondaryViewConfigurationSwapchainCreateInfoMSFT, XR_TYPE_SECONDARY_VIEW_CONFIGURATION_SWAPCHAIN_CREATE_INFO_MSFT) \ _(XrControllerModelKeyStateMSFT, XR_TYPE_CONTROLLER_MODEL_KEY_STATE_MSFT) \ _(XrControllerModelNodePropertiesMSFT, XR_TYPE_CONTROLLER_MODEL_NODE_PROPERTIES_MSFT) \ _(XrControllerModelPropertiesMSFT, XR_TYPE_CONTROLLER_MODEL_PROPERTIES_MSFT) \ _(XrControllerModelNodeStateMSFT, XR_TYPE_CONTROLLER_MODEL_NODE_STATE_MSFT) \ _(XrControllerModelStateMSFT, XR_TYPE_CONTROLLER_MODEL_STATE_MSFT) \ _(XrViewConfigurationViewFovEPIC, XR_TYPE_VIEW_CONFIGURATION_VIEW_FOV_EPIC) \ _(XrCompositionLayerReprojectionInfoMSFT, XR_TYPE_COMPOSITION_LAYER_REPROJECTION_INFO_MSFT) \ _(XrCompositionLayerReprojectionPlaneOverrideMSFT, XR_TYPE_COMPOSITION_LAYER_REPROJECTION_PLANE_OVERRIDE_MSFT) \ _(XrCompositionLayerSecureContentFB, XR_TYPE_COMPOSITION_LAYER_SECURE_CONTENT_FB) \ _(XrInteractionProfileAnalogThresholdVALVE, XR_TYPE_INTERACTION_PROFILE_ANALOG_THRESHOLD_VALVE) \ _(XrHandJointsMotionRangeInfoEXT, XR_TYPE_HAND_JOINTS_MOTION_RANGE_INFO_EXT) \ _(XrSceneObserverCreateInfoMSFT, XR_TYPE_SCENE_OBSERVER_CREATE_INFO_MSFT) \ _(XrSceneCreateInfoMSFT, XR_TYPE_SCENE_CREATE_INFO_MSFT) \ _(XrNewSceneComputeInfoMSFT, XR_TYPE_NEW_SCENE_COMPUTE_INFO_MSFT) \ _(XrVisualMeshComputeLodInfoMSFT, XR_TYPE_VISUAL_MESH_COMPUTE_LOD_INFO_MSFT) \ _(XrSceneComponentsMSFT, XR_TYPE_SCENE_COMPONENTS_MSFT) \ _(XrSceneComponentsGetInfoMSFT, XR_TYPE_SCENE_COMPONENTS_GET_INFO_MSFT) \ _(XrSceneComponentLocationsMSFT, XR_TYPE_SCENE_COMPONENT_LOCATIONS_MSFT) \ _(XrSceneComponentsLocateInfoMSFT, XR_TYPE_SCENE_COMPONENTS_LOCATE_INFO_MSFT) \ _(XrSceneObjectsMSFT, XR_TYPE_SCENE_OBJECTS_MSFT) \ _(XrSceneComponentParentFilterInfoMSFT, XR_TYPE_SCENE_COMPONENT_PARENT_FILTER_INFO_MSFT) \ _(XrSceneObjectTypesFilterInfoMSFT, XR_TYPE_SCENE_OBJECT_TYPES_FILTER_INFO_MSFT) \ _(XrScenePlanesMSFT, XR_TYPE_SCENE_PLANES_MSFT) \ _(XrScenePlaneAlignmentFilterInfoMSFT, XR_TYPE_SCENE_PLANE_ALIGNMENT_FILTER_INFO_MSFT) \ _(XrSceneMeshesMSFT, XR_TYPE_SCENE_MESHES_MSFT) \ _(XrSceneMeshBuffersGetInfoMSFT, XR_TYPE_SCENE_MESH_BUFFERS_GET_INFO_MSFT) \ _(XrSceneMeshBuffersMSFT, XR_TYPE_SCENE_MESH_BUFFERS_MSFT) \ _(XrSceneMeshVertexBufferMSFT, XR_TYPE_SCENE_MESH_VERTEX_BUFFER_MSFT) \ _(XrSceneMeshIndicesUint32MSFT, XR_TYPE_SCENE_MESH_INDICES_UINT32_MSFT) \ _(XrSceneMeshIndicesUint16MSFT, XR_TYPE_SCENE_MESH_INDICES_UINT16_MSFT) \ _(XrSerializedSceneFragmentDataGetInfoMSFT, XR_TYPE_SERIALIZED_SCENE_FRAGMENT_DATA_GET_INFO_MSFT) \ _(XrSceneDeserializeInfoMSFT, XR_TYPE_SCENE_DESERIALIZE_INFO_MSFT) \ _(XrEventDataDisplayRefreshRateChangedFB, XR_TYPE_EVENT_DATA_DISPLAY_REFRESH_RATE_CHANGED_FB) \ _(XrViveTrackerPathsHTCX, XR_TYPE_VIVE_TRACKER_PATHS_HTCX) \ _(XrEventDataViveTrackerConnectedHTCX, XR_TYPE_EVENT_DATA_VIVE_TRACKER_CONNECTED_HTCX) \ _(XrSystemColorSpacePropertiesFB, XR_TYPE_SYSTEM_COLOR_SPACE_PROPERTIES_FB) \ _(XrHandTrackingMeshFB, XR_TYPE_HAND_TRACKING_MESH_FB) \ _(XrHandTrackingScaleFB, XR_TYPE_HAND_TRACKING_SCALE_FB) \ _(XrHandTrackingAimStateFB, XR_TYPE_HAND_TRACKING_AIM_STATE_FB) \ _(XrHandTrackingCapsulesStateFB, XR_TYPE_HAND_TRACKING_CAPSULES_STATE_FB) \ _(XrFoveationProfileCreateInfoFB, XR_TYPE_FOVEATION_PROFILE_CREATE_INFO_FB) \ _(XrSwapchainCreateInfoFoveationFB, XR_TYPE_SWAPCHAIN_CREATE_INFO_FOVEATION_FB) \ _(XrSwapchainStateFoveationFB, XR_TYPE_SWAPCHAIN_STATE_FOVEATION_FB) \ _(XrFoveationLevelProfileCreateInfoFB, XR_TYPE_FOVEATION_LEVEL_PROFILE_CREATE_INFO_FB) \ _(XrTriangleMeshCreateInfoFB, XR_TYPE_TRIANGLE_MESH_CREATE_INFO_FB) \ _(XrSystemPassthroughPropertiesFB, XR_TYPE_SYSTEM_PASSTHROUGH_PROPERTIES_FB) \ _(XrPassthroughCreateInfoFB, XR_TYPE_PASSTHROUGH_CREATE_INFO_FB) \ _(XrPassthroughLayerCreateInfoFB, XR_TYPE_PASSTHROUGH_LAYER_CREATE_INFO_FB) \ _(XrCompositionLayerPassthroughFB, XR_TYPE_COMPOSITION_LAYER_PASSTHROUGH_FB) \ _(XrGeometryInstanceCreateInfoFB, XR_TYPE_GEOMETRY_INSTANCE_CREATE_INFO_FB) \ _(XrGeometryInstanceTransformFB, XR_TYPE_GEOMETRY_INSTANCE_TRANSFORM_FB) \ _(XrPassthroughStyleFB, XR_TYPE_PASSTHROUGH_STYLE_FB) \ _(XrPassthroughColorMapMonoToRgbaFB, XR_TYPE_PASSTHROUGH_COLOR_MAP_MONO_TO_RGBA_FB) \ _(XrPassthroughColorMapMonoToMonoFB, XR_TYPE_PASSTHROUGH_COLOR_MAP_MONO_TO_MONO_FB) \ _(XrEventDataPassthroughStateChangedFB, XR_TYPE_EVENT_DATA_PASSTHROUGH_STATE_CHANGED_FB) \ _(XrViewLocateFoveatedRenderingVARJO, XR_TYPE_VIEW_LOCATE_FOVEATED_RENDERING_VARJO) \ _(XrFoveatedViewConfigurationViewVARJO, XR_TYPE_FOVEATED_VIEW_CONFIGURATION_VIEW_VARJO) \ _(XrSystemFoveatedRenderingPropertiesVARJO, XR_TYPE_SYSTEM_FOVEATED_RENDERING_PROPERTIES_VARJO) \ _(XrCompositionLayerDepthTestVARJO, XR_TYPE_COMPOSITION_LAYER_DEPTH_TEST_VARJO) \ _(XrSystemMarkerTrackingPropertiesVARJO, XR_TYPE_SYSTEM_MARKER_TRACKING_PROPERTIES_VARJO) \ _(XrEventDataMarkerTrackingUpdateVARJO, XR_TYPE_EVENT_DATA_MARKER_TRACKING_UPDATE_VARJO) \ _(XrMarkerSpaceCreateInfoVARJO, XR_TYPE_MARKER_SPACE_CREATE_INFO_VARJO) \ _(XrSpatialAnchorPersistenceInfoMSFT, XR_TYPE_SPATIAL_ANCHOR_PERSISTENCE_INFO_MSFT) \ _(XrSpatialAnchorFromPersistedAnchorCreateInfoMSFT, XR_TYPE_SPATIAL_ANCHOR_FROM_PERSISTED_ANCHOR_CREATE_INFO_MSFT) \ _(XrCompositionLayerSpaceWarpInfoFB, XR_TYPE_COMPOSITION_LAYER_SPACE_WARP_INFO_FB) \ _(XrSystemSpaceWarpPropertiesFB, XR_TYPE_SYSTEM_SPACE_WARP_PROPERTIES_FB) \ #if defined(XR_USE_GRAPHICS_API_D3D11) #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_D3D11(_) \ _(XrGraphicsBindingD3D11KHR, XR_TYPE_GRAPHICS_BINDING_D3D11_KHR) \ _(XrSwapchainImageD3D11KHR, XR_TYPE_SWAPCHAIN_IMAGE_D3D11_KHR) \ _(XrGraphicsRequirementsD3D11KHR, XR_TYPE_GRAPHICS_REQUIREMENTS_D3D11_KHR) \ #else #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_D3D11(_) #endif #if defined(XR_USE_GRAPHICS_API_D3D12) #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_D3D12(_) \ _(XrGraphicsBindingD3D12KHR, XR_TYPE_GRAPHICS_BINDING_D3D12_KHR) \ _(XrSwapchainImageD3D12KHR, XR_TYPE_SWAPCHAIN_IMAGE_D3D12_KHR) \ _(XrGraphicsRequirementsD3D12KHR, XR_TYPE_GRAPHICS_REQUIREMENTS_D3D12_KHR) \ #else #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_D3D12(_) #endif #if defined(XR_USE_GRAPHICS_API_OPENGL) #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL(_) \ _(XrSwapchainImageOpenGLKHR, XR_TYPE_SWAPCHAIN_IMAGE_OPENGL_KHR) \ _(XrGraphicsRequirementsOpenGLKHR, XR_TYPE_GRAPHICS_REQUIREMENTS_OPENGL_KHR) \ #else #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL(_) #endif #if defined(XR_USE_GRAPHICS_API_OPENGL) && defined(XR_USE_PLATFORM_WAYLAND) #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_XR_USE_PLATFORM_WAYLAND(_) \ _(XrGraphicsBindingOpenGLWaylandKHR, XR_TYPE_GRAPHICS_BINDING_OPENGL_WAYLAND_KHR) \ #else #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_XR_USE_PLATFORM_WAYLAND(_) #endif #if defined(XR_USE_GRAPHICS_API_OPENGL) && defined(XR_USE_PLATFORM_WIN32) #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_XR_USE_PLATFORM_WIN32(_) \ _(XrGraphicsBindingOpenGLWin32KHR, XR_TYPE_GRAPHICS_BINDING_OPENGL_WIN32_KHR) \ #else #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_XR_USE_PLATFORM_WIN32(_) #endif #if defined(XR_USE_GRAPHICS_API_OPENGL) && defined(XR_USE_PLATFORM_XCB) #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_XR_USE_PLATFORM_XCB(_) \ _(XrGraphicsBindingOpenGLXcbKHR, XR_TYPE_GRAPHICS_BINDING_OPENGL_XCB_KHR) \ #else #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_XR_USE_PLATFORM_XCB(_) #endif #if defined(XR_USE_GRAPHICS_API_OPENGL) && defined(XR_USE_PLATFORM_XLIB) #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_XR_USE_PLATFORM_XLIB(_) \ _(XrGraphicsBindingOpenGLXlibKHR, XR_TYPE_GRAPHICS_BINDING_OPENGL_XLIB_KHR) \ #else #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_XR_USE_PLATFORM_XLIB(_) #endif #if defined(XR_USE_GRAPHICS_API_OPENGL_ES) #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_ES(_) \ _(XrSwapchainImageOpenGLESKHR, XR_TYPE_SWAPCHAIN_IMAGE_OPENGL_ES_KHR) \ _(XrGraphicsRequirementsOpenGLESKHR, XR_TYPE_GRAPHICS_REQUIREMENTS_OPENGL_ES_KHR) \ _(XrSwapchainStateSamplerOpenGLESFB, XR_TYPE_SWAPCHAIN_STATE_SAMPLER_OPENGL_ES_FB) \ #else #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_ES(_) #endif #if defined(XR_USE_GRAPHICS_API_OPENGL_ES) && defined(XR_USE_PLATFORM_ANDROID) #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_ES_XR_USE_PLATFORM_ANDROID(_) \ _(XrGraphicsBindingOpenGLESAndroidKHR, XR_TYPE_GRAPHICS_BINDING_OPENGL_ES_ANDROID_KHR) \ #else #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_ES_XR_USE_PLATFORM_ANDROID(_) #endif #if defined(XR_USE_GRAPHICS_API_VULKAN) #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_VULKAN(_) \ _(XrVulkanSwapchainFormatListCreateInfoKHR, XR_TYPE_VULKAN_SWAPCHAIN_FORMAT_LIST_CREATE_INFO_KHR) \ _(XrGraphicsBindingVulkanKHR, XR_TYPE_GRAPHICS_BINDING_VULKAN_KHR) \ _(XrSwapchainImageVulkanKHR, XR_TYPE_SWAPCHAIN_IMAGE_VULKAN_KHR) \ _(XrGraphicsRequirementsVulkanKHR, XR_TYPE_GRAPHICS_REQUIREMENTS_VULKAN_KHR) \ _(XrVulkanInstanceCreateInfoKHR, XR_TYPE_VULKAN_INSTANCE_CREATE_INFO_KHR) \ _(XrVulkanDeviceCreateInfoKHR, XR_TYPE_VULKAN_DEVICE_CREATE_INFO_KHR) \ _(XrVulkanGraphicsDeviceGetInfoKHR, XR_TYPE_VULKAN_GRAPHICS_DEVICE_GET_INFO_KHR) \ _(XrSwapchainImageFoveationVulkanFB, XR_TYPE_SWAPCHAIN_IMAGE_FOVEATION_VULKAN_FB) \ _(XrSwapchainStateSamplerVulkanFB, XR_TYPE_SWAPCHAIN_STATE_SAMPLER_VULKAN_FB) \ #else #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_VULKAN(_) #endif #if defined(XR_USE_PLATFORM_ANDROID) #define XR_LIST_STRUCTURE_TYPES_XR_USE_PLATFORM_ANDROID(_) \ _(XrInstanceCreateInfoAndroidKHR, XR_TYPE_INSTANCE_CREATE_INFO_ANDROID_KHR) \ _(XrLoaderInitInfoAndroidKHR, XR_TYPE_LOADER_INIT_INFO_ANDROID_KHR) \ _(XrAndroidSurfaceSwapchainCreateInfoFB, XR_TYPE_ANDROID_SURFACE_SWAPCHAIN_CREATE_INFO_FB) \ _(XrSwapchainStateAndroidSurfaceDimensionsFB, XR_TYPE_SWAPCHAIN_STATE_ANDROID_SURFACE_DIMENSIONS_FB) \ #else #define XR_LIST_STRUCTURE_TYPES_XR_USE_PLATFORM_ANDROID(_) #endif #if defined(XR_USE_PLATFORM_EGL) #define XR_LIST_STRUCTURE_TYPES_XR_USE_PLATFORM_EGL(_) \ _(XrGraphicsBindingEGLMNDX, XR_TYPE_GRAPHICS_BINDING_EGL_MNDX) \ #else #define XR_LIST_STRUCTURE_TYPES_XR_USE_PLATFORM_EGL(_) #endif #if defined(XR_USE_PLATFORM_WIN32) #define XR_LIST_STRUCTURE_TYPES_XR_USE_PLATFORM_WIN32(_) \ _(XrHolographicWindowAttachmentMSFT, XR_TYPE_HOLOGRAPHIC_WINDOW_ATTACHMENT_MSFT) \ #else #define XR_LIST_STRUCTURE_TYPES_XR_USE_PLATFORM_WIN32(_) #endif #define XR_LIST_STRUCTURE_TYPES(_) \ XR_LIST_STRUCTURE_TYPES_CORE(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_D3D11(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_D3D12(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_XR_USE_PLATFORM_WAYLAND(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_XR_USE_PLATFORM_WIN32(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_XR_USE_PLATFORM_XCB(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_XR_USE_PLATFORM_XLIB(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_ES(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_ES_XR_USE_PLATFORM_ANDROID(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_VULKAN(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_PLATFORM_ANDROID(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_PLATFORM_EGL(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_PLATFORM_WIN32(_) \ #define XR_LIST_EXTENSIONS(_) \ _(XR_KHR_android_thread_settings, 4) \ _(XR_KHR_android_surface_swapchain, 5) \ _(XR_KHR_composition_layer_cube, 7) \ _(XR_KHR_android_create_instance, 9) \ _(XR_KHR_composition_layer_depth, 11) \ _(XR_KHR_vulkan_swapchain_format_list, 15) \ _(XR_EXT_performance_settings, 16) \ _(XR_EXT_thermal_query, 17) \ _(XR_KHR_composition_layer_cylinder, 18) \ _(XR_KHR_composition_layer_equirect, 19) \ _(XR_EXT_debug_utils, 20) \ _(XR_KHR_opengl_enable, 24) \ _(XR_KHR_opengl_es_enable, 25) \ _(XR_KHR_vulkan_enable, 26) \ _(XR_KHR_D3D11_enable, 28) \ _(XR_KHR_D3D12_enable, 29) \ _(XR_EXT_eye_gaze_interaction, 31) \ _(XR_KHR_visibility_mask, 32) \ _(XR_EXTX_overlay, 34) \ _(XR_KHR_composition_layer_color_scale_bias, 35) \ _(XR_KHR_win32_convert_performance_counter_time, 36) \ _(XR_KHR_convert_timespec_time, 37) \ _(XR_VARJO_quad_views, 38) \ _(XR_MSFT_unbounded_reference_space, 39) \ _(XR_MSFT_spatial_anchor, 40) \ _(XR_FB_composition_layer_image_layout, 41) \ _(XR_FB_composition_layer_alpha_blend, 42) \ _(XR_MND_headless, 43) \ _(XR_OCULUS_android_session_state_enable, 45) \ _(XR_EXT_view_configuration_depth_range, 47) \ _(XR_EXT_conformance_automation, 48) \ _(XR_MNDX_egl_enable, 49) \ _(XR_MSFT_spatial_graph_bridge, 50) \ _(XR_MSFT_hand_interaction, 51) \ _(XR_EXT_hand_tracking, 52) \ _(XR_MSFT_hand_tracking_mesh, 53) \ _(XR_MSFT_secondary_view_configuration, 54) \ _(XR_MSFT_first_person_observer, 55) \ _(XR_MSFT_controller_model, 56) \ _(XR_MSFT_perception_anchor_interop, 57) \ _(XR_EXT_win32_appcontainer_compatible, 58) \ _(XR_EPIC_view_configuration_fov, 60) \ _(XR_MSFT_holographic_window_attachment, 64) \ _(XR_MSFT_composition_layer_reprojection, 67) \ _(XR_HUAWEI_controller_interaction, 70) \ _(XR_FB_android_surface_swapchain_create, 71) \ _(XR_FB_swapchain_update_state, 72) \ _(XR_FB_composition_layer_secure_content, 73) \ _(XR_VALVE_analog_threshold, 80) \ _(XR_EXT_hand_joints_motion_range, 81) \ _(XR_KHR_loader_init, 89) \ _(XR_KHR_loader_init_android, 90) \ _(XR_KHR_vulkan_enable2, 91) \ _(XR_KHR_composition_layer_equirect2, 92) \ _(XR_EXT_samsung_odyssey_controller, 95) \ _(XR_EXT_hp_mixed_reality_controller, 96) \ _(XR_MND_swapchain_usage_input_attachment_bit, 97) \ _(XR_MSFT_scene_understanding, 98) \ _(XR_MSFT_scene_understanding_serialization, 99) \ _(XR_FB_display_refresh_rate, 102) \ _(XR_HTC_vive_cosmos_controller_interaction, 103) \ _(XR_HTCX_vive_tracker_interaction, 104) \ _(XR_FB_color_space, 109) \ _(XR_FB_hand_tracking_mesh, 111) \ _(XR_FB_hand_tracking_aim, 112) \ _(XR_FB_hand_tracking_capsules, 113) \ _(XR_FB_foveation, 115) \ _(XR_FB_foveation_configuration, 116) \ _(XR_FB_triangle_mesh, 118) \ _(XR_FB_passthrough, 119) \ _(XR_KHR_binding_modification, 121) \ _(XR_VARJO_foveated_rendering, 122) \ _(XR_VARJO_composition_layer_depth_test, 123) \ _(XR_VARJO_environment_depth_estimation, 124) \ _(XR_VARJO_marker_tracking, 125) \ _(XR_MSFT_spatial_anchor_persistence, 143) \ _(XR_OCULUS_audio_device_guid, 160) \ _(XR_FB_foveation_vulkan, 161) \ _(XR_FB_swapchain_update_state_android_surface, 162) \ _(XR_FB_swapchain_update_state_opengl_es, 163) \ _(XR_FB_swapchain_update_state_vulkan, 164) \ _(XR_KHR_swapchain_usage_input_attachment_bit, 166) \ _(XR_FB_space_warp, 172) \ #endif
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/sources/thirdparty/openxr/include/openxr/xr_dependencies.h
// Copyright (c) 2018-2022, The Khronos Group Inc. // // SPDX-License-Identifier: Apache-2.0 OR MIT // // This file includes headers with types which openxr.h depends on in order // to compile when platforms, graphics apis, and the like are enabled. #pragma once #ifdef XR_USE_PLATFORM_ANDROID #include <android/native_window.h> #include <android/window.h> #include <android/native_window_jni.h> #endif // XR_USE_PLATFORM_ANDROID #ifdef XR_USE_PLATFORM_WIN32 #include <winapifamily.h> #if !(WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)) // Enable desktop partition APIs, such as RegOpenKeyEx, LoadLibraryEx, PathFileExists etc. #undef WINAPI_PARTITION_DESKTOP #define WINAPI_PARTITION_DESKTOP 1 #endif #ifndef NOMINMAX #define NOMINMAX #endif // !NOMINMAX #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif // !WIN32_LEAN_AND_MEAN #include <windows.h> #include <unknwn.h> #endif // XR_USE_PLATFORM_WIN32 #ifdef XR_USE_GRAPHICS_API_D3D11 #include <d3d11.h> #endif // XR_USE_GRAPHICS_API_D3D11 #ifdef XR_USE_GRAPHICS_API_D3D12 #include <d3d12.h> #endif // XR_USE_GRAPHICS_API_D3D12 #ifdef XR_USE_PLATFORM_XLIB #include <X11/Xlib.h> #include <X11/Xutil.h> #ifdef Success #undef Success #endif // Success #ifdef Always #undef Always #endif // Always #ifdef None #undef None #endif // None #endif // XR_USE_PLATFORM_XLIB #ifdef XR_USE_PLATFORM_XCB #include <xcb/xcb.h> #endif // XR_USE_PLATFORM_XCB #ifdef XR_USE_GRAPHICS_API_OPENGL #if defined(XR_USE_PLATFORM_XLIB) || defined(XR_USE_PLATFORM_XCB) #include <GL/glx.h> #endif // (XR_USE_PLATFORM_XLIB || XR_USE_PLATFORM_XCB) #ifdef XR_USE_PLATFORM_XCB #include <xcb/glx.h> #endif // XR_USE_PLATFORM_XCB #ifdef XR_USE_PLATFORM_MACOS #include <CL/cl_gl_ext.h> #endif // XR_USE_PLATFORM_MACOS #endif // XR_USE_GRAPHICS_API_OPENGL #ifdef XR_USE_GRAPHICS_API_OPENGL_ES #include <EGL/egl.h> #endif // XR_USE_GRAPHICS_API_OPENGL_ES #ifdef XR_USE_GRAPHICS_API_VULKAN #include <vulkan/vulkan.h> #endif // XR_USE_GRAPHICS_API_VULKAN #ifdef XR_USE_PLATFORM_WAYLAND #include "wayland-client.h" #endif // XR_USE_PLATFORM_WAYLAND
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/sources/thirdparty/pybind11/iostream.h
/* pybind11/iostream.h -- Tools to assist with redirecting cout and cerr to Python Copyright (c) 2017 Henry F. Schreiner All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. WARNING: The implementation in this file is NOT thread safe. Multiple threads writing to a redirected ostream concurrently cause data races and potentially buffer overflows. Therefore it is currently a requirement that all (possibly) concurrent redirected ostream writes are protected by a mutex. #HelpAppreciated: Work on iostream.h thread safety. For more background see the discussions under https://github.com/pybind/pybind11/pull/2982 and https://github.com/pybind/pybind11/pull/2995. */ #pragma once #include "pybind11.h" #include <algorithm> #include <cstring> #include <iostream> #include <iterator> #include <memory> #include <ostream> #include <streambuf> #include <string> #include <utility> PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) PYBIND11_NAMESPACE_BEGIN(detail) // Buffer that writes to Python instead of C++ class pythonbuf : public std::streambuf { private: using traits_type = std::streambuf::traits_type; const size_t buf_size; std::unique_ptr<char[]> d_buffer; object pywrite; object pyflush; int overflow(int c) override { if (!traits_type::eq_int_type(c, traits_type::eof())) { *pptr() = traits_type::to_char_type(c); pbump(1); } return sync() == 0 ? traits_type::not_eof(c) : traits_type::eof(); } // Computes how many bytes at the end of the buffer are part of an // incomplete sequence of UTF-8 bytes. // Precondition: pbase() < pptr() size_t utf8_remainder() const { const auto rbase = std::reverse_iterator<char *>(pbase()); const auto rpptr = std::reverse_iterator<char *>(pptr()); auto is_ascii = [](char c) { return (static_cast<unsigned char>(c) & 0x80) == 0x00; }; auto is_leading = [](char c) { return (static_cast<unsigned char>(c) & 0xC0) == 0xC0; }; auto is_leading_2b = [](char c) { return static_cast<unsigned char>(c) <= 0xDF; }; auto is_leading_3b = [](char c) { return static_cast<unsigned char>(c) <= 0xEF; }; // If the last character is ASCII, there are no incomplete code points if (is_ascii(*rpptr)) return 0; // Otherwise, work back from the end of the buffer and find the first // UTF-8 leading byte const auto rpend = rbase - rpptr >= 3 ? rpptr + 3 : rbase; const auto leading = std::find_if(rpptr, rpend, is_leading); if (leading == rbase) return 0; const auto dist = static_cast<size_t>(leading - rpptr); size_t remainder = 0; if (dist == 0) remainder = 1; // 1-byte code point is impossible else if (dist == 1) remainder = is_leading_2b(*leading) ? 0 : dist + 1; else if (dist == 2) remainder = is_leading_3b(*leading) ? 0 : dist + 1; // else if (dist >= 3), at least 4 bytes before encountering an UTF-8 // leading byte, either no remainder or invalid UTF-8. // Invalid UTF-8 will cause an exception later when converting // to a Python string, so that's not handled here. return remainder; } // This function must be non-virtual to be called in a destructor. int _sync() { if (pbase() != pptr()) { // If buffer is not empty gil_scoped_acquire tmp; // This subtraction cannot be negative, so dropping the sign. auto size = static_cast<size_t>(pptr() - pbase()); size_t remainder = utf8_remainder(); if (size > remainder) { str line(pbase(), size - remainder); pywrite(line); pyflush(); } // Copy the remainder at the end of the buffer to the beginning: if (remainder > 0) std::memmove(pbase(), pptr() - remainder, remainder); setp(pbase(), epptr()); pbump(static_cast<int>(remainder)); } return 0; } int sync() override { return _sync(); } public: explicit pythonbuf(const object &pyostream, size_t buffer_size = 1024) : buf_size(buffer_size), d_buffer(new char[buf_size]), pywrite(pyostream.attr("write")), pyflush(pyostream.attr("flush")) { setp(d_buffer.get(), d_buffer.get() + buf_size - 1); } pythonbuf(pythonbuf&&) = default; /// Sync before destroy ~pythonbuf() override { _sync(); } }; PYBIND11_NAMESPACE_END(detail) /** \rst This a move-only guard that redirects output. .. code-block:: cpp #include <pybind11/iostream.h> ... { py::scoped_ostream_redirect output; std::cout << "Hello, World!"; // Python stdout } // <-- return std::cout to normal You can explicitly pass the c++ stream and the python object, for example to guard stderr instead. .. code-block:: cpp { py::scoped_ostream_redirect output{std::cerr, py::module::import("sys").attr("stderr")}; std::cout << "Hello, World!"; } \endrst */ class scoped_ostream_redirect { protected: std::streambuf *old; std::ostream &costream; detail::pythonbuf buffer; public: explicit scoped_ostream_redirect(std::ostream &costream = std::cout, const object &pyostream = module_::import("sys").attr("stdout")) : costream(costream), buffer(pyostream) { old = costream.rdbuf(&buffer); } ~scoped_ostream_redirect() { costream.rdbuf(old); } scoped_ostream_redirect(const scoped_ostream_redirect &) = delete; scoped_ostream_redirect(scoped_ostream_redirect &&other) = default; scoped_ostream_redirect &operator=(const scoped_ostream_redirect &) = delete; scoped_ostream_redirect &operator=(scoped_ostream_redirect &&) = delete; }; /** \rst Like `scoped_ostream_redirect`, but redirects cerr by default. This class is provided primary to make ``py::call_guard`` easier to make. .. code-block:: cpp m.def("noisy_func", &noisy_func, py::call_guard<scoped_ostream_redirect, scoped_estream_redirect>()); \endrst */ class scoped_estream_redirect : public scoped_ostream_redirect { public: explicit scoped_estream_redirect(std::ostream &costream = std::cerr, const object &pyostream = module_::import("sys").attr("stderr")) : scoped_ostream_redirect(costream, pyostream) {} }; PYBIND11_NAMESPACE_BEGIN(detail) // Class to redirect output as a context manager. C++ backend. class OstreamRedirect { bool do_stdout_; bool do_stderr_; std::unique_ptr<scoped_ostream_redirect> redirect_stdout; std::unique_ptr<scoped_estream_redirect> redirect_stderr; public: explicit OstreamRedirect(bool do_stdout = true, bool do_stderr = true) : do_stdout_(do_stdout), do_stderr_(do_stderr) {} void enter() { if (do_stdout_) redirect_stdout.reset(new scoped_ostream_redirect()); if (do_stderr_) redirect_stderr.reset(new scoped_estream_redirect()); } void exit() { redirect_stdout.reset(); redirect_stderr.reset(); } }; PYBIND11_NAMESPACE_END(detail) /** \rst This is a helper function to add a C++ redirect context manager to Python instead of using a C++ guard. To use it, add the following to your binding code: .. code-block:: cpp #include <pybind11/iostream.h> ... py::add_ostream_redirect(m, "ostream_redirect"); You now have a Python context manager that redirects your output: .. code-block:: python with m.ostream_redirect(): m.print_to_cout_function() This manager can optionally be told which streams to operate on: .. code-block:: python with m.ostream_redirect(stdout=true, stderr=true): m.noisy_function_with_error_printing() \endrst */ inline class_<detail::OstreamRedirect> add_ostream_redirect(module_ m, const std::string &name = "ostream_redirect") { return class_<detail::OstreamRedirect>(std::move(m), name.c_str(), module_local()) .def(init<bool, bool>(), arg("stdout") = true, arg("stderr") = true) .def("__enter__", &detail::OstreamRedirect::enter) .def("__exit__", [](detail::OstreamRedirect &self_, const args &) { self_.exit(); }); } PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/sources/thirdparty/pybind11/pybind11.h
/* pybind11/pybind11.h: Main header file of the C++11 python binding generator library Copyright (c) 2016 Wenzel Jakob <[email protected]> All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. */ #pragma once #include "attr.h" #include "gil.h" #include "options.h" #include "detail/class.h" #include "detail/init.h" #include <memory> #include <new> #include <vector> #include <string> #include <utility> #include <string.h> #if defined(__cpp_lib_launder) && !(defined(_MSC_VER) && (_MSC_VER < 1914)) # define PYBIND11_STD_LAUNDER std::launder # define PYBIND11_HAS_STD_LAUNDER 1 #else # define PYBIND11_STD_LAUNDER # define PYBIND11_HAS_STD_LAUNDER 0 #endif #if defined(__GNUG__) && !defined(__clang__) # include <cxxabi.h> #endif /* https://stackoverflow.com/questions/46798456/handling-gccs-noexcept-type-warning This warning is about ABI compatibility, not code health. It is only actually needed in a couple places, but apparently GCC 7 "generates this warning if and only if the first template instantiation ... involves noexcept" [stackoverflow], therefore it could get triggered from seemingly random places, depending on user code. No other GCC version generates this warning. */ #if defined(__GNUC__) && __GNUC__ == 7 # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wnoexcept-type" #endif PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) PYBIND11_NAMESPACE_BEGIN(detail) // Apply all the extensions translators from a list // Return true if one of the translators completed without raising an exception // itself. Return of false indicates that if there are other translators // available, they should be tried. inline bool apply_exception_translators(std::forward_list<ExceptionTranslator>& translators) { auto last_exception = std::current_exception(); for (auto &translator : translators) { try { translator(last_exception); return true; } catch (...) { last_exception = std::current_exception(); } } return false; } #if defined(_MSC_VER) # define PYBIND11_COMPAT_STRDUP _strdup #else # define PYBIND11_COMPAT_STRDUP strdup #endif PYBIND11_NAMESPACE_END(detail) /// Wraps an arbitrary C++ function/method/lambda function/.. into a callable Python object class cpp_function : public function { public: cpp_function() = default; // NOLINTNEXTLINE(google-explicit-constructor) cpp_function(std::nullptr_t) { } /// Construct a cpp_function from a vanilla function pointer template <typename Return, typename... Args, typename... Extra> // NOLINTNEXTLINE(google-explicit-constructor) cpp_function(Return (*f)(Args...), const Extra&... extra) { initialize(f, f, extra...); } /// Construct a cpp_function from a lambda function (possibly with internal state) template <typename Func, typename... Extra, typename = detail::enable_if_t<detail::is_lambda<Func>::value>> // NOLINTNEXTLINE(google-explicit-constructor) cpp_function(Func &&f, const Extra&... extra) { initialize(std::forward<Func>(f), (detail::function_signature_t<Func> *) nullptr, extra...); } /// Construct a cpp_function from a class method (non-const, no ref-qualifier) template <typename Return, typename Class, typename... Arg, typename... Extra> // NOLINTNEXTLINE(google-explicit-constructor) cpp_function(Return (Class::*f)(Arg...), const Extra&... extra) { initialize([f](Class *c, Arg... args) -> Return { return (c->*f)(std::forward<Arg>(args)...); }, (Return (*) (Class *, Arg...)) nullptr, extra...); } /// Construct a cpp_function from a class method (non-const, lvalue ref-qualifier) /// A copy of the overload for non-const functions without explicit ref-qualifier /// but with an added `&`. template <typename Return, typename Class, typename... Arg, typename... Extra> // NOLINTNEXTLINE(google-explicit-constructor) cpp_function(Return (Class::*f)(Arg...)&, const Extra&... extra) { initialize([f](Class *c, Arg... args) -> Return { return (c->*f)(args...); }, (Return (*) (Class *, Arg...)) nullptr, extra...); } /// Construct a cpp_function from a class method (const, no ref-qualifier) template <typename Return, typename Class, typename... Arg, typename... Extra> // NOLINTNEXTLINE(google-explicit-constructor) cpp_function(Return (Class::*f)(Arg...) const, const Extra&... extra) { initialize([f](const Class *c, Arg... args) -> Return { return (c->*f)(std::forward<Arg>(args)...); }, (Return (*)(const Class *, Arg ...)) nullptr, extra...); } /// Construct a cpp_function from a class method (const, lvalue ref-qualifier) /// A copy of the overload for const functions without explicit ref-qualifier /// but with an added `&`. template <typename Return, typename Class, typename... Arg, typename... Extra> // NOLINTNEXTLINE(google-explicit-constructor) cpp_function(Return (Class::*f)(Arg...) const&, const Extra&... extra) { initialize([f](const Class *c, Arg... args) -> Return { return (c->*f)(args...); }, (Return (*)(const Class *, Arg ...)) nullptr, extra...); } /// Return the function name object name() const { return attr("__name__"); } protected: struct InitializingFunctionRecordDeleter { // `destruct(function_record, false)`: `initialize_generic` copies strings and // takes care of cleaning up in case of exceptions. So pass `false` to `free_strings`. void operator()(detail::function_record * rec) { destruct(rec, false); } }; using unique_function_record = std::unique_ptr<detail::function_record, InitializingFunctionRecordDeleter>; /// Space optimization: don't inline this frequently instantiated fragment PYBIND11_NOINLINE unique_function_record make_function_record() { return unique_function_record(new detail::function_record()); } /// Special internal constructor for functors, lambda functions, etc. template <typename Func, typename Return, typename... Args, typename... Extra> void initialize(Func &&f, Return (*)(Args...), const Extra&... extra) { using namespace detail; struct capture { remove_reference_t<Func> f; }; /* Store the function including any extra state it might have (e.g. a lambda capture object) */ // The unique_ptr makes sure nothing is leaked in case of an exception. auto unique_rec = make_function_record(); auto rec = unique_rec.get(); /* Store the capture object directly in the function record if there is enough space */ if (PYBIND11_SILENCE_MSVC_C4127(sizeof(capture) <= sizeof(rec->data))) { /* Without these pragmas, GCC warns that there might not be enough space to use the placement new operator. However, the 'if' statement above ensures that this is the case. */ #if defined(__GNUG__) && __GNUC__ >= 6 && !defined(__clang__) && !defined(__INTEL_COMPILER) # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wplacement-new" #endif new ((capture *) &rec->data) capture { std::forward<Func>(f) }; #if defined(__GNUG__) && __GNUC__ >= 6 && !defined(__clang__) && !defined(__INTEL_COMPILER) # pragma GCC diagnostic pop #endif #if defined(__GNUG__) && !PYBIND11_HAS_STD_LAUNDER && !defined(__INTEL_COMPILER) # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif // UB without std::launder, but without breaking ABI and/or // a significant refactoring it's "impossible" to solve. if (!std::is_trivially_destructible<capture>::value) rec->free_data = [](function_record *r) { auto data = PYBIND11_STD_LAUNDER((capture *) &r->data); (void) data; data->~capture(); }; #if defined(__GNUG__) && !PYBIND11_HAS_STD_LAUNDER && !defined(__INTEL_COMPILER) # pragma GCC diagnostic pop #endif } else { rec->data[0] = new capture { std::forward<Func>(f) }; rec->free_data = [](function_record *r) { delete ((capture *) r->data[0]); }; } /* Type casters for the function arguments and return value */ using cast_in = argument_loader<Args...>; using cast_out = make_caster< conditional_t<std::is_void<Return>::value, void_type, Return> >; static_assert(expected_num_args<Extra...>(sizeof...(Args), cast_in::has_args, cast_in::has_kwargs), "The number of argument annotations does not match the number of function arguments"); /* Dispatch code which converts function arguments and performs the actual function call */ rec->impl = [](function_call &call) -> handle { cast_in args_converter; /* Try to cast the function arguments into the C++ domain */ if (!args_converter.load_args(call)) return PYBIND11_TRY_NEXT_OVERLOAD; /* Invoke call policy pre-call hook */ process_attributes<Extra...>::precall(call); /* Get a pointer to the capture object */ auto data = (sizeof(capture) <= sizeof(call.func.data) ? &call.func.data : call.func.data[0]); auto *cap = const_cast<capture *>(reinterpret_cast<const capture *>(data)); /* Override policy for rvalues -- usually to enforce rvp::move on an rvalue */ return_value_policy policy = return_value_policy_override<Return>::policy(call.func.policy); /* Function scope guard -- defaults to the compile-to-nothing `void_type` */ using Guard = extract_guard_t<Extra...>; /* Perform the function call */ handle result = cast_out::cast( std::move(args_converter).template call<Return, Guard>(cap->f), policy, call.parent); /* Invoke call policy post-call hook */ process_attributes<Extra...>::postcall(call, result); return result; }; /* Process any user-provided function attributes */ process_attributes<Extra...>::init(extra..., rec); { constexpr bool has_kw_only_args = any_of<std::is_same<kw_only, Extra>...>::value, has_pos_only_args = any_of<std::is_same<pos_only, Extra>...>::value, has_args = any_of<std::is_same<args, Args>...>::value, has_arg_annotations = any_of<is_keyword<Extra>...>::value; static_assert(has_arg_annotations || !has_kw_only_args, "py::kw_only requires the use of argument annotations"); static_assert(has_arg_annotations || !has_pos_only_args, "py::pos_only requires the use of argument annotations (for docstrings and aligning the annotations to the argument)"); static_assert(!(has_args && has_kw_only_args), "py::kw_only cannot be combined with a py::args argument"); } /* Generate a readable signature describing the function's arguments and return value types */ static constexpr auto signature = _("(") + cast_in::arg_names + _(") -> ") + cast_out::name; PYBIND11_DESCR_CONSTEXPR auto types = decltype(signature)::types(); /* Register the function with Python from generic (non-templated) code */ // Pass on the ownership over the `unique_rec` to `initialize_generic`. `rec` stays valid. initialize_generic(std::move(unique_rec), signature.text, types.data(), sizeof...(Args)); if (cast_in::has_args) rec->has_args = true; if (cast_in::has_kwargs) rec->has_kwargs = true; /* Stash some additional information used by an important optimization in 'functional.h' */ using FunctionType = Return (*)(Args...); constexpr bool is_function_ptr = std::is_convertible<Func, FunctionType>::value && sizeof(capture) == sizeof(void *); if (is_function_ptr) { rec->is_stateless = true; rec->data[1] = const_cast<void *>(reinterpret_cast<const void *>(&typeid(FunctionType))); } } // Utility class that keeps track of all duplicated strings, and cleans them up in its destructor, // unless they are released. Basically a RAII-solution to deal with exceptions along the way. class strdup_guard { public: ~strdup_guard() { for (auto s : strings) std::free(s); } char *operator()(const char *s) { auto t = PYBIND11_COMPAT_STRDUP(s); strings.push_back(t); return t; } void release() { strings.clear(); } private: std::vector<char *> strings; }; /// Register a function call with Python (generic non-templated code goes here) void initialize_generic(unique_function_record &&unique_rec, const char *text, const std::type_info *const *types, size_t args) { // Do NOT receive `unique_rec` by value. If this function fails to move out the unique_ptr, // we do not want this to destuct the pointer. `initialize` (the caller) still relies on the // pointee being alive after this call. Only move out if a `capsule` is going to keep it alive. auto rec = unique_rec.get(); // Keep track of strdup'ed strings, and clean them up as long as the function's capsule // has not taken ownership yet (when `unique_rec.release()` is called). // Note: This cannot easily be fixed by a `unique_ptr` with custom deleter, because the strings // are only referenced before strdup'ing. So only *after* the following block could `destruct` // safely be called, but even then, `repr` could still throw in the middle of copying all strings. strdup_guard guarded_strdup; /* Create copies of all referenced C-style strings */ rec->name = guarded_strdup(rec->name ? rec->name : ""); if (rec->doc) rec->doc = guarded_strdup(rec->doc); for (auto &a: rec->args) { if (a.name) a.name = guarded_strdup(a.name); if (a.descr) a.descr = guarded_strdup(a.descr); else if (a.value) a.descr = guarded_strdup(repr(a.value).cast<std::string>().c_str()); } rec->is_constructor = (strcmp(rec->name, "__init__") == 0) || (strcmp(rec->name, "__setstate__") == 0); #if !defined(NDEBUG) && !defined(PYBIND11_DISABLE_NEW_STYLE_INIT_WARNING) if (rec->is_constructor && !rec->is_new_style_constructor) { const auto class_name = detail::get_fully_qualified_tp_name((PyTypeObject *) rec->scope.ptr()); const auto func_name = std::string(rec->name); PyErr_WarnEx( PyExc_FutureWarning, ("pybind11-bound class '" + class_name + "' is using an old-style " "placement-new '" + func_name + "' which has been deprecated. See " "the upgrade guide in pybind11's docs. This message is only visible " "when compiled in debug mode.").c_str(), 0 ); } #endif /* Generate a proper function signature */ std::string signature; size_t type_index = 0, arg_index = 0; for (auto *pc = text; *pc != '\0'; ++pc) { const auto c = *pc; if (c == '{') { // Write arg name for everything except *args and **kwargs. if (*(pc + 1) == '*') continue; // Separator for keyword-only arguments, placed before the kw // arguments start if (rec->nargs_kw_only > 0 && arg_index + rec->nargs_kw_only == args) signature += "*, "; if (arg_index < rec->args.size() && rec->args[arg_index].name) { signature += rec->args[arg_index].name; } else if (arg_index == 0 && rec->is_method) { signature += "self"; } else { signature += "arg" + std::to_string(arg_index - (rec->is_method ? 1 : 0)); } signature += ": "; } else if (c == '}') { // Write default value if available. if (arg_index < rec->args.size() && rec->args[arg_index].descr) { signature += " = "; signature += rec->args[arg_index].descr; } // Separator for positional-only arguments (placed after the // argument, rather than before like * if (rec->nargs_pos_only > 0 && (arg_index + 1) == rec->nargs_pos_only) signature += ", /"; arg_index++; } else if (c == '%') { const std::type_info *t = types[type_index++]; if (!t) pybind11_fail("Internal error while parsing type signature (1)"); if (auto tinfo = detail::get_type_info(*t)) { handle th((PyObject *) tinfo->type); signature += th.attr("__module__").cast<std::string>() + "." + th.attr("__qualname__").cast<std::string>(); // Python 3.3+, but we backport it to earlier versions } else if (rec->is_new_style_constructor && arg_index == 0) { // A new-style `__init__` takes `self` as `value_and_holder`. // Rewrite it to the proper class type. signature += rec->scope.attr("__module__").cast<std::string>() + "." + rec->scope.attr("__qualname__").cast<std::string>(); } else { std::string tname(t->name()); detail::clean_type_id(tname); signature += tname; } } else { signature += c; } } if (arg_index != args || types[type_index] != nullptr) pybind11_fail("Internal error while parsing type signature (2)"); #if PY_MAJOR_VERSION < 3 if (strcmp(rec->name, "__next__") == 0) { std::free(rec->name); rec->name = guarded_strdup("next"); } else if (strcmp(rec->name, "__bool__") == 0) { std::free(rec->name); rec->name = guarded_strdup("__nonzero__"); } #endif rec->signature = guarded_strdup(signature.c_str()); rec->args.shrink_to_fit(); rec->nargs = (std::uint16_t) args; if (rec->sibling && PYBIND11_INSTANCE_METHOD_CHECK(rec->sibling.ptr())) rec->sibling = PYBIND11_INSTANCE_METHOD_GET_FUNCTION(rec->sibling.ptr()); detail::function_record *chain = nullptr, *chain_start = rec; if (rec->sibling) { if (PyCFunction_Check(rec->sibling.ptr())) { auto rec_capsule = reinterpret_borrow<capsule>(PyCFunction_GET_SELF(rec->sibling.ptr())); chain = (detail::function_record *) rec_capsule; /* Never append a method to an overload chain of a parent class; instead, hide the parent's overloads in this case */ if (!chain->scope.is(rec->scope)) chain = nullptr; } // Don't trigger for things like the default __init__, which are wrapper_descriptors that we are intentionally replacing else if (!rec->sibling.is_none() && rec->name[0] != '_') pybind11_fail("Cannot overload existing non-function object \"" + std::string(rec->name) + "\" with a function of the same name"); } if (!chain) { /* No existing overload was found, create a new function object */ rec->def = new PyMethodDef(); std::memset(rec->def, 0, sizeof(PyMethodDef)); rec->def->ml_name = rec->name; rec->def->ml_meth = reinterpret_cast<PyCFunction>(reinterpret_cast<void (*)()>(dispatcher)); rec->def->ml_flags = METH_VARARGS | METH_KEYWORDS; capsule rec_capsule(unique_rec.release(), [](void *ptr) { destruct((detail::function_record *) ptr); }); guarded_strdup.release(); object scope_module; if (rec->scope) { if (hasattr(rec->scope, "__module__")) { scope_module = rec->scope.attr("__module__"); } else if (hasattr(rec->scope, "__name__")) { scope_module = rec->scope.attr("__name__"); } } m_ptr = PyCFunction_NewEx(rec->def, rec_capsule.ptr(), scope_module.ptr()); if (!m_ptr) pybind11_fail("cpp_function::cpp_function(): Could not allocate function object"); } else { /* Append at the beginning or end of the overload chain */ m_ptr = rec->sibling.ptr(); inc_ref(); if (chain->is_method != rec->is_method) pybind11_fail("overloading a method with both static and instance methods is not supported; " #if defined(NDEBUG) "compile in debug mode for more details" #else "error while attempting to bind " + std::string(rec->is_method ? "instance" : "static") + " method " + std::string(pybind11::str(rec->scope.attr("__name__"))) + "." + std::string(rec->name) + signature #endif ); if (rec->prepend) { // Beginning of chain; we need to replace the capsule's current head-of-the-chain // pointer with this one, then make this one point to the previous head of the // chain. chain_start = rec; rec->next = chain; auto rec_capsule = reinterpret_borrow<capsule>(((PyCFunctionObject *) m_ptr)->m_self); rec_capsule.set_pointer(unique_rec.release()); guarded_strdup.release(); } else { // Or end of chain (normal behavior) chain_start = chain; while (chain->next) chain = chain->next; chain->next = unique_rec.release(); guarded_strdup.release(); } } std::string signatures; int index = 0; /* Create a nice pydoc rec including all signatures and docstrings of the functions in the overload chain */ if (chain && options::show_function_signatures()) { // First a generic signature signatures += rec->name; signatures += "(*args, **kwargs)\n"; signatures += "Overloaded function.\n\n"; } // Then specific overload signatures bool first_user_def = true; for (auto it = chain_start; it != nullptr; it = it->next) { if (options::show_function_signatures()) { if (index > 0) signatures += "\n"; if (chain) signatures += std::to_string(++index) + ". "; signatures += rec->name; signatures += it->signature; signatures += "\n"; } if (it->doc && it->doc[0] != '\0' && options::show_user_defined_docstrings()) { // If we're appending another docstring, and aren't printing function signatures, we // need to append a newline first: if (!options::show_function_signatures()) { if (first_user_def) first_user_def = false; else signatures += "\n"; } if (options::show_function_signatures()) signatures += "\n"; signatures += it->doc; if (options::show_function_signatures()) signatures += "\n"; } } /* Install docstring */ auto *func = (PyCFunctionObject *) m_ptr; std::free(const_cast<char *>(func->m_ml->ml_doc)); // Install docstring if it's non-empty (when at least one option is enabled) func->m_ml->ml_doc = signatures.empty() ? nullptr : PYBIND11_COMPAT_STRDUP(signatures.c_str()); if (rec->is_method) { m_ptr = PYBIND11_INSTANCE_METHOD_NEW(m_ptr, rec->scope.ptr()); if (!m_ptr) pybind11_fail("cpp_function::cpp_function(): Could not allocate instance method object"); Py_DECREF(func); } } /// When a cpp_function is GCed, release any memory allocated by pybind11 static void destruct(detail::function_record *rec, bool free_strings = true) { // If on Python 3.9, check the interpreter "MICRO" (patch) version. // If this is running on 3.9.0, we have to work around a bug. #if !defined(PYPY_VERSION) && PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 9 static bool is_zero = Py_GetVersion()[4] == '0'; #endif while (rec) { detail::function_record *next = rec->next; if (rec->free_data) rec->free_data(rec); // During initialization, these strings might not have been copied yet, // so they cannot be freed. Once the function has been created, they can. // Check `make_function_record` for more details. if (free_strings) { std::free((char *) rec->name); std::free((char *) rec->doc); std::free((char *) rec->signature); for (auto &arg: rec->args) { std::free(const_cast<char *>(arg.name)); std::free(const_cast<char *>(arg.descr)); } } for (auto &arg: rec->args) arg.value.dec_ref(); if (rec->def) { std::free(const_cast<char *>(rec->def->ml_doc)); // Python 3.9.0 decref's these in the wrong order; rec->def // If loaded on 3.9.0, let these leak (use Python 3.9.1 at runtime to fix) // See https://github.com/python/cpython/pull/22670 #if !defined(PYPY_VERSION) && PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 9 if (!is_zero) delete rec->def; #else delete rec->def; #endif } delete rec; rec = next; } } /// Main dispatch logic for calls to functions bound using pybind11 static PyObject *dispatcher(PyObject *self, PyObject *args_in, PyObject *kwargs_in) { using namespace detail; /* Iterator over the list of potentially admissible overloads */ const function_record *overloads = (function_record *) PyCapsule_GetPointer(self, nullptr), *it = overloads; /* Need to know how many arguments + keyword arguments there are to pick the right overload */ const auto n_args_in = (size_t) PyTuple_GET_SIZE(args_in); handle parent = n_args_in > 0 ? PyTuple_GET_ITEM(args_in, 0) : nullptr, result = PYBIND11_TRY_NEXT_OVERLOAD; auto self_value_and_holder = value_and_holder(); if (overloads->is_constructor) { if (!parent || !PyObject_TypeCheck(parent.ptr(), (PyTypeObject *) overloads->scope.ptr())) { PyErr_SetString(PyExc_TypeError, "__init__(self, ...) called with invalid or missing `self` argument"); return nullptr; } const auto tinfo = get_type_info((PyTypeObject *) overloads->scope.ptr()); const auto pi = reinterpret_cast<instance *>(parent.ptr()); self_value_and_holder = pi->get_value_and_holder(tinfo, true); // If this value is already registered it must mean __init__ is invoked multiple times; // we really can't support that in C++, so just ignore the second __init__. if (self_value_and_holder.instance_registered()) return none().release().ptr(); } try { // We do this in two passes: in the first pass, we load arguments with `convert=false`; // in the second, we allow conversion (except for arguments with an explicit // py::arg().noconvert()). This lets us prefer calls without conversion, with // conversion as a fallback. std::vector<function_call> second_pass; // However, if there are no overloads, we can just skip the no-convert pass entirely const bool overloaded = it != nullptr && it->next != nullptr; for (; it != nullptr; it = it->next) { /* For each overload: 1. Copy all positional arguments we were given, also checking to make sure that named positional arguments weren't *also* specified via kwarg. 2. If we weren't given enough, try to make up the omitted ones by checking whether they were provided by a kwarg matching the `py::arg("name")` name. If so, use it (and remove it from kwargs; if not, see if the function binding provided a default that we can use. 3. Ensure that either all keyword arguments were "consumed", or that the function takes a kwargs argument to accept unconsumed kwargs. 4. Any positional arguments still left get put into a tuple (for args), and any leftover kwargs get put into a dict. 5. Pack everything into a vector; if we have py::args or py::kwargs, they are an extra tuple or dict at the end of the positional arguments. 6. Call the function call dispatcher (function_record::impl) If one of these fail, move on to the next overload and keep trying until we get a result other than PYBIND11_TRY_NEXT_OVERLOAD. */ const function_record &func = *it; size_t num_args = func.nargs; // Number of positional arguments that we need if (func.has_args) --num_args; // (but don't count py::args if (func.has_kwargs) --num_args; // or py::kwargs) size_t pos_args = num_args - func.nargs_kw_only; if (!func.has_args && n_args_in > pos_args) continue; // Too many positional arguments for this overload if (n_args_in < pos_args && func.args.size() < pos_args) continue; // Not enough positional arguments given, and not enough defaults to fill in the blanks function_call call(func, parent); size_t args_to_copy = (std::min)(pos_args, n_args_in); // Protect std::min with parentheses size_t args_copied = 0; // 0. Inject new-style `self` argument if (func.is_new_style_constructor) { // The `value` may have been preallocated by an old-style `__init__` // if it was a preceding candidate for overload resolution. if (self_value_and_holder) self_value_and_holder.type->dealloc(self_value_and_holder); call.init_self = PyTuple_GET_ITEM(args_in, 0); call.args.emplace_back(reinterpret_cast<PyObject *>(&self_value_and_holder)); call.args_convert.push_back(false); ++args_copied; } // 1. Copy any position arguments given. bool bad_arg = false; for (; args_copied < args_to_copy; ++args_copied) { const argument_record *arg_rec = args_copied < func.args.size() ? &func.args[args_copied] : nullptr; if (kwargs_in && arg_rec && arg_rec->name && dict_getitemstring(kwargs_in, arg_rec->name)) { bad_arg = true; break; } handle arg(PyTuple_GET_ITEM(args_in, args_copied)); if (arg_rec && !arg_rec->none && arg.is_none()) { bad_arg = true; break; } call.args.push_back(arg); call.args_convert.push_back(arg_rec ? arg_rec->convert : true); } if (bad_arg) continue; // Maybe it was meant for another overload (issue #688) // We'll need to copy this if we steal some kwargs for defaults dict kwargs = reinterpret_borrow<dict>(kwargs_in); // 1.5. Fill in any missing pos_only args from defaults if they exist if (args_copied < func.nargs_pos_only) { for (; args_copied < func.nargs_pos_only; ++args_copied) { const auto &arg_rec = func.args[args_copied]; handle value; if (arg_rec.value) { value = arg_rec.value; } if (value) { call.args.push_back(value); call.args_convert.push_back(arg_rec.convert); } else break; } if (args_copied < func.nargs_pos_only) continue; // Not enough defaults to fill the positional arguments } // 2. Check kwargs and, failing that, defaults that may help complete the list if (args_copied < num_args) { bool copied_kwargs = false; for (; args_copied < num_args; ++args_copied) { const auto &arg_rec = func.args[args_copied]; handle value; if (kwargs_in && arg_rec.name) value = dict_getitemstring(kwargs.ptr(), arg_rec.name); if (value) { // Consume a kwargs value if (!copied_kwargs) { kwargs = reinterpret_steal<dict>(PyDict_Copy(kwargs.ptr())); copied_kwargs = true; } if (PyDict_DelItemString(kwargs.ptr(), arg_rec.name) == -1) { throw error_already_set(); } } else if (arg_rec.value) { value = arg_rec.value; } if (!arg_rec.none && value.is_none()) { break; } if (value) { call.args.push_back(value); call.args_convert.push_back(arg_rec.convert); } else break; } if (args_copied < num_args) continue; // Not enough arguments, defaults, or kwargs to fill the positional arguments } // 3. Check everything was consumed (unless we have a kwargs arg) if (kwargs && !kwargs.empty() && !func.has_kwargs) continue; // Unconsumed kwargs, but no py::kwargs argument to accept them // 4a. If we have a py::args argument, create a new tuple with leftovers if (func.has_args) { tuple extra_args; if (args_to_copy == 0) { // We didn't copy out any position arguments from the args_in tuple, so we // can reuse it directly without copying: extra_args = reinterpret_borrow<tuple>(args_in); } else if (args_copied >= n_args_in) { extra_args = tuple(0); } else { size_t args_size = n_args_in - args_copied; extra_args = tuple(args_size); for (size_t i = 0; i < args_size; ++i) { extra_args[i] = PyTuple_GET_ITEM(args_in, args_copied + i); } } call.args.push_back(extra_args); call.args_convert.push_back(false); call.args_ref = std::move(extra_args); } // 4b. If we have a py::kwargs, pass on any remaining kwargs if (func.has_kwargs) { if (!kwargs.ptr()) kwargs = dict(); // If we didn't get one, send an empty one call.args.push_back(kwargs); call.args_convert.push_back(false); call.kwargs_ref = std::move(kwargs); } // 5. Put everything in a vector. Not technically step 5, we've been building it // in `call.args` all along. #if !defined(NDEBUG) if (call.args.size() != func.nargs || call.args_convert.size() != func.nargs) pybind11_fail("Internal error: function call dispatcher inserted wrong number of arguments!"); #endif std::vector<bool> second_pass_convert; if (overloaded) { // We're in the first no-convert pass, so swap out the conversion flags for a // set of all-false flags. If the call fails, we'll swap the flags back in for // the conversion-allowed call below. second_pass_convert.resize(func.nargs, false); call.args_convert.swap(second_pass_convert); } // 6. Call the function. try { loader_life_support guard{}; result = func.impl(call); } catch (reference_cast_error &) { result = PYBIND11_TRY_NEXT_OVERLOAD; } if (result.ptr() != PYBIND11_TRY_NEXT_OVERLOAD) break; if (overloaded) { // The (overloaded) call failed; if the call has at least one argument that // permits conversion (i.e. it hasn't been explicitly specified `.noconvert()`) // then add this call to the list of second pass overloads to try. for (size_t i = func.is_method ? 1 : 0; i < pos_args; i++) { if (second_pass_convert[i]) { // Found one: swap the converting flags back in and store the call for // the second pass. call.args_convert.swap(second_pass_convert); second_pass.push_back(std::move(call)); break; } } } } if (overloaded && !second_pass.empty() && result.ptr() == PYBIND11_TRY_NEXT_OVERLOAD) { // The no-conversion pass finished without success, try again with conversion allowed for (auto &call : second_pass) { try { loader_life_support guard{}; result = call.func.impl(call); } catch (reference_cast_error &) { result = PYBIND11_TRY_NEXT_OVERLOAD; } if (result.ptr() != PYBIND11_TRY_NEXT_OVERLOAD) { // The error reporting logic below expects 'it' to be valid, as it would be // if we'd encountered this failure in the first-pass loop. if (!result) it = &call.func; break; } } } } catch (error_already_set &e) { e.restore(); return nullptr; #ifdef __GLIBCXX__ } catch ( abi::__forced_unwind& ) { throw; #endif } catch (...) { /* When an exception is caught, give each registered exception translator a chance to translate it to a Python exception. First all module-local translators will be tried in reverse order of registration. If none of the module-locale translators handle the exception (or there are no module-locale translators) then the global translators will be tried, also in reverse order of registration. A translator may choose to do one of the following: - catch the exception and call PyErr_SetString or PyErr_SetObject to set a standard (or custom) Python exception, or - do nothing and let the exception fall through to the next translator, or - delegate translation to the next translator by throwing a new type of exception. */ auto &local_exception_translators = get_local_internals().registered_exception_translators; if (detail::apply_exception_translators(local_exception_translators)) { return nullptr; } auto &exception_translators = get_internals().registered_exception_translators; if (detail::apply_exception_translators(exception_translators)) { return nullptr; } PyErr_SetString(PyExc_SystemError, "Exception escaped from default exception translator!"); return nullptr; } auto append_note_if_missing_header_is_suspected = [](std::string &msg) { if (msg.find("std::") != std::string::npos) { msg += "\n\n" "Did you forget to `#include <pybind11/stl.h>`? Or <pybind11/complex.h>,\n" "<pybind11/functional.h>, <pybind11/chrono.h>, etc. Some automatic\n" "conversions are optional and require extra headers to be included\n" "when compiling your pybind11 module."; } }; if (result.ptr() == PYBIND11_TRY_NEXT_OVERLOAD) { if (overloads->is_operator) return handle(Py_NotImplemented).inc_ref().ptr(); std::string msg = std::string(overloads->name) + "(): incompatible " + std::string(overloads->is_constructor ? "constructor" : "function") + " arguments. The following argument types are supported:\n"; int ctr = 0; for (const function_record *it2 = overloads; it2 != nullptr; it2 = it2->next) { msg += " "+ std::to_string(++ctr) + ". "; bool wrote_sig = false; if (overloads->is_constructor) { // For a constructor, rewrite `(self: Object, arg0, ...) -> NoneType` as `Object(arg0, ...)` std::string sig = it2->signature; size_t start = sig.find('(') + 7; // skip "(self: " if (start < sig.size()) { // End at the , for the next argument size_t end = sig.find(", "), next = end + 2; size_t ret = sig.rfind(" -> "); // Or the ), if there is no comma: if (end >= sig.size()) next = end = sig.find(')'); if (start < end && next < sig.size()) { msg.append(sig, start, end - start); msg += '('; msg.append(sig, next, ret - next); wrote_sig = true; } } } if (!wrote_sig) msg += it2->signature; msg += "\n"; } msg += "\nInvoked with: "; auto args_ = reinterpret_borrow<tuple>(args_in); bool some_args = false; for (size_t ti = overloads->is_constructor ? 1 : 0; ti < args_.size(); ++ti) { if (!some_args) some_args = true; else msg += ", "; try { msg += pybind11::repr(args_[ti]); } catch (const error_already_set&) { msg += "<repr raised Error>"; } } if (kwargs_in) { auto kwargs = reinterpret_borrow<dict>(kwargs_in); if (!kwargs.empty()) { if (some_args) msg += "; "; msg += "kwargs: "; bool first = true; for (auto kwarg : kwargs) { if (first) first = false; else msg += ", "; msg += pybind11::str("{}=").format(kwarg.first); try { msg += pybind11::repr(kwarg.second); } catch (const error_already_set&) { msg += "<repr raised Error>"; } } } } append_note_if_missing_header_is_suspected(msg); PyErr_SetString(PyExc_TypeError, msg.c_str()); return nullptr; } if (!result) { std::string msg = "Unable to convert function return value to a " "Python type! The signature was\n\t"; msg += it->signature; append_note_if_missing_header_is_suspected(msg); PyErr_SetString(PyExc_TypeError, msg.c_str()); return nullptr; } if (overloads->is_constructor && !self_value_and_holder.holder_constructed()) { auto *pi = reinterpret_cast<instance *>(parent.ptr()); self_value_and_holder.type->init_instance(pi, nullptr); } return result.ptr(); } }; /// Wrapper for Python extension modules class module_ : public object { public: PYBIND11_OBJECT_DEFAULT(module_, object, PyModule_Check) /// Create a new top-level Python module with the given name and docstring PYBIND11_DEPRECATED("Use PYBIND11_MODULE or module_::create_extension_module instead") explicit module_(const char *name, const char *doc = nullptr) { #if PY_MAJOR_VERSION >= 3 *this = create_extension_module(name, doc, new PyModuleDef()); #else *this = create_extension_module(name, doc, nullptr); #endif } /** \rst Create Python binding for a new function within the module scope. ``Func`` can be a plain C++ function, a function pointer, or a lambda function. For details on the ``Extra&& ... extra`` argument, see section :ref:`extras`. \endrst */ template <typename Func, typename... Extra> module_ &def(const char *name_, Func &&f, const Extra& ... extra) { cpp_function func(std::forward<Func>(f), name(name_), scope(*this), sibling(getattr(*this, name_, none())), extra...); // NB: allow overwriting here because cpp_function sets up a chain with the intention of // overwriting (and has already checked internally that it isn't overwriting non-functions). add_object(name_, func, true /* overwrite */); return *this; } /** \rst Create and return a new Python submodule with the given name and docstring. This also works recursively, i.e. .. code-block:: cpp py::module_ m("example", "pybind11 example plugin"); py::module_ m2 = m.def_submodule("sub", "A submodule of 'example'"); py::module_ m3 = m2.def_submodule("subsub", "A submodule of 'example.sub'"); \endrst */ module_ def_submodule(const char *name, const char *doc = nullptr) { std::string full_name = std::string(PyModule_GetName(m_ptr)) + std::string(".") + std::string(name); auto result = reinterpret_borrow<module_>(PyImport_AddModule(full_name.c_str())); if (doc && options::show_user_defined_docstrings()) result.attr("__doc__") = pybind11::str(doc); attr(name) = result; return result; } /// Import and return a module or throws `error_already_set`. static module_ import(const char *name) { PyObject *obj = PyImport_ImportModule(name); if (!obj) throw error_already_set(); return reinterpret_steal<module_>(obj); } /// Reload the module or throws `error_already_set`. void reload() { PyObject *obj = PyImport_ReloadModule(ptr()); if (!obj) throw error_already_set(); *this = reinterpret_steal<module_>(obj); } /** \rst Adds an object to the module using the given name. Throws if an object with the given name already exists. ``overwrite`` should almost always be false: attempting to overwrite objects that pybind11 has established will, in most cases, break things. \endrst */ PYBIND11_NOINLINE void add_object(const char *name, handle obj, bool overwrite = false) { if (!overwrite && hasattr(*this, name)) pybind11_fail("Error during initialization: multiple incompatible definitions with name \"" + std::string(name) + "\""); PyModule_AddObject(ptr(), name, obj.inc_ref().ptr() /* steals a reference */); } #if PY_MAJOR_VERSION >= 3 using module_def = PyModuleDef; #else struct module_def {}; #endif /** \rst Create a new top-level module that can be used as the main module of a C extension. For Python 3, ``def`` should point to a statically allocated module_def. For Python 2, ``def`` can be a nullptr and is completely ignored. \endrst */ static module_ create_extension_module(const char *name, const char *doc, module_def *def) { #if PY_MAJOR_VERSION >= 3 // module_def is PyModuleDef def = new (def) PyModuleDef { // Placement new (not an allocation). /* m_base */ PyModuleDef_HEAD_INIT, /* m_name */ name, /* m_doc */ options::show_user_defined_docstrings() ? doc : nullptr, /* m_size */ -1, /* m_methods */ nullptr, /* m_slots */ nullptr, /* m_traverse */ nullptr, /* m_clear */ nullptr, /* m_free */ nullptr }; auto m = PyModule_Create(def); #else // Ignore module_def *def; only necessary for Python 3 (void) def; auto m = Py_InitModule3(name, nullptr, options::show_user_defined_docstrings() ? doc : nullptr); #endif if (m == nullptr) { if (PyErr_Occurred()) throw error_already_set(); pybind11_fail("Internal error in module_::create_extension_module()"); } // TODO: Should be reinterpret_steal for Python 3, but Python also steals it again when returned from PyInit_... // For Python 2, reinterpret_borrow is correct. return reinterpret_borrow<module_>(m); } }; // When inside a namespace (or anywhere as long as it's not the first item on a line), // C++20 allows "module" to be used. This is provided for backward compatibility, and for // simplicity, if someone wants to use py::module for example, that is perfectly safe. using module = module_; /// \ingroup python_builtins /// Return a dictionary representing the global variables in the current execution frame, /// or ``__main__.__dict__`` if there is no frame (usually when the interpreter is embedded). inline dict globals() { PyObject *p = PyEval_GetGlobals(); return reinterpret_borrow<dict>(p ? p : module_::import("__main__").attr("__dict__").ptr()); } PYBIND11_NAMESPACE_BEGIN(detail) /// Generic support for creating new Python heap types class generic_type : public object { public: PYBIND11_OBJECT_DEFAULT(generic_type, object, PyType_Check) protected: void initialize(const type_record &rec) { if (rec.scope && hasattr(rec.scope, "__dict__") && rec.scope.attr("__dict__").contains(rec.name)) pybind11_fail("generic_type: cannot initialize type \"" + std::string(rec.name) + "\": an object with that name is already defined"); if ((rec.module_local ? get_local_type_info(*rec.type) : get_global_type_info(*rec.type)) != nullptr) pybind11_fail("generic_type: type \"" + std::string(rec.name) + "\" is already registered!"); m_ptr = make_new_python_type(rec); /* Register supplemental type information in C++ dict */ auto *tinfo = new detail::type_info(); tinfo->type = (PyTypeObject *) m_ptr; tinfo->cpptype = rec.type; tinfo->type_size = rec.type_size; tinfo->type_align = rec.type_align; tinfo->operator_new = rec.operator_new; tinfo->holder_size_in_ptrs = size_in_ptrs(rec.holder_size); tinfo->init_instance = rec.init_instance; tinfo->dealloc = rec.dealloc; tinfo->simple_type = true; tinfo->simple_ancestors = true; tinfo->default_holder = rec.default_holder; tinfo->module_local = rec.module_local; auto &internals = get_internals(); auto tindex = std::type_index(*rec.type); tinfo->direct_conversions = &internals.direct_conversions[tindex]; if (rec.module_local) get_local_internals().registered_types_cpp[tindex] = tinfo; else internals.registered_types_cpp[tindex] = tinfo; internals.registered_types_py[(PyTypeObject *) m_ptr] = { tinfo }; if (rec.bases.size() > 1 || rec.multiple_inheritance) { mark_parents_nonsimple(tinfo->type); tinfo->simple_ancestors = false; } else if (rec.bases.size() == 1) { auto parent_tinfo = get_type_info((PyTypeObject *) rec.bases[0].ptr()); tinfo->simple_ancestors = parent_tinfo->simple_ancestors; } if (rec.module_local) { // Stash the local typeinfo and loader so that external modules can access it. tinfo->module_local_load = &type_caster_generic::local_load; setattr(m_ptr, PYBIND11_MODULE_LOCAL_ID, capsule(tinfo)); } } /// Helper function which tags all parents of a type using mult. inheritance void mark_parents_nonsimple(PyTypeObject *value) { auto t = reinterpret_borrow<tuple>(value->tp_bases); for (handle h : t) { auto tinfo2 = get_type_info((PyTypeObject *) h.ptr()); if (tinfo2) tinfo2->simple_type = false; mark_parents_nonsimple((PyTypeObject *) h.ptr()); } } void install_buffer_funcs( buffer_info *(*get_buffer)(PyObject *, void *), void *get_buffer_data) { auto *type = (PyHeapTypeObject*) m_ptr; auto tinfo = detail::get_type_info(&type->ht_type); if (!type->ht_type.tp_as_buffer) pybind11_fail( "To be able to register buffer protocol support for the type '" + get_fully_qualified_tp_name(tinfo->type) + "' the associated class<>(..) invocation must " "include the pybind11::buffer_protocol() annotation!"); tinfo->get_buffer = get_buffer; tinfo->get_buffer_data = get_buffer_data; } // rec_func must be set for either fget or fset. void def_property_static_impl(const char *name, handle fget, handle fset, detail::function_record *rec_func) { const auto is_static = (rec_func != nullptr) && !(rec_func->is_method && rec_func->scope); const auto has_doc = (rec_func != nullptr) && (rec_func->doc != nullptr) && pybind11::options::show_user_defined_docstrings(); auto property = handle((PyObject *) (is_static ? get_internals().static_property_type : &PyProperty_Type)); attr(name) = property(fget.ptr() ? fget : none(), fset.ptr() ? fset : none(), /*deleter*/none(), pybind11::str(has_doc ? rec_func->doc : "")); } }; /// Set the pointer to operator new if it exists. The cast is needed because it can be overloaded. template <typename T, typename = void_t<decltype(static_cast<void *(*)(size_t)>(T::operator new))>> void set_operator_new(type_record *r) { r->operator_new = &T::operator new; } template <typename> void set_operator_new(...) { } template <typename T, typename SFINAE = void> struct has_operator_delete : std::false_type { }; template <typename T> struct has_operator_delete<T, void_t<decltype(static_cast<void (*)(void *)>(T::operator delete))>> : std::true_type { }; template <typename T, typename SFINAE = void> struct has_operator_delete_size : std::false_type { }; template <typename T> struct has_operator_delete_size<T, void_t<decltype(static_cast<void (*)(void *, size_t)>(T::operator delete))>> : std::true_type { }; /// Call class-specific delete if it exists or global otherwise. Can also be an overload set. template <typename T, enable_if_t<has_operator_delete<T>::value, int> = 0> void call_operator_delete(T *p, size_t, size_t) { T::operator delete(p); } template <typename T, enable_if_t<!has_operator_delete<T>::value && has_operator_delete_size<T>::value, int> = 0> void call_operator_delete(T *p, size_t s, size_t) { T::operator delete(p, s); } inline void call_operator_delete(void *p, size_t s, size_t a) { (void)s; (void)a; #if defined(__cpp_aligned_new) && (!defined(_MSC_VER) || _MSC_VER >= 1912) if (a > __STDCPP_DEFAULT_NEW_ALIGNMENT__) { #ifdef __cpp_sized_deallocation ::operator delete(p, s, std::align_val_t(a)); #else ::operator delete(p, std::align_val_t(a)); #endif return; } #endif #ifdef __cpp_sized_deallocation ::operator delete(p, s); #else ::operator delete(p); #endif } inline void add_class_method(object& cls, const char *name_, const cpp_function &cf) { cls.attr(cf.name()) = cf; if (strcmp(name_, "__eq__") == 0 && !cls.attr("__dict__").contains("__hash__")) { cls.attr("__hash__") = none(); } } PYBIND11_NAMESPACE_END(detail) /// Given a pointer to a member function, cast it to its `Derived` version. /// Forward everything else unchanged. template <typename /*Derived*/, typename F> auto method_adaptor(F &&f) -> decltype(std::forward<F>(f)) { return std::forward<F>(f); } template <typename Derived, typename Return, typename Class, typename... Args> auto method_adaptor(Return (Class::*pmf)(Args...)) -> Return (Derived::*)(Args...) { static_assert(detail::is_accessible_base_of<Class, Derived>::value, "Cannot bind an inaccessible base class method; use a lambda definition instead"); return pmf; } template <typename Derived, typename Return, typename Class, typename... Args> auto method_adaptor(Return (Class::*pmf)(Args...) const) -> Return (Derived::*)(Args...) const { static_assert(detail::is_accessible_base_of<Class, Derived>::value, "Cannot bind an inaccessible base class method; use a lambda definition instead"); return pmf; } template <typename type_, typename... options> class class_ : public detail::generic_type { template <typename T> using is_holder = detail::is_holder_type<type_, T>; template <typename T> using is_subtype = detail::is_strict_base_of<type_, T>; template <typename T> using is_base = detail::is_strict_base_of<T, type_>; // struct instead of using here to help MSVC: template <typename T> struct is_valid_class_option : detail::any_of<is_holder<T>, is_subtype<T>, is_base<T>> {}; public: using type = type_; using type_alias = detail::exactly_one_t<is_subtype, void, options...>; constexpr static bool has_alias = !std::is_void<type_alias>::value; using holder_type = detail::exactly_one_t<is_holder, std::unique_ptr<type>, options...>; static_assert(detail::all_of<is_valid_class_option<options>...>::value, "Unknown/invalid class_ template parameters provided"); static_assert(!has_alias || std::is_polymorphic<type>::value, "Cannot use an alias class with a non-polymorphic type"); PYBIND11_OBJECT(class_, generic_type, PyType_Check) template <typename... Extra> class_(handle scope, const char *name, const Extra &... extra) { using namespace detail; // MI can only be specified via class_ template options, not constructor parameters static_assert( none_of<is_pyobject<Extra>...>::value || // no base class arguments, or: ( constexpr_sum(is_pyobject<Extra>::value...) == 1 && // Exactly one base constexpr_sum(is_base<options>::value...) == 0 && // no template option bases none_of<std::is_same<multiple_inheritance, Extra>...>::value), // no multiple_inheritance attr "Error: multiple inheritance bases must be specified via class_ template options"); type_record record; record.scope = scope; record.name = name; record.type = &typeid(type); record.type_size = sizeof(conditional_t<has_alias, type_alias, type>); record.type_align = alignof(conditional_t<has_alias, type_alias, type>&); record.holder_size = sizeof(holder_type); record.init_instance = init_instance; record.dealloc = dealloc; record.default_holder = detail::is_instantiation<std::unique_ptr, holder_type>::value; set_operator_new<type>(&record); /* Register base classes specified via template arguments to class_, if any */ PYBIND11_EXPAND_SIDE_EFFECTS(add_base<options>(record)); /* Process optional arguments, if any */ process_attributes<Extra...>::init(extra..., &record); generic_type::initialize(record); if (has_alias) { auto &instances = record.module_local ? get_local_internals().registered_types_cpp : get_internals().registered_types_cpp; instances[std::type_index(typeid(type_alias))] = instances[std::type_index(typeid(type))]; } } template <typename Base, detail::enable_if_t<is_base<Base>::value, int> = 0> static void add_base(detail::type_record &rec) { rec.add_base(typeid(Base), [](void *src) -> void * { return static_cast<Base *>(reinterpret_cast<type *>(src)); }); } template <typename Base, detail::enable_if_t<!is_base<Base>::value, int> = 0> static void add_base(detail::type_record &) { } template <typename Func, typename... Extra> class_ &def(const char *name_, Func&& f, const Extra&... extra) { cpp_function cf(method_adaptor<type>(std::forward<Func>(f)), name(name_), is_method(*this), sibling(getattr(*this, name_, none())), extra...); add_class_method(*this, name_, cf); return *this; } template <typename Func, typename... Extra> class_ & def_static(const char *name_, Func &&f, const Extra&... extra) { static_assert(!std::is_member_function_pointer<Func>::value, "def_static(...) called with a non-static member function pointer"); cpp_function cf(std::forward<Func>(f), name(name_), scope(*this), sibling(getattr(*this, name_, none())), extra...); attr(cf.name()) = staticmethod(cf); return *this; } template <detail::op_id id, detail::op_type ot, typename L, typename R, typename... Extra> class_ &def(const detail::op_<id, ot, L, R> &op, const Extra&... extra) { op.execute(*this, extra...); return *this; } template <detail::op_id id, detail::op_type ot, typename L, typename R, typename... Extra> class_ & def_cast(const detail::op_<id, ot, L, R> &op, const Extra&... extra) { op.execute_cast(*this, extra...); return *this; } template <typename... Args, typename... Extra> class_ &def(const detail::initimpl::constructor<Args...> &init, const Extra&... extra) { PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(init); init.execute(*this, extra...); return *this; } template <typename... Args, typename... Extra> class_ &def(const detail::initimpl::alias_constructor<Args...> &init, const Extra&... extra) { PYBIND11_WORKAROUND_INCORRECT_MSVC_C4100(init); init.execute(*this, extra...); return *this; } template <typename... Args, typename... Extra> class_ &def(detail::initimpl::factory<Args...> &&init, const Extra&... extra) { std::move(init).execute(*this, extra...); return *this; } template <typename... Args, typename... Extra> class_ &def(detail::initimpl::pickle_factory<Args...> &&pf, const Extra &...extra) { std::move(pf).execute(*this, extra...); return *this; } template <typename Func> class_& def_buffer(Func &&func) { struct capture { Func func; }; auto *ptr = new capture { std::forward<Func>(func) }; install_buffer_funcs([](PyObject *obj, void *ptr) -> buffer_info* { detail::make_caster<type> caster; if (!caster.load(obj, false)) return nullptr; return new buffer_info(((capture *) ptr)->func(caster)); }, ptr); weakref(m_ptr, cpp_function([ptr](handle wr) { delete ptr; wr.dec_ref(); })).release(); return *this; } template <typename Return, typename Class, typename... Args> class_ &def_buffer(Return (Class::*func)(Args...)) { return def_buffer([func] (type &obj) { return (obj.*func)(); }); } template <typename Return, typename Class, typename... Args> class_ &def_buffer(Return (Class::*func)(Args...) const) { return def_buffer([func] (const type &obj) { return (obj.*func)(); }); } template <typename C, typename D, typename... Extra> class_ &def_readwrite(const char *name, D C::*pm, const Extra&... extra) { static_assert(std::is_same<C, type>::value || std::is_base_of<C, type>::value, "def_readwrite() requires a class member (or base class member)"); cpp_function fget([pm](const type &c) -> const D &{ return c.*pm; }, is_method(*this)), fset([pm](type &c, const D &value) { c.*pm = value; }, is_method(*this)); def_property(name, fget, fset, return_value_policy::reference_internal, extra...); return *this; } template <typename C, typename D, typename... Extra> class_ &def_readonly(const char *name, const D C::*pm, const Extra& ...extra) { static_assert(std::is_same<C, type>::value || std::is_base_of<C, type>::value, "def_readonly() requires a class member (or base class member)"); cpp_function fget([pm](const type &c) -> const D &{ return c.*pm; }, is_method(*this)); def_property_readonly(name, fget, return_value_policy::reference_internal, extra...); return *this; } template <typename D, typename... Extra> class_ &def_readwrite_static(const char *name, D *pm, const Extra& ...extra) { cpp_function fget([pm](const object &) -> const D & { return *pm; }, scope(*this)), fset([pm](const object &, const D &value) { *pm = value; }, scope(*this)); def_property_static(name, fget, fset, return_value_policy::reference, extra...); return *this; } template <typename D, typename... Extra> class_ &def_readonly_static(const char *name, const D *pm, const Extra& ...extra) { cpp_function fget([pm](const object &) -> const D & { return *pm; }, scope(*this)); def_property_readonly_static(name, fget, return_value_policy::reference, extra...); return *this; } /// Uses return_value_policy::reference_internal by default template <typename Getter, typename... Extra> class_ &def_property_readonly(const char *name, const Getter &fget, const Extra& ...extra) { return def_property_readonly(name, cpp_function(method_adaptor<type>(fget)), return_value_policy::reference_internal, extra...); } /// Uses cpp_function's return_value_policy by default template <typename... Extra> class_ &def_property_readonly(const char *name, const cpp_function &fget, const Extra& ...extra) { return def_property(name, fget, nullptr, extra...); } /// Uses return_value_policy::reference by default template <typename Getter, typename... Extra> class_ &def_property_readonly_static(const char *name, const Getter &fget, const Extra& ...extra) { return def_property_readonly_static(name, cpp_function(fget), return_value_policy::reference, extra...); } /// Uses cpp_function's return_value_policy by default template <typename... Extra> class_ &def_property_readonly_static(const char *name, const cpp_function &fget, const Extra& ...extra) { return def_property_static(name, fget, nullptr, extra...); } /// Uses return_value_policy::reference_internal by default template <typename Getter, typename Setter, typename... Extra> class_ &def_property(const char *name, const Getter &fget, const Setter &fset, const Extra& ...extra) { return def_property(name, fget, cpp_function(method_adaptor<type>(fset)), extra...); } template <typename Getter, typename... Extra> class_ &def_property(const char *name, const Getter &fget, const cpp_function &fset, const Extra& ...extra) { return def_property(name, cpp_function(method_adaptor<type>(fget)), fset, return_value_policy::reference_internal, extra...); } /// Uses cpp_function's return_value_policy by default template <typename... Extra> class_ &def_property(const char *name, const cpp_function &fget, const cpp_function &fset, const Extra& ...extra) { return def_property_static(name, fget, fset, is_method(*this), extra...); } /// Uses return_value_policy::reference by default template <typename Getter, typename... Extra> class_ &def_property_static(const char *name, const Getter &fget, const cpp_function &fset, const Extra& ...extra) { return def_property_static(name, cpp_function(fget), fset, return_value_policy::reference, extra...); } /// Uses cpp_function's return_value_policy by default template <typename... Extra> class_ &def_property_static(const char *name, const cpp_function &fget, const cpp_function &fset, const Extra& ...extra) { static_assert( 0 == detail::constexpr_sum(std::is_base_of<arg, Extra>::value...), "Argument annotations are not allowed for properties"); auto rec_fget = get_function_record(fget), rec_fset = get_function_record(fset); auto *rec_active = rec_fget; if (rec_fget) { char *doc_prev = rec_fget->doc; /* 'extra' field may include a property-specific documentation string */ detail::process_attributes<Extra...>::init(extra..., rec_fget); if (rec_fget->doc && rec_fget->doc != doc_prev) { free(doc_prev); rec_fget->doc = PYBIND11_COMPAT_STRDUP(rec_fget->doc); } } if (rec_fset) { char *doc_prev = rec_fset->doc; detail::process_attributes<Extra...>::init(extra..., rec_fset); if (rec_fset->doc && rec_fset->doc != doc_prev) { free(doc_prev); rec_fset->doc = PYBIND11_COMPAT_STRDUP(rec_fset->doc); } if (! rec_active) rec_active = rec_fset; } def_property_static_impl(name, fget, fset, rec_active); return *this; } private: /// Initialize holder object, variant 1: object derives from enable_shared_from_this template <typename T> static void init_holder(detail::instance *inst, detail::value_and_holder &v_h, const holder_type * /* unused */, const std::enable_shared_from_this<T> * /* dummy */) { auto sh = std::dynamic_pointer_cast<typename holder_type::element_type>( detail::try_get_shared_from_this(v_h.value_ptr<type>())); if (sh) { new (std::addressof(v_h.holder<holder_type>())) holder_type(std::move(sh)); v_h.set_holder_constructed(); } if (!v_h.holder_constructed() && inst->owned) { new (std::addressof(v_h.holder<holder_type>())) holder_type(v_h.value_ptr<type>()); v_h.set_holder_constructed(); } } static void init_holder_from_existing(const detail::value_and_holder &v_h, const holder_type *holder_ptr, std::true_type /*is_copy_constructible*/) { new (std::addressof(v_h.holder<holder_type>())) holder_type(*reinterpret_cast<const holder_type *>(holder_ptr)); } static void init_holder_from_existing(const detail::value_and_holder &v_h, const holder_type *holder_ptr, std::false_type /*is_copy_constructible*/) { new (std::addressof(v_h.holder<holder_type>())) holder_type(std::move(*const_cast<holder_type *>(holder_ptr))); } /// Initialize holder object, variant 2: try to construct from existing holder object, if possible static void init_holder(detail::instance *inst, detail::value_and_holder &v_h, const holder_type *holder_ptr, const void * /* dummy -- not enable_shared_from_this<T>) */) { if (holder_ptr) { init_holder_from_existing(v_h, holder_ptr, std::is_copy_constructible<holder_type>()); v_h.set_holder_constructed(); } else if (inst->owned || detail::always_construct_holder<holder_type>::value) { new (std::addressof(v_h.holder<holder_type>())) holder_type(v_h.value_ptr<type>()); v_h.set_holder_constructed(); } } /// Performs instance initialization including constructing a holder and registering the known /// instance. Should be called as soon as the `type` value_ptr is set for an instance. Takes an /// optional pointer to an existing holder to use; if not specified and the instance is /// `.owned`, a new holder will be constructed to manage the value pointer. static void init_instance(detail::instance *inst, const void *holder_ptr) { auto v_h = inst->get_value_and_holder(detail::get_type_info(typeid(type))); if (!v_h.instance_registered()) { register_instance(inst, v_h.value_ptr(), v_h.type); v_h.set_instance_registered(); } init_holder(inst, v_h, (const holder_type *) holder_ptr, v_h.value_ptr<type>()); } /// Deallocates an instance; via holder, if constructed; otherwise via operator delete. static void dealloc(detail::value_and_holder &v_h) { // We could be deallocating because we are cleaning up after a Python exception. // If so, the Python error indicator will be set. We need to clear that before // running the destructor, in case the destructor code calls more Python. // If we don't, the Python API will exit with an exception, and pybind11 will // throw error_already_set from the C++ destructor which is forbidden and triggers // std::terminate(). error_scope scope; if (v_h.holder_constructed()) { v_h.holder<holder_type>().~holder_type(); v_h.set_holder_constructed(false); } else { detail::call_operator_delete(v_h.value_ptr<type>(), v_h.type->type_size, v_h.type->type_align ); } v_h.value_ptr() = nullptr; } static detail::function_record *get_function_record(handle h) { h = detail::get_function(h); return h ? (detail::function_record *) reinterpret_borrow<capsule>(PyCFunction_GET_SELF(h.ptr())) : nullptr; } }; /// Binds an existing constructor taking arguments Args... template <typename... Args> detail::initimpl::constructor<Args...> init() { return {}; } /// Like `init<Args...>()`, but the instance is always constructed through the alias class (even /// when not inheriting on the Python side). template <typename... Args> detail::initimpl::alias_constructor<Args...> init_alias() { return {}; } /// Binds a factory function as a constructor template <typename Func, typename Ret = detail::initimpl::factory<Func>> Ret init(Func &&f) { return {std::forward<Func>(f)}; } /// Dual-argument factory function: the first function is called when no alias is needed, the second /// when an alias is needed (i.e. due to python-side inheritance). Arguments must be identical. template <typename CFunc, typename AFunc, typename Ret = detail::initimpl::factory<CFunc, AFunc>> Ret init(CFunc &&c, AFunc &&a) { return {std::forward<CFunc>(c), std::forward<AFunc>(a)}; } /// Binds pickling functions `__getstate__` and `__setstate__` and ensures that the type /// returned by `__getstate__` is the same as the argument accepted by `__setstate__`. template <typename GetState, typename SetState> detail::initimpl::pickle_factory<GetState, SetState> pickle(GetState &&g, SetState &&s) { return {std::forward<GetState>(g), std::forward<SetState>(s)}; } PYBIND11_NAMESPACE_BEGIN(detail) inline str enum_name(handle arg) { dict entries = arg.get_type().attr("__entries"); for (auto kv : entries) { if (handle(kv.second[int_(0)]).equal(arg)) return pybind11::str(kv.first); } return "???"; } struct enum_base { enum_base(const handle &base, const handle &parent) : m_base(base), m_parent(parent) { } PYBIND11_NOINLINE void init(bool is_arithmetic, bool is_convertible) { m_base.attr("__entries") = dict(); auto property = handle((PyObject *) &PyProperty_Type); auto static_property = handle((PyObject *) get_internals().static_property_type); m_base.attr("__repr__") = cpp_function( [](const object &arg) -> str { handle type = type::handle_of(arg); object type_name = type.attr("__name__"); return pybind11::str("<{}.{}: {}>").format(type_name, enum_name(arg), int_(arg)); }, name("__repr__"), is_method(m_base)); m_base.attr("name") = property(cpp_function(&enum_name, name("name"), is_method(m_base))); m_base.attr("__str__") = cpp_function( [](handle arg) -> str { object type_name = type::handle_of(arg).attr("__name__"); return pybind11::str("{}.{}").format(type_name, enum_name(arg)); }, name("name"), is_method(m_base) ); m_base.attr("__doc__") = static_property(cpp_function( [](handle arg) -> std::string { std::string docstring; dict entries = arg.attr("__entries"); if (((PyTypeObject *) arg.ptr())->tp_doc) docstring += std::string(((PyTypeObject *) arg.ptr())->tp_doc) + "\n\n"; docstring += "Members:"; for (auto kv : entries) { auto key = std::string(pybind11::str(kv.first)); auto comment = kv.second[int_(1)]; docstring += "\n\n " + key; if (!comment.is_none()) docstring += " : " + (std::string) pybind11::str(comment); } return docstring; }, name("__doc__") ), none(), none(), ""); m_base.attr("__members__") = static_property(cpp_function( [](handle arg) -> dict { dict entries = arg.attr("__entries"), m; for (auto kv : entries) m[kv.first] = kv.second[int_(0)]; return m; }, name("__members__")), none(), none(), "" ); #define PYBIND11_ENUM_OP_STRICT(op, expr, strict_behavior) \ m_base.attr(op) = cpp_function( \ [](const object &a, const object &b) { \ if (!type::handle_of(a).is(type::handle_of(b))) \ strict_behavior; /* NOLINT(bugprone-macro-parentheses) */ \ return expr; \ }, \ name(op), \ is_method(m_base), \ arg("other")) #define PYBIND11_ENUM_OP_CONV(op, expr) \ m_base.attr(op) = cpp_function( \ [](const object &a_, const object &b_) { \ int_ a(a_), b(b_); \ return expr; \ }, \ name(op), \ is_method(m_base), \ arg("other")) #define PYBIND11_ENUM_OP_CONV_LHS(op, expr) \ m_base.attr(op) = cpp_function( \ [](const object &a_, const object &b) { \ int_ a(a_); \ return expr; \ }, \ name(op), \ is_method(m_base), \ arg("other")) if (is_convertible) { PYBIND11_ENUM_OP_CONV_LHS("__eq__", !b.is_none() && a.equal(b)); PYBIND11_ENUM_OP_CONV_LHS("__ne__", b.is_none() || !a.equal(b)); if (is_arithmetic) { PYBIND11_ENUM_OP_CONV("__lt__", a < b); PYBIND11_ENUM_OP_CONV("__gt__", a > b); PYBIND11_ENUM_OP_CONV("__le__", a <= b); PYBIND11_ENUM_OP_CONV("__ge__", a >= b); PYBIND11_ENUM_OP_CONV("__and__", a & b); PYBIND11_ENUM_OP_CONV("__rand__", a & b); PYBIND11_ENUM_OP_CONV("__or__", a | b); PYBIND11_ENUM_OP_CONV("__ror__", a | b); PYBIND11_ENUM_OP_CONV("__xor__", a ^ b); PYBIND11_ENUM_OP_CONV("__rxor__", a ^ b); m_base.attr("__invert__") = cpp_function([](const object &arg) { return ~(int_(arg)); }, name("__invert__"), is_method(m_base)); } } else { PYBIND11_ENUM_OP_STRICT("__eq__", int_(a).equal(int_(b)), return false); PYBIND11_ENUM_OP_STRICT("__ne__", !int_(a).equal(int_(b)), return true); if (is_arithmetic) { #define PYBIND11_THROW throw type_error("Expected an enumeration of matching type!"); PYBIND11_ENUM_OP_STRICT("__lt__", int_(a) < int_(b), PYBIND11_THROW); PYBIND11_ENUM_OP_STRICT("__gt__", int_(a) > int_(b), PYBIND11_THROW); PYBIND11_ENUM_OP_STRICT("__le__", int_(a) <= int_(b), PYBIND11_THROW); PYBIND11_ENUM_OP_STRICT("__ge__", int_(a) >= int_(b), PYBIND11_THROW); #undef PYBIND11_THROW } } #undef PYBIND11_ENUM_OP_CONV_LHS #undef PYBIND11_ENUM_OP_CONV #undef PYBIND11_ENUM_OP_STRICT m_base.attr("__getstate__") = cpp_function( [](const object &arg) { return int_(arg); }, name("__getstate__"), is_method(m_base)); m_base.attr("__hash__") = cpp_function( [](const object &arg) { return int_(arg); }, name("__hash__"), is_method(m_base)); } PYBIND11_NOINLINE void value(char const* name_, object value, const char *doc = nullptr) { dict entries = m_base.attr("__entries"); str name(name_); if (entries.contains(name)) { std::string type_name = (std::string) str(m_base.attr("__name__")); throw value_error(type_name + ": element \"" + std::string(name_) + "\" already exists!"); } entries[name] = std::make_pair(value, doc); m_base.attr(name) = value; } PYBIND11_NOINLINE void export_values() { dict entries = m_base.attr("__entries"); for (auto kv : entries) m_parent.attr(kv.first) = kv.second[int_(0)]; } handle m_base; handle m_parent; }; template <bool is_signed, size_t length> struct equivalent_integer {}; template <> struct equivalent_integer<true, 1> { using type = int8_t; }; template <> struct equivalent_integer<false, 1> { using type = uint8_t; }; template <> struct equivalent_integer<true, 2> { using type = int16_t; }; template <> struct equivalent_integer<false, 2> { using type = uint16_t; }; template <> struct equivalent_integer<true, 4> { using type = int32_t; }; template <> struct equivalent_integer<false, 4> { using type = uint32_t; }; template <> struct equivalent_integer<true, 8> { using type = int64_t; }; template <> struct equivalent_integer<false, 8> { using type = uint64_t; }; template <typename IntLike> using equivalent_integer_t = typename equivalent_integer<std::is_signed<IntLike>::value, sizeof(IntLike)>::type; PYBIND11_NAMESPACE_END(detail) /// Binds C++ enumerations and enumeration classes to Python template <typename Type> class enum_ : public class_<Type> { public: using Base = class_<Type>; using Base::def; using Base::attr; using Base::def_property_readonly; using Base::def_property_readonly_static; using Underlying = typename std::underlying_type<Type>::type; // Scalar is the integer representation of underlying type using Scalar = detail::conditional_t<detail::any_of< detail::is_std_char_type<Underlying>, std::is_same<Underlying, bool> >::value, detail::equivalent_integer_t<Underlying>, Underlying>; template <typename... Extra> enum_(const handle &scope, const char *name, const Extra&... extra) : class_<Type>(scope, name, extra...), m_base(*this, scope) { constexpr bool is_arithmetic = detail::any_of<std::is_same<arithmetic, Extra>...>::value; constexpr bool is_convertible = std::is_convertible<Type, Underlying>::value; m_base.init(is_arithmetic, is_convertible); def(init([](Scalar i) { return static_cast<Type>(i); }), arg("value")); def_property_readonly("value", [](Type value) { return (Scalar) value; }); def("__int__", [](Type value) { return (Scalar) value; }); #if PY_MAJOR_VERSION < 3 def("__long__", [](Type value) { return (Scalar) value; }); #endif #if PY_MAJOR_VERSION > 3 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 8) def("__index__", [](Type value) { return (Scalar) value; }); #endif attr("__setstate__") = cpp_function( [](detail::value_and_holder &v_h, Scalar arg) { detail::initimpl::setstate<Base>(v_h, static_cast<Type>(arg), Py_TYPE(v_h.inst) != v_h.type->type); }, detail::is_new_style_constructor(), pybind11::name("__setstate__"), is_method(*this), arg("state")); } /// Export enumeration entries into the parent scope enum_& export_values() { m_base.export_values(); return *this; } /// Add an enumeration entry enum_& value(char const* name, Type value, const char *doc = nullptr) { m_base.value(name, pybind11::cast(value, return_value_policy::copy), doc); return *this; } private: detail::enum_base m_base; }; PYBIND11_NAMESPACE_BEGIN(detail) PYBIND11_NOINLINE void keep_alive_impl(handle nurse, handle patient) { if (!nurse || !patient) pybind11_fail("Could not activate keep_alive!"); if (patient.is_none() || nurse.is_none()) return; /* Nothing to keep alive or nothing to be kept alive by */ auto tinfo = all_type_info(Py_TYPE(nurse.ptr())); if (!tinfo.empty()) { /* It's a pybind-registered type, so we can store the patient in the * internal list. */ add_patient(nurse.ptr(), patient.ptr()); } else { /* Fall back to clever approach based on weak references taken from * Boost.Python. This is not used for pybind-registered types because * the objects can be destroyed out-of-order in a GC pass. */ cpp_function disable_lifesupport( [patient](handle weakref) { patient.dec_ref(); weakref.dec_ref(); }); weakref wr(nurse, disable_lifesupport); patient.inc_ref(); /* reference patient and leak the weak reference */ (void) wr.release(); } } PYBIND11_NOINLINE void keep_alive_impl(size_t Nurse, size_t Patient, function_call &call, handle ret) { auto get_arg = [&](size_t n) { if (n == 0) return ret; if (n == 1 && call.init_self) return call.init_self; if (n <= call.args.size()) return call.args[n - 1]; return handle(); }; keep_alive_impl(get_arg(Nurse), get_arg(Patient)); } inline std::pair<decltype(internals::registered_types_py)::iterator, bool> all_type_info_get_cache(PyTypeObject *type) { auto res = get_internals().registered_types_py #ifdef __cpp_lib_unordered_map_try_emplace .try_emplace(type); #else .emplace(type, std::vector<detail::type_info *>()); #endif if (res.second) { // New cache entry created; set up a weak reference to automatically remove it if the type // gets destroyed: weakref((PyObject *) type, cpp_function([type](handle wr) { get_internals().registered_types_py.erase(type); wr.dec_ref(); })).release(); } return res; } template <typename Iterator, typename Sentinel, bool KeyIterator, return_value_policy Policy> struct iterator_state { Iterator it; Sentinel end; bool first_or_done; }; PYBIND11_NAMESPACE_END(detail) /// Makes a python iterator from a first and past-the-end C++ InputIterator. template <return_value_policy Policy = return_value_policy::reference_internal, typename Iterator, typename Sentinel, #ifndef DOXYGEN_SHOULD_SKIP_THIS // Issue in breathe 4.26.1 typename ValueType = decltype(*std::declval<Iterator>()), #endif typename... Extra> iterator make_iterator(Iterator first, Sentinel last, Extra &&... extra) { using state = detail::iterator_state<Iterator, Sentinel, false, Policy>; if (!detail::get_type_info(typeid(state), false)) { class_<state>(handle(), "iterator", pybind11::module_local()) .def("__iter__", [](state &s) -> state& { return s; }) .def("__next__", [](state &s) -> ValueType { if (!s.first_or_done) ++s.it; else s.first_or_done = false; if (s.it == s.end) { s.first_or_done = true; throw stop_iteration(); } return *s.it; // NOLINTNEXTLINE(readability-const-return-type) // PR #3263 }, std::forward<Extra>(extra)..., Policy); } return cast(state{first, last, true}); } /// Makes an python iterator over the keys (`.first`) of a iterator over pairs from a /// first and past-the-end InputIterator. template <return_value_policy Policy = return_value_policy::reference_internal, typename Iterator, typename Sentinel, #ifndef DOXYGEN_SHOULD_SKIP_THIS // Issue in breathe 4.26.1 typename KeyType = decltype((*std::declval<Iterator>()).first), #endif typename... Extra> iterator make_key_iterator(Iterator first, Sentinel last, Extra &&...extra) { using state = detail::iterator_state<Iterator, Sentinel, true, Policy>; if (!detail::get_type_info(typeid(state), false)) { class_<state>(handle(), "iterator", pybind11::module_local()) .def("__iter__", [](state &s) -> state& { return s; }) .def("__next__", [](state &s) -> detail::remove_cv_t<KeyType> { if (!s.first_or_done) ++s.it; else s.first_or_done = false; if (s.it == s.end) { s.first_or_done = true; throw stop_iteration(); } return (*s.it).first; }, std::forward<Extra>(extra)..., Policy); } return cast(state{first, last, true}); } /// Makes an iterator over values of an stl container or other container supporting /// `std::begin()`/`std::end()` template <return_value_policy Policy = return_value_policy::reference_internal, typename Type, typename... Extra> iterator make_iterator(Type &value, Extra&&... extra) { return make_iterator<Policy>(std::begin(value), std::end(value), extra...); } /// Makes an iterator over the keys (`.first`) of a stl map-like container supporting /// `std::begin()`/`std::end()` template <return_value_policy Policy = return_value_policy::reference_internal, typename Type, typename... Extra> iterator make_key_iterator(Type &value, Extra&&... extra) { return make_key_iterator<Policy>(std::begin(value), std::end(value), extra...); } template <typename InputType, typename OutputType> void implicitly_convertible() { struct set_flag { bool &flag; explicit set_flag(bool &flag_) : flag(flag_) { flag_ = true; } ~set_flag() { flag = false; } }; auto implicit_caster = [](PyObject *obj, PyTypeObject *type) -> PyObject * { static bool currently_used = false; if (currently_used) // implicit conversions are non-reentrant return nullptr; set_flag flag_helper(currently_used); if (!detail::make_caster<InputType>().load(obj, false)) return nullptr; tuple args(1); args[0] = obj; PyObject *result = PyObject_Call((PyObject *) type, args.ptr(), nullptr); if (result == nullptr) PyErr_Clear(); return result; }; if (auto tinfo = detail::get_type_info(typeid(OutputType))) tinfo->implicit_conversions.push_back(implicit_caster); else pybind11_fail("implicitly_convertible: Unable to find type " + type_id<OutputType>()); } inline void register_exception_translator(ExceptionTranslator &&translator) { detail::get_internals().registered_exception_translators.push_front( std::forward<ExceptionTranslator>(translator)); } /** * Add a new module-local exception translator. Locally registered functions * will be tried before any globally registered exception translators, which * will only be invoked if the module-local handlers do not deal with * the exception. */ inline void register_local_exception_translator(ExceptionTranslator &&translator) { detail::get_local_internals().registered_exception_translators.push_front( std::forward<ExceptionTranslator>(translator)); } /** * Wrapper to generate a new Python exception type. * * This should only be used with PyErr_SetString for now. * It is not (yet) possible to use as a py::base. * Template type argument is reserved for future use. */ template <typename type> class exception : public object { public: exception() = default; exception(handle scope, const char *name, handle base = PyExc_Exception) { std::string full_name = scope.attr("__name__").cast<std::string>() + std::string(".") + name; m_ptr = PyErr_NewException(const_cast<char *>(full_name.c_str()), base.ptr(), NULL); if (hasattr(scope, "__dict__") && scope.attr("__dict__").contains(name)) pybind11_fail("Error during initialization: multiple incompatible " "definitions with name \"" + std::string(name) + "\""); scope.attr(name) = *this; } // Sets the current python exception to this exception object with the given message void operator()(const char *message) { PyErr_SetString(m_ptr, message); } }; PYBIND11_NAMESPACE_BEGIN(detail) // Returns a reference to a function-local static exception object used in the simple // register_exception approach below. (It would be simpler to have the static local variable // directly in register_exception, but that makes clang <3.5 segfault - issue #1349). template <typename CppException> exception<CppException> &get_exception_object() { static exception<CppException> ex; return ex; } // Helper function for register_exception and register_local_exception template <typename CppException> exception<CppException> &register_exception_impl(handle scope, const char *name, handle base, bool isLocal) { auto &ex = detail::get_exception_object<CppException>(); if (!ex) ex = exception<CppException>(scope, name, base); auto register_func = isLocal ? &register_local_exception_translator : &register_exception_translator; register_func([](std::exception_ptr p) { if (!p) return; try { std::rethrow_exception(p); } catch (const CppException &e) { detail::get_exception_object<CppException>()(e.what()); } }); return ex; } PYBIND11_NAMESPACE_END(detail) /** * Registers a Python exception in `m` of the given `name` and installs a translator to * translate the C++ exception to the created Python exception using the what() method. * This is intended for simple exception translations; for more complex translation, register the * exception object and translator directly. */ template <typename CppException> exception<CppException> &register_exception(handle scope, const char *name, handle base = PyExc_Exception) { return detail::register_exception_impl<CppException>(scope, name, base, false /* isLocal */); } /** * Registers a Python exception in `m` of the given `name` and installs a translator to * translate the C++ exception to the created Python exception using the what() method. * This translator will only be used for exceptions that are thrown in this module and will be * tried before global exception translators, including those registered with register_exception. * This is intended for simple exception translations; for more complex translation, register the * exception object and translator directly. */ template <typename CppException> exception<CppException> &register_local_exception(handle scope, const char *name, handle base = PyExc_Exception) { return detail::register_exception_impl<CppException>(scope, name, base, true /* isLocal */); } PYBIND11_NAMESPACE_BEGIN(detail) PYBIND11_NOINLINE void print(const tuple &args, const dict &kwargs) { auto strings = tuple(args.size()); for (size_t i = 0; i < args.size(); ++i) { strings[i] = str(args[i]); } auto sep = kwargs.contains("sep") ? kwargs["sep"] : cast(" "); auto line = sep.attr("join")(strings); object file; if (kwargs.contains("file")) { file = kwargs["file"].cast<object>(); } else { try { file = module_::import("sys").attr("stdout"); } catch (const error_already_set &) { /* If print() is called from code that is executed as part of garbage collection during interpreter shutdown, importing 'sys' can fail. Give up rather than crashing the interpreter in this case. */ return; } } auto write = file.attr("write"); write(line); write(kwargs.contains("end") ? kwargs["end"] : cast("\n")); if (kwargs.contains("flush") && kwargs["flush"].cast<bool>()) file.attr("flush")(); } PYBIND11_NAMESPACE_END(detail) template <return_value_policy policy = return_value_policy::automatic_reference, typename... Args> void print(Args &&...args) { auto c = detail::collect_arguments<policy>(std::forward<Args>(args)...); detail::print(c.args(), c.kwargs()); } error_already_set::~error_already_set() { if (m_type) { gil_scoped_acquire gil; error_scope scope; m_type.release().dec_ref(); m_value.release().dec_ref(); m_trace.release().dec_ref(); } } PYBIND11_NAMESPACE_BEGIN(detail) inline function get_type_override(const void *this_ptr, const type_info *this_type, const char *name) { handle self = get_object_handle(this_ptr, this_type); if (!self) return function(); handle type = type::handle_of(self); auto key = std::make_pair(type.ptr(), name); /* Cache functions that aren't overridden in Python to avoid many costly Python dictionary lookups below */ auto &cache = get_internals().inactive_override_cache; if (cache.find(key) != cache.end()) return function(); function override = getattr(self, name, function()); if (override.is_cpp_function()) { cache.insert(key); return function(); } /* Don't call dispatch code if invoked from overridden function. Unfortunately this doesn't work on PyPy. */ #if !defined(PYPY_VERSION) PyFrameObject *frame = PyThreadState_Get()->frame; if (frame != nullptr && (std::string) str(frame->f_code->co_name) == name && frame->f_code->co_argcount > 0) { PyFrame_FastToLocals(frame); PyObject *self_caller = dict_getitem( frame->f_locals, PyTuple_GET_ITEM(frame->f_code->co_varnames, 0)); if (self_caller == self.ptr()) return function(); } #else /* PyPy currently doesn't provide a detailed cpyext emulation of frame objects, so we have to emulate this using Python. This is going to be slow..*/ dict d; d["self"] = self; d["name"] = pybind11::str(name); PyObject *result = PyRun_String( "import inspect\n" "frame = inspect.currentframe()\n" "if frame is not None:\n" " frame = frame.f_back\n" " if frame is not None and str(frame.f_code.co_name) == name and " "frame.f_code.co_argcount > 0:\n" " self_caller = frame.f_locals[frame.f_code.co_varnames[0]]\n" " if self_caller == self:\n" " self = None\n", Py_file_input, d.ptr(), d.ptr()); if (result == nullptr) throw error_already_set(); if (d["self"].is_none()) return function(); Py_DECREF(result); #endif return override; } PYBIND11_NAMESPACE_END(detail) /** \rst Try to retrieve a python method by the provided name from the instance pointed to by the this_ptr. :this_ptr: The pointer to the object the overridden method should be retrieved for. This should be the first non-trampoline class encountered in the inheritance chain. :name: The name of the overridden Python method to retrieve. :return: The Python method by this name from the object or an empty function wrapper. \endrst */ template <class T> function get_override(const T *this_ptr, const char *name) { auto tinfo = detail::get_type_info(typeid(T)); return tinfo ? detail::get_type_override(this_ptr, tinfo, name) : function(); } #define PYBIND11_OVERRIDE_IMPL(ret_type, cname, name, ...) \ do { \ pybind11::gil_scoped_acquire gil; \ pybind11::function override \ = pybind11::get_override(static_cast<const cname *>(this), name); \ if (override) { \ auto o = override(__VA_ARGS__); \ if (pybind11::detail::cast_is_temporary_value_reference<ret_type>::value) { \ static pybind11::detail::override_caster_t<ret_type> caster; \ return pybind11::detail::cast_ref<ret_type>(std::move(o), caster); \ } \ return pybind11::detail::cast_safe<ret_type>(std::move(o)); \ } \ } while (false) /** \rst Macro to populate the virtual method in the trampoline class. This macro tries to look up a method named 'fn' from the Python side, deals with the :ref:`gil` and necessary argument conversions to call this method and return the appropriate type. See :ref:`overriding_virtuals` for more information. This macro should be used when the method name in C is not the same as the method name in Python. For example with `__str__`. .. code-block:: cpp std::string toString() override { PYBIND11_OVERRIDE_NAME( std::string, // Return type (ret_type) Animal, // Parent class (cname) "__str__", // Name of method in Python (name) toString, // Name of function in C++ (fn) ); } \endrst */ #define PYBIND11_OVERRIDE_NAME(ret_type, cname, name, fn, ...) \ do { \ PYBIND11_OVERRIDE_IMPL(PYBIND11_TYPE(ret_type), PYBIND11_TYPE(cname), name, __VA_ARGS__); \ return cname::fn(__VA_ARGS__); \ } while (false) /** \rst Macro for pure virtual functions, this function is identical to :c:macro:`PYBIND11_OVERRIDE_NAME`, except that it throws if no override can be found. \endrst */ #define PYBIND11_OVERRIDE_PURE_NAME(ret_type, cname, name, fn, ...) \ do { \ PYBIND11_OVERRIDE_IMPL(PYBIND11_TYPE(ret_type), PYBIND11_TYPE(cname), name, __VA_ARGS__); \ pybind11::pybind11_fail("Tried to call pure virtual function \"" PYBIND11_STRINGIFY(cname) "::" name "\""); \ } while (false) /** \rst Macro to populate the virtual method in the trampoline class. This macro tries to look up the method from the Python side, deals with the :ref:`gil` and necessary argument conversions to call this method and return the appropriate type. This macro should be used if the method name in C and in Python are identical. See :ref:`overriding_virtuals` for more information. .. code-block:: cpp class PyAnimal : public Animal { public: // Inherit the constructors using Animal::Animal; // Trampoline (need one for each virtual function) std::string go(int n_times) override { PYBIND11_OVERRIDE_PURE( std::string, // Return type (ret_type) Animal, // Parent class (cname) go, // Name of function in C++ (must match Python name) (fn) n_times // Argument(s) (...) ); } }; \endrst */ #define PYBIND11_OVERRIDE(ret_type, cname, fn, ...) \ PYBIND11_OVERRIDE_NAME(PYBIND11_TYPE(ret_type), PYBIND11_TYPE(cname), #fn, fn, __VA_ARGS__) /** \rst Macro for pure virtual functions, this function is identical to :c:macro:`PYBIND11_OVERRIDE`, except that it throws if no override can be found. \endrst */ #define PYBIND11_OVERRIDE_PURE(ret_type, cname, fn, ...) \ PYBIND11_OVERRIDE_PURE_NAME(PYBIND11_TYPE(ret_type), PYBIND11_TYPE(cname), #fn, fn, __VA_ARGS__) // Deprecated versions PYBIND11_DEPRECATED("get_type_overload has been deprecated") inline function get_type_overload(const void *this_ptr, const detail::type_info *this_type, const char *name) { return detail::get_type_override(this_ptr, this_type, name); } template <class T> inline function get_overload(const T *this_ptr, const char *name) { return get_override(this_ptr, name); } #define PYBIND11_OVERLOAD_INT(ret_type, cname, name, ...) \ PYBIND11_OVERRIDE_IMPL(PYBIND11_TYPE(ret_type), PYBIND11_TYPE(cname), name, __VA_ARGS__) #define PYBIND11_OVERLOAD_NAME(ret_type, cname, name, fn, ...) \ PYBIND11_OVERRIDE_NAME(PYBIND11_TYPE(ret_type), PYBIND11_TYPE(cname), name, fn, __VA_ARGS__) #define PYBIND11_OVERLOAD_PURE_NAME(ret_type, cname, name, fn, ...) \ PYBIND11_OVERRIDE_PURE_NAME(PYBIND11_TYPE(ret_type), PYBIND11_TYPE(cname), name, fn, __VA_ARGS__); #define PYBIND11_OVERLOAD(ret_type, cname, fn, ...) \ PYBIND11_OVERRIDE(PYBIND11_TYPE(ret_type), PYBIND11_TYPE(cname), fn, __VA_ARGS__) #define PYBIND11_OVERLOAD_PURE(ret_type, cname, fn, ...) \ PYBIND11_OVERRIDE_PURE(PYBIND11_TYPE(ret_type), PYBIND11_TYPE(cname), fn, __VA_ARGS__); PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE) #if defined(__GNUC__) && __GNUC__ == 7 # pragma GCC diagnostic pop // -Wnoexcept-type #endif
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/sources/thirdparty/pybind11/chrono.h
/* pybind11/chrono.h: Transparent conversion between std::chrono and python's datetime Copyright (c) 2016 Trent Houliston <[email protected]> and Wenzel Jakob <[email protected]> All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. */ #pragma once #include "pybind11.h" #include <chrono> #include <cmath> #include <ctime> #include <mutex> #include <time.h> #include <datetime.h> // Backport the PyDateTime_DELTA functions from Python3.3 if required #ifndef PyDateTime_DELTA_GET_DAYS #define PyDateTime_DELTA_GET_DAYS(o) (((PyDateTime_Delta*)o)->days) #endif #ifndef PyDateTime_DELTA_GET_SECONDS #define PyDateTime_DELTA_GET_SECONDS(o) (((PyDateTime_Delta*)o)->seconds) #endif #ifndef PyDateTime_DELTA_GET_MICROSECONDS #define PyDateTime_DELTA_GET_MICROSECONDS(o) (((PyDateTime_Delta*)o)->microseconds) #endif PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) PYBIND11_NAMESPACE_BEGIN(detail) template <typename type> class duration_caster { public: using rep = typename type::rep; using period = typename type::period; using days = std::chrono::duration<int_least32_t, std::ratio<86400>>; // signed 25 bits required by the standard. bool load(handle src, bool) { using namespace std::chrono; // Lazy initialise the PyDateTime import if (!PyDateTimeAPI) { PyDateTime_IMPORT; } if (!src) return false; // If invoked with datetime.delta object if (PyDelta_Check(src.ptr())) { value = type(duration_cast<duration<rep, period>>( days(PyDateTime_DELTA_GET_DAYS(src.ptr())) + seconds(PyDateTime_DELTA_GET_SECONDS(src.ptr())) + microseconds(PyDateTime_DELTA_GET_MICROSECONDS(src.ptr())))); return true; } // If invoked with a float we assume it is seconds and convert if (PyFloat_Check(src.ptr())) { value = type(duration_cast<duration<rep, period>>(duration<double>(PyFloat_AsDouble(src.ptr())))); return true; } return false; } // If this is a duration just return it back static const std::chrono::duration<rep, period>& get_duration(const std::chrono::duration<rep, period> &src) { return src; } // If this is a time_point get the time_since_epoch template <typename Clock> static std::chrono::duration<rep, period> get_duration(const std::chrono::time_point<Clock, std::chrono::duration<rep, period>> &src) { return src.time_since_epoch(); } static handle cast(const type &src, return_value_policy /* policy */, handle /* parent */) { using namespace std::chrono; // Use overloaded function to get our duration from our source // Works out if it is a duration or time_point and get the duration auto d = get_duration(src); // Lazy initialise the PyDateTime import if (!PyDateTimeAPI) { PyDateTime_IMPORT; } // Declare these special duration types so the conversions happen with the correct primitive types (int) using dd_t = duration<int, std::ratio<86400>>; using ss_t = duration<int, std::ratio<1>>; using us_t = duration<int, std::micro>; auto dd = duration_cast<dd_t>(d); auto subd = d - dd; auto ss = duration_cast<ss_t>(subd); auto us = duration_cast<us_t>(subd - ss); return PyDelta_FromDSU(dd.count(), ss.count(), us.count()); } PYBIND11_TYPE_CASTER(type, _("datetime.timedelta")); }; inline std::tm *localtime_thread_safe(const std::time_t *time, std::tm *buf) { #if (defined(__STDC_LIB_EXT1__) && defined(__STDC_WANT_LIB_EXT1__)) || defined(_MSC_VER) if (localtime_s(buf, time)) return nullptr; return buf; #else static std::mutex mtx; std::lock_guard<std::mutex> lock(mtx); std::tm *tm_ptr = localtime(time); if (tm_ptr != nullptr) { *buf = *tm_ptr; } return tm_ptr; #endif } // This is for casting times on the system clock into datetime.datetime instances template <typename Duration> class type_caster<std::chrono::time_point<std::chrono::system_clock, Duration>> { public: using type = std::chrono::time_point<std::chrono::system_clock, Duration>; bool load(handle src, bool) { using namespace std::chrono; // Lazy initialise the PyDateTime import if (!PyDateTimeAPI) { PyDateTime_IMPORT; } if (!src) return false; std::tm cal; microseconds msecs; if (PyDateTime_Check(src.ptr())) { cal.tm_sec = PyDateTime_DATE_GET_SECOND(src.ptr()); cal.tm_min = PyDateTime_DATE_GET_MINUTE(src.ptr()); cal.tm_hour = PyDateTime_DATE_GET_HOUR(src.ptr()); cal.tm_mday = PyDateTime_GET_DAY(src.ptr()); cal.tm_mon = PyDateTime_GET_MONTH(src.ptr()) - 1; cal.tm_year = PyDateTime_GET_YEAR(src.ptr()) - 1900; cal.tm_isdst = -1; msecs = microseconds(PyDateTime_DATE_GET_MICROSECOND(src.ptr())); } else if (PyDate_Check(src.ptr())) { cal.tm_sec = 0; cal.tm_min = 0; cal.tm_hour = 0; cal.tm_mday = PyDateTime_GET_DAY(src.ptr()); cal.tm_mon = PyDateTime_GET_MONTH(src.ptr()) - 1; cal.tm_year = PyDateTime_GET_YEAR(src.ptr()) - 1900; cal.tm_isdst = -1; msecs = microseconds(0); } else if (PyTime_Check(src.ptr())) { cal.tm_sec = PyDateTime_TIME_GET_SECOND(src.ptr()); cal.tm_min = PyDateTime_TIME_GET_MINUTE(src.ptr()); cal.tm_hour = PyDateTime_TIME_GET_HOUR(src.ptr()); cal.tm_mday = 1; // This date (day, month, year) = (1, 0, 70) cal.tm_mon = 0; // represents 1-Jan-1970, which is the first cal.tm_year = 70; // earliest available date for Python's datetime cal.tm_isdst = -1; msecs = microseconds(PyDateTime_TIME_GET_MICROSECOND(src.ptr())); } else return false; value = time_point_cast<Duration>(system_clock::from_time_t(std::mktime(&cal)) + msecs); return true; } static handle cast(const std::chrono::time_point<std::chrono::system_clock, Duration> &src, return_value_policy /* policy */, handle /* parent */) { using namespace std::chrono; // Lazy initialise the PyDateTime import if (!PyDateTimeAPI) { PyDateTime_IMPORT; } // Get out microseconds, and make sure they are positive, to avoid bug in eastern hemisphere time zones // (cfr. https://github.com/pybind/pybind11/issues/2417) using us_t = duration<int, std::micro>; auto us = duration_cast<us_t>(src.time_since_epoch() % seconds(1)); if (us.count() < 0) us += seconds(1); // Subtract microseconds BEFORE `system_clock::to_time_t`, because: // > If std::time_t has lower precision, it is implementation-defined whether the value is rounded or truncated. // (https://en.cppreference.com/w/cpp/chrono/system_clock/to_time_t) std::time_t tt = system_clock::to_time_t(time_point_cast<system_clock::duration>(src - us)); std::tm localtime; std::tm *localtime_ptr = localtime_thread_safe(&tt, &localtime); if (!localtime_ptr) throw cast_error("Unable to represent system_clock in local time"); return PyDateTime_FromDateAndTime(localtime.tm_year + 1900, localtime.tm_mon + 1, localtime.tm_mday, localtime.tm_hour, localtime.tm_min, localtime.tm_sec, us.count()); } PYBIND11_TYPE_CASTER(type, _("datetime.datetime")); }; // Other clocks that are not the system clock are not measured as datetime.datetime objects // since they are not measured on calendar time. So instead we just make them timedeltas // Or if they have passed us a time as a float we convert that template <typename Clock, typename Duration> class type_caster<std::chrono::time_point<Clock, Duration>> : public duration_caster<std::chrono::time_point<Clock, Duration>> { }; template <typename Rep, typename Period> class type_caster<std::chrono::duration<Rep, Period>> : public duration_caster<std::chrono::duration<Rep, Period>> { }; PYBIND11_NAMESPACE_END(detail) PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)
Toni-SM/semu.xr.openxr/src/semu.xr.openxr/sources/thirdparty/pybind11/complex.h
/* pybind11/complex.h: Complex number support Copyright (c) 2016 Wenzel Jakob <[email protected]> All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. */ #pragma once #include "pybind11.h" #include <complex> /// glibc defines I as a macro which breaks things, e.g., boost template names #ifdef I # undef I #endif PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) template <typename T> struct format_descriptor<std::complex<T>, detail::enable_if_t<std::is_floating_point<T>::value>> { static constexpr const char c = format_descriptor<T>::c; static constexpr const char value[3] = { 'Z', c, '\0' }; static std::string format() { return std::string(value); } }; #ifndef PYBIND11_CPP17 template <typename T> constexpr const char format_descriptor< std::complex<T>, detail::enable_if_t<std::is_floating_point<T>::value>>::value[3]; #endif PYBIND11_NAMESPACE_BEGIN(detail) template <typename T> struct is_fmt_numeric<std::complex<T>, detail::enable_if_t<std::is_floating_point<T>::value>> { static constexpr bool value = true; static constexpr int index = is_fmt_numeric<T>::index + 3; }; template <typename T> class type_caster<std::complex<T>> { public: bool load(handle src, bool convert) { if (!src) return false; if (!convert && !PyComplex_Check(src.ptr())) return false; Py_complex result = PyComplex_AsCComplex(src.ptr()); if (result.real == -1.0 && PyErr_Occurred()) { PyErr_Clear(); return false; } value = std::complex<T>((T) result.real, (T) result.imag); return true; } static handle cast(const std::complex<T> &src, return_value_policy /* policy */, handle /* parent */) { return PyComplex_FromDoubles((double) src.real(), (double) src.imag()); } PYBIND11_TYPE_CASTER(std::complex<T>, _("complex")); }; PYBIND11_NAMESPACE_END(detail) PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)