Fix schema naming in mjcPhysics to avoid collisions.
PiperOrigin-RevId: 780537076 Change-Id: I4ea24162ba20d6aae10207491f9aae2250808576
This commit is contained in:
committed by
Copybara-Service
parent
d464165e30
commit
e507e31922
@@ -35,7 +35,7 @@ PXR_NAMESPACE_OPEN_SCOPE
|
|||||||
class SdfAssetPath;
|
class SdfAssetPath;
|
||||||
|
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
// PHYSICSACTUATORAPI //
|
// MJCACTUATORAPI //
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
|
|
||||||
/// \class MjcPhysicsActuatorAPI
|
/// \class MjcPhysicsActuatorAPI
|
||||||
@@ -111,7 +111,7 @@ class MjcPhysicsActuatorAPI : public UsdAPISchemaBase {
|
|||||||
static bool CanApply(const UsdPrim &prim, std::string *whyNot = nullptr);
|
static bool CanApply(const UsdPrim &prim, std::string *whyNot = nullptr);
|
||||||
|
|
||||||
/// Applies this <b>single-apply</b> API schema to the given \p prim.
|
/// Applies this <b>single-apply</b> API schema to the given \p prim.
|
||||||
/// This information is stored by adding "PhysicsActuatorAPI" to the
|
/// This information is stored by adding "MjcActuatorAPI" to the
|
||||||
/// token-valued, listOp metadata \em apiSchemas on the prim.
|
/// token-valued, listOp metadata \em apiSchemas on the prim.
|
||||||
///
|
///
|
||||||
/// \return A valid MjcPhysicsActuatorAPI object is returned upon success.
|
/// \return A valid MjcPhysicsActuatorAPI object is returned upon success.
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ PXR_NAMESPACE_OPEN_SCOPE
|
|||||||
class SdfAssetPath;
|
class SdfAssetPath;
|
||||||
|
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
// COLLISIONAPI //
|
// MJCCOLLISIONAPI //
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
|
|
||||||
/// \class MjcPhysicsCollisionAPI
|
/// \class MjcPhysicsCollisionAPI
|
||||||
@@ -106,7 +106,7 @@ class MjcPhysicsCollisionAPI : public UsdAPISchemaBase {
|
|||||||
static bool CanApply(const UsdPrim &prim, std::string *whyNot = nullptr);
|
static bool CanApply(const UsdPrim &prim, std::string *whyNot = nullptr);
|
||||||
|
|
||||||
/// Applies this <b>single-apply</b> API schema to the given \p prim.
|
/// Applies this <b>single-apply</b> API schema to the given \p prim.
|
||||||
/// This information is stored by adding "CollisionAPI" to the
|
/// This information is stored by adding "MjcCollisionAPI" to the
|
||||||
/// token-valued, listOp metadata \em apiSchemas on the prim.
|
/// token-valued, listOp metadata \em apiSchemas on the prim.
|
||||||
///
|
///
|
||||||
/// \return A valid MjcPhysicsCollisionAPI object is returned upon success.
|
/// \return A valid MjcPhysicsCollisionAPI object is returned upon success.
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ PXR_NAMESPACE_OPEN_SCOPE
|
|||||||
class SdfAssetPath;
|
class SdfAssetPath;
|
||||||
|
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
// PHYSICSJOINTSAPI //
|
// MJCJOINTAPI //
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
|
|
||||||
/// \class MjcPhysicsJointAPI
|
/// \class MjcPhysicsJointAPI
|
||||||
@@ -110,7 +110,7 @@ class MjcPhysicsJointAPI : public UsdAPISchemaBase {
|
|||||||
static bool CanApply(const UsdPrim &prim, std::string *whyNot = nullptr);
|
static bool CanApply(const UsdPrim &prim, std::string *whyNot = nullptr);
|
||||||
|
|
||||||
/// Applies this <b>single-apply</b> API schema to the given \p prim.
|
/// Applies this <b>single-apply</b> API schema to the given \p prim.
|
||||||
/// This information is stored by adding "PhysicsJointsAPI" to the
|
/// This information is stored by adding "MjcJointAPI" to the
|
||||||
/// token-valued, listOp metadata \em apiSchemas on the prim.
|
/// token-valued, listOp metadata \em apiSchemas on the prim.
|
||||||
///
|
///
|
||||||
/// \return A valid MjcPhysicsJointAPI object is returned upon success.
|
/// \return A valid MjcPhysicsJointAPI object is returned upon success.
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ PXR_NAMESPACE_OPEN_SCOPE
|
|||||||
class SdfAssetPath;
|
class SdfAssetPath;
|
||||||
|
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
// KEYFRAME //
|
// MJCKEYFRAME //
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
|
|
||||||
/// \class MjcPhysicsKeyframe
|
/// \class MjcPhysicsKeyframe
|
||||||
|
|||||||
@@ -35,12 +35,12 @@ PXR_NAMESPACE_OPEN_SCOPE
|
|||||||
class SdfAssetPath;
|
class SdfAssetPath;
|
||||||
|
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
// MESHCOLLISIONAPI //
|
// MJCMESHCOLLISIONAPI //
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
|
|
||||||
/// \class MjcPhysicsMeshCollisionAPI
|
/// \class MjcPhysicsMeshCollisionAPI
|
||||||
///
|
///
|
||||||
/// API describing a Mujoco collider.
|
/// API describing a Mujoco mesh collider.
|
||||||
///
|
///
|
||||||
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values
|
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values
|
||||||
/// below that are text/tokens, the actual token is published and defined in
|
/// below that are text/tokens, the actual token is published and defined in
|
||||||
@@ -111,7 +111,7 @@ class MjcPhysicsMeshCollisionAPI : public UsdAPISchemaBase {
|
|||||||
static bool CanApply(const UsdPrim &prim, std::string *whyNot = nullptr);
|
static bool CanApply(const UsdPrim &prim, std::string *whyNot = nullptr);
|
||||||
|
|
||||||
/// Applies this <b>single-apply</b> API schema to the given \p prim.
|
/// Applies this <b>single-apply</b> API schema to the given \p prim.
|
||||||
/// This information is stored by adding "MeshCollisionAPI" to the
|
/// This information is stored by adding "MjcMeshCollisionAPI" to the
|
||||||
/// token-valued, listOp metadata \em apiSchemas on the prim.
|
/// token-valued, listOp metadata \em apiSchemas on the prim.
|
||||||
///
|
///
|
||||||
/// \return A valid MjcPhysicsMeshCollisionAPI object is returned upon
|
/// \return A valid MjcPhysicsMeshCollisionAPI object is returned upon
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ PXR_NAMESPACE_OPEN_SCOPE
|
|||||||
class SdfAssetPath;
|
class SdfAssetPath;
|
||||||
|
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
// SCENEAPI //
|
// MJCSCENEAPI //
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
|
|
||||||
/// \class MjcPhysicsSceneAPI
|
/// \class MjcPhysicsSceneAPI
|
||||||
@@ -110,7 +110,7 @@ class MjcPhysicsSceneAPI : public UsdAPISchemaBase {
|
|||||||
static bool CanApply(const UsdPrim &prim, std::string *whyNot = nullptr);
|
static bool CanApply(const UsdPrim &prim, std::string *whyNot = nullptr);
|
||||||
|
|
||||||
/// Applies this <b>single-apply</b> API schema to the given \p prim.
|
/// Applies this <b>single-apply</b> API schema to the given \p prim.
|
||||||
/// This information is stored by adding "SceneAPI" to the
|
/// This information is stored by adding "MjcSceneAPI" to the
|
||||||
/// token-valued, listOp metadata \em apiSchemas on the prim.
|
/// token-valued, listOp metadata \em apiSchemas on the prim.
|
||||||
///
|
///
|
||||||
/// \return A valid MjcPhysicsSceneAPI object is returned upon success.
|
/// \return A valid MjcPhysicsSceneAPI object is returned upon success.
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ PXR_NAMESPACE_OPEN_SCOPE
|
|||||||
class SdfAssetPath;
|
class SdfAssetPath;
|
||||||
|
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
// SITEAPI //
|
// MJCSITEAPI //
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
|
|
||||||
/// \class MjcPhysicsSiteAPI
|
/// \class MjcPhysicsSiteAPI
|
||||||
@@ -104,7 +104,7 @@ class MjcPhysicsSiteAPI : public UsdAPISchemaBase {
|
|||||||
static bool CanApply(const UsdPrim &prim, std::string *whyNot = nullptr);
|
static bool CanApply(const UsdPrim &prim, std::string *whyNot = nullptr);
|
||||||
|
|
||||||
/// Applies this <b>single-apply</b> API schema to the given \p prim.
|
/// Applies this <b>single-apply</b> API schema to the given \p prim.
|
||||||
/// This information is stored by adding "SiteAPI" to the
|
/// This information is stored by adding "MjcSiteAPI" to the
|
||||||
/// token-valued, listOp metadata \em apiSchemas on the prim.
|
/// token-valued, listOp metadata \em apiSchemas on the prim.
|
||||||
///
|
///
|
||||||
/// \return A valid MjcPhysicsSiteAPI object is returned upon success.
|
/// \return A valid MjcPhysicsSiteAPI object is returned upon success.
|
||||||
|
|||||||
@@ -573,34 +573,34 @@ struct MjcPhysicsTokensType {
|
|||||||
/// value for MjcPhysicsActuatorAPI::GetMjcDynTypeAttr(), Possible value for
|
/// value for MjcPhysicsActuatorAPI::GetMjcDynTypeAttr(), Possible value for
|
||||||
/// MjcPhysicsActuatorAPI::GetMjcGainTypeAttr()
|
/// MjcPhysicsActuatorAPI::GetMjcGainTypeAttr()
|
||||||
const TfToken user;
|
const TfToken user;
|
||||||
/// \brief "CollisionAPI"
|
/// \brief "MjcActuatorAPI"
|
||||||
///
|
|
||||||
/// Schema identifier and family for MjcPhysicsCollisionAPI
|
|
||||||
const TfToken CollisionAPI;
|
|
||||||
/// \brief "Keyframe"
|
|
||||||
///
|
|
||||||
/// Schema identifier and family for MjcPhysicsKeyframe
|
|
||||||
const TfToken Keyframe;
|
|
||||||
/// \brief "MeshCollisionAPI"
|
|
||||||
///
|
|
||||||
/// Schema identifier and family for MjcPhysicsMeshCollisionAPI
|
|
||||||
const TfToken MeshCollisionAPI;
|
|
||||||
/// \brief "PhysicsActuatorAPI"
|
|
||||||
///
|
///
|
||||||
/// Schema identifier and family for MjcPhysicsActuatorAPI
|
/// Schema identifier and family for MjcPhysicsActuatorAPI
|
||||||
const TfToken PhysicsActuatorAPI;
|
const TfToken MjcActuatorAPI;
|
||||||
/// \brief "PhysicsJointsAPI"
|
/// \brief "MjcCollisionAPI"
|
||||||
|
///
|
||||||
|
/// Schema identifier and family for MjcPhysicsCollisionAPI
|
||||||
|
const TfToken MjcCollisionAPI;
|
||||||
|
/// \brief "MjcJointAPI"
|
||||||
///
|
///
|
||||||
/// Schema identifier and family for MjcPhysicsJointAPI
|
/// Schema identifier and family for MjcPhysicsJointAPI
|
||||||
const TfToken PhysicsJointsAPI;
|
const TfToken MjcJointAPI;
|
||||||
/// \brief "SceneAPI"
|
/// \brief "MjcKeyframe"
|
||||||
|
///
|
||||||
|
/// Schema identifier and family for MjcPhysicsKeyframe
|
||||||
|
const TfToken MjcKeyframe;
|
||||||
|
/// \brief "MjcMeshCollisionAPI"
|
||||||
|
///
|
||||||
|
/// Schema identifier and family for MjcPhysicsMeshCollisionAPI
|
||||||
|
const TfToken MjcMeshCollisionAPI;
|
||||||
|
/// \brief "MjcSceneAPI"
|
||||||
///
|
///
|
||||||
/// Schema identifier and family for MjcPhysicsSceneAPI
|
/// Schema identifier and family for MjcPhysicsSceneAPI
|
||||||
const TfToken SceneAPI;
|
const TfToken MjcSceneAPI;
|
||||||
/// \brief "SiteAPI"
|
/// \brief "MjcSiteAPI"
|
||||||
///
|
///
|
||||||
/// Schema identifier and family for MjcPhysicsSiteAPI
|
/// Schema identifier and family for MjcPhysicsSiteAPI
|
||||||
const TfToken SiteAPI;
|
const TfToken MjcSiteAPI;
|
||||||
/// A vector of all of the tokens listed above.
|
/// A vector of all of the tokens listed above.
|
||||||
const std::vector<TfToken> allTokens;
|
const std::vector<TfToken> allTokens;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"WARNING: THIS FILE IS GENERATED BY usdGenSchema. DO NOT EDIT."
|
"WARNING: THIS FILE IS GENERATED BY usdGenSchema. DO NOT EDIT."
|
||||||
)
|
)
|
||||||
|
|
||||||
class "SceneAPI" (
|
class "MjcSceneAPI" (
|
||||||
doc = "API providing global simulation options for Mujoco."
|
doc = "API providing global simulation options for Mujoco."
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -220,13 +220,13 @@ class "SceneAPI" (
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
class "SiteAPI" (
|
class "MjcSiteAPI" (
|
||||||
doc = "API describing a Mujoco site."
|
doc = "API describing a Mujoco site."
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
class "CollisionAPI" (
|
class "MjcCollisionAPI" (
|
||||||
doc = "API describing a Mujoco collider."
|
doc = "API describing a Mujoco collider."
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -236,8 +236,8 @@ class "CollisionAPI" (
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
class "MeshCollisionAPI" (
|
class "MjcMeshCollisionAPI" (
|
||||||
doc = "API describing a Mujoco collider."
|
doc = "API describing a Mujoco mesh collider."
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
uniform token mjc:inertia = "legacy" (
|
uniform token mjc:inertia = "legacy" (
|
||||||
@@ -247,7 +247,7 @@ class "MeshCollisionAPI" (
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
class "PhysicsActuatorAPI" (
|
class "MjcActuatorAPI" (
|
||||||
doc = "API describing a Mujoco actuator."
|
doc = "API describing a Mujoco actuator."
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -331,7 +331,7 @@ class "PhysicsActuatorAPI" (
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
class Keyframe "Keyframe" (
|
class MjcKeyframe "MjcKeyframe" (
|
||||||
doc = "Represents time independent keyframe values."
|
doc = "Represents time independent keyframe values."
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -355,7 +355,7 @@ class Keyframe "Keyframe" (
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
class "PhysicsJointsAPI" (
|
class "MjcJointAPI" (
|
||||||
doc = "API describing a Mujoco joint."
|
doc = "API describing a Mujoco joint."
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,10 +27,10 @@ TF_REGISTRY_FUNCTION(TfType) {
|
|||||||
|
|
||||||
// Register the usd prim typename as an alias under UsdSchemaBase. This
|
// Register the usd prim typename as an alias under UsdSchemaBase. This
|
||||||
// enables one to call
|
// enables one to call
|
||||||
// TfType::Find<UsdSchemaBase>().FindDerivedByName("Keyframe")
|
// TfType::Find<UsdSchemaBase>().FindDerivedByName("MjcKeyframe")
|
||||||
// to find TfType<MjcPhysicsKeyframe>, which is how IsA queries are
|
// to find TfType<MjcPhysicsKeyframe>, which is how IsA queries are
|
||||||
// answered.
|
// answered.
|
||||||
TfType::AddAlias<UsdSchemaBase, MjcPhysicsKeyframe>("Keyframe");
|
TfType::AddAlias<UsdSchemaBase, MjcPhysicsKeyframe>("MjcKeyframe");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* virtual */
|
/* virtual */
|
||||||
@@ -49,7 +49,7 @@ MjcPhysicsKeyframe MjcPhysicsKeyframe::Get(const UsdStagePtr &stage,
|
|||||||
/* static */
|
/* static */
|
||||||
MjcPhysicsKeyframe MjcPhysicsKeyframe::Define(const UsdStagePtr &stage,
|
MjcPhysicsKeyframe MjcPhysicsKeyframe::Define(const UsdStagePtr &stage,
|
||||||
const SdfPath &path) {
|
const SdfPath &path) {
|
||||||
static TfToken usdPrimTypeName("Keyframe");
|
static TfToken usdPrimTypeName("MjcKeyframe");
|
||||||
if (!stage) {
|
if (!stage) {
|
||||||
TF_CODING_ERROR("Invalid stage");
|
TF_CODING_ERROR("Invalid stage");
|
||||||
return MjcPhysicsKeyframe();
|
return MjcPhysicsKeyframe();
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"Types": {
|
"Types": {
|
||||||
"MjcPhysicsActuatorAPI": {
|
"MjcPhysicsActuatorAPI": {
|
||||||
"alias": {
|
"alias": {
|
||||||
"UsdSchemaBase": "PhysicsActuatorAPI"
|
"UsdSchemaBase": "MjcActuatorAPI"
|
||||||
},
|
},
|
||||||
"autoGenerated": true,
|
"autoGenerated": true,
|
||||||
"bases": [
|
"bases": [
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
},
|
},
|
||||||
"MjcPhysicsCollisionAPI": {
|
"MjcPhysicsCollisionAPI": {
|
||||||
"alias": {
|
"alias": {
|
||||||
"UsdSchemaBase": "CollisionAPI"
|
"UsdSchemaBase": "MjcCollisionAPI"
|
||||||
},
|
},
|
||||||
"autoGenerated": true,
|
"autoGenerated": true,
|
||||||
"bases": [
|
"bases": [
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
},
|
},
|
||||||
"MjcPhysicsJointAPI": {
|
"MjcPhysicsJointAPI": {
|
||||||
"alias": {
|
"alias": {
|
||||||
"UsdSchemaBase": "PhysicsJointsAPI"
|
"UsdSchemaBase": "MjcJointAPI"
|
||||||
},
|
},
|
||||||
"autoGenerated": true,
|
"autoGenerated": true,
|
||||||
"bases": [
|
"bases": [
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
},
|
},
|
||||||
"MjcPhysicsKeyframe": {
|
"MjcPhysicsKeyframe": {
|
||||||
"alias": {
|
"alias": {
|
||||||
"UsdSchemaBase": "Keyframe"
|
"UsdSchemaBase": "MjcKeyframe"
|
||||||
},
|
},
|
||||||
"autoGenerated": true,
|
"autoGenerated": true,
|
||||||
"bases": [
|
"bases": [
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
},
|
},
|
||||||
"MjcPhysicsMeshCollisionAPI": {
|
"MjcPhysicsMeshCollisionAPI": {
|
||||||
"alias": {
|
"alias": {
|
||||||
"UsdSchemaBase": "MeshCollisionAPI"
|
"UsdSchemaBase": "MjcMeshCollisionAPI"
|
||||||
},
|
},
|
||||||
"autoGenerated": true,
|
"autoGenerated": true,
|
||||||
"bases": [
|
"bases": [
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
},
|
},
|
||||||
"MjcPhysicsSceneAPI": {
|
"MjcPhysicsSceneAPI": {
|
||||||
"alias": {
|
"alias": {
|
||||||
"UsdSchemaBase": "SceneAPI"
|
"UsdSchemaBase": "MjcSceneAPI"
|
||||||
},
|
},
|
||||||
"autoGenerated": true,
|
"autoGenerated": true,
|
||||||
"bases": [
|
"bases": [
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
},
|
},
|
||||||
"MjcPhysicsSiteAPI": {
|
"MjcPhysicsSiteAPI": {
|
||||||
"alias": {
|
"alias": {
|
||||||
"UsdSchemaBase": "SiteAPI"
|
"UsdSchemaBase": "MjcSiteAPI"
|
||||||
},
|
},
|
||||||
"autoGenerated": true,
|
"autoGenerated": true,
|
||||||
"bases": [
|
"bases": [
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ over "GLOBAL" (
|
|||||||
customData = {
|
customData = {
|
||||||
string libraryName = "mjcPhysics"
|
string libraryName = "mjcPhysics"
|
||||||
string libraryPath = "."
|
string libraryPath = "."
|
||||||
|
string libraryPrefix = "MjcPhysics"
|
||||||
bool useLiteralIdentifier = 0
|
bool useLiteralIdentifier = 0
|
||||||
dictionary libraryTokens = {
|
dictionary libraryTokens = {
|
||||||
dictionary euler = {
|
dictionary euler = {
|
||||||
@@ -92,8 +93,11 @@ over "GLOBAL" (
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class "SceneAPI"
|
class "MjcSceneAPI"
|
||||||
(
|
(
|
||||||
|
customData = {
|
||||||
|
string className = "SceneAPI"
|
||||||
|
}
|
||||||
doc = """API providing global simulation options for Mujoco."""
|
doc = """API providing global simulation options for Mujoco."""
|
||||||
|
|
||||||
inherits = </APISchemaBase>
|
inherits = </APISchemaBase>
|
||||||
@@ -507,16 +511,22 @@ class "SceneAPI"
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
class "SiteAPI"
|
class "MjcSiteAPI"
|
||||||
(
|
(
|
||||||
|
customData = {
|
||||||
|
string className = "SiteAPI"
|
||||||
|
}
|
||||||
doc = """API describing a Mujoco site."""
|
doc = """API describing a Mujoco site."""
|
||||||
|
|
||||||
inherits = </APISchemaBase>
|
inherits = </APISchemaBase>
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
class "CollisionAPI"
|
class "MjcCollisionAPI"
|
||||||
(
|
(
|
||||||
|
customData = {
|
||||||
|
string className = "CollisionAPI"
|
||||||
|
}
|
||||||
doc = """API describing a Mujoco collider."""
|
doc = """API describing a Mujoco collider."""
|
||||||
|
|
||||||
inherits = </APISchemaBase>
|
inherits = </APISchemaBase>
|
||||||
@@ -531,9 +541,12 @@ class "CollisionAPI"
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
class "MeshCollisionAPI"
|
class "MjcMeshCollisionAPI"
|
||||||
(
|
(
|
||||||
doc = """API describing a Mujoco collider."""
|
customData = {
|
||||||
|
string className = "MeshCollisionAPI"
|
||||||
|
}
|
||||||
|
doc = """API describing a Mujoco mesh collider."""
|
||||||
|
|
||||||
inherits = </APISchemaBase>
|
inherits = </APISchemaBase>
|
||||||
)
|
)
|
||||||
@@ -548,7 +561,7 @@ class "MeshCollisionAPI"
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
class "PhysicsActuatorAPI"
|
class "MjcActuatorAPI"
|
||||||
(
|
(
|
||||||
customData = {
|
customData = {
|
||||||
string className = "ActuatorAPI"
|
string className = "ActuatorAPI"
|
||||||
@@ -663,8 +676,11 @@ class "PhysicsActuatorAPI"
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class Keyframe "Keyframe"
|
class MjcKeyframe "MjcKeyframe"
|
||||||
(
|
(
|
||||||
|
customData = {
|
||||||
|
string className = "Keyframe"
|
||||||
|
}
|
||||||
doc = """Represents time independent keyframe values."""
|
doc = """Represents time independent keyframe values."""
|
||||||
|
|
||||||
inherits = </Typed>
|
inherits = </Typed>
|
||||||
@@ -695,7 +711,7 @@ class Keyframe "Keyframe"
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
class "PhysicsJointsAPI"
|
class "MjcJointAPI"
|
||||||
(
|
(
|
||||||
customData = {
|
customData = {
|
||||||
string className = "JointAPI"
|
string className = "JointAPI"
|
||||||
|
|||||||
@@ -143,13 +143,13 @@ MjcPhysicsTokensType::MjcPhysicsTokensType()
|
|||||||
sparse("sparse", TfToken::Immortal),
|
sparse("sparse", TfToken::Immortal),
|
||||||
true_("true", TfToken::Immortal),
|
true_("true", TfToken::Immortal),
|
||||||
user("user", TfToken::Immortal),
|
user("user", TfToken::Immortal),
|
||||||
CollisionAPI("CollisionAPI", TfToken::Immortal),
|
MjcActuatorAPI("MjcActuatorAPI", TfToken::Immortal),
|
||||||
Keyframe("Keyframe", TfToken::Immortal),
|
MjcCollisionAPI("MjcCollisionAPI", TfToken::Immortal),
|
||||||
MeshCollisionAPI("MeshCollisionAPI", TfToken::Immortal),
|
MjcJointAPI("MjcJointAPI", TfToken::Immortal),
|
||||||
PhysicsActuatorAPI("PhysicsActuatorAPI", TfToken::Immortal),
|
MjcKeyframe("MjcKeyframe", TfToken::Immortal),
|
||||||
PhysicsJointsAPI("PhysicsJointsAPI", TfToken::Immortal),
|
MjcMeshCollisionAPI("MjcMeshCollisionAPI", TfToken::Immortal),
|
||||||
SceneAPI("SceneAPI", TfToken::Immortal),
|
MjcSceneAPI("MjcSceneAPI", TfToken::Immortal),
|
||||||
SiteAPI("SiteAPI", TfToken::Immortal),
|
MjcSiteAPI("MjcSiteAPI", TfToken::Immortal),
|
||||||
allTokens({affine,
|
allTokens({affine,
|
||||||
auto_,
|
auto_,
|
||||||
cg,
|
cg,
|
||||||
@@ -273,13 +273,13 @@ MjcPhysicsTokensType::MjcPhysicsTokensType()
|
|||||||
sparse,
|
sparse,
|
||||||
true_,
|
true_,
|
||||||
user,
|
user,
|
||||||
CollisionAPI,
|
MjcActuatorAPI,
|
||||||
Keyframe,
|
MjcCollisionAPI,
|
||||||
MeshCollisionAPI,
|
MjcJointAPI,
|
||||||
PhysicsActuatorAPI,
|
MjcKeyframe,
|
||||||
PhysicsJointsAPI,
|
MjcMeshCollisionAPI,
|
||||||
SceneAPI,
|
MjcSceneAPI,
|
||||||
SiteAPI}) {}
|
MjcSiteAPI}) {}
|
||||||
|
|
||||||
TfStaticData<MjcPhysicsTokensType> MjcPhysicsTokens;
|
TfStaticData<MjcPhysicsTokensType> MjcPhysicsTokens;
|
||||||
|
|
||||||
|
|||||||
@@ -347,7 +347,7 @@ class ModelWriter {
|
|||||||
mesh_paths_[*mjs_getName(mesh->element)] = subcomponent_path;
|
mesh_paths_[*mjs_getName(mesh->element)] = subcomponent_path;
|
||||||
|
|
||||||
if (write_physics_) {
|
if (write_physics_) {
|
||||||
ApplyApiSchema(data_, mesh_path, MjcPhysicsTokens->MeshCollisionAPI);
|
ApplyApiSchema(data_, mesh_path, MjcPhysicsTokens->MjcMeshCollisionAPI);
|
||||||
|
|
||||||
pxr::TfToken inertia = MjcPhysicsTokens->legacy;
|
pxr::TfToken inertia = MjcPhysicsTokens->legacy;
|
||||||
if (mesh->inertia == mjtMeshInertia::mjMESH_INERTIA_EXACT) {
|
if (mesh->inertia == mjtMeshInertia::mjMESH_INERTIA_EXACT) {
|
||||||
@@ -464,7 +464,7 @@ class ModelWriter {
|
|||||||
data_, body_paths_[kWorldIndex], pxr::UsdPhysicsTokens->PhysicsScene,
|
data_, body_paths_[kWorldIndex], pxr::UsdPhysicsTokens->PhysicsScene,
|
||||||
pxr::UsdPhysicsTokens->PhysicsScene);
|
pxr::UsdPhysicsTokens->PhysicsScene);
|
||||||
|
|
||||||
ApplyApiSchema(data_, physics_scene_path, MjcPhysicsTokens->SceneAPI);
|
ApplyApiSchema(data_, physics_scene_path, MjcPhysicsTokens->MjcSceneAPI);
|
||||||
|
|
||||||
const std::vector<std::pair<pxr::TfToken, double>>
|
const std::vector<std::pair<pxr::TfToken, double>>
|
||||||
option_double_attributes = {
|
option_double_attributes = {
|
||||||
@@ -955,11 +955,11 @@ class ModelWriter {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const auto keyframe_name = pxr::TfToken(pxr::TfMakeValidIdentifier(
|
const auto keyframe_name = pxr::TfToken(pxr::TfMakeValidIdentifier(
|
||||||
name.empty() ? MjcPhysicsTokens->Keyframe : name));
|
name.empty() ? MjcPhysicsTokens->MjcKeyframe : name));
|
||||||
pxr::SdfPath keyframe_path = parent_path.AppendChild(keyframe_name);
|
pxr::SdfPath keyframe_path = parent_path.AppendChild(keyframe_name);
|
||||||
if (!data_->HasSpec(keyframe_path)) {
|
if (!data_->HasSpec(keyframe_path)) {
|
||||||
CreatePrimSpec(data_, parent_path, keyframe_name,
|
CreatePrimSpec(data_, parent_path, keyframe_name,
|
||||||
pxr::MjcPhysicsTokens->Keyframe);
|
pxr::MjcPhysicsTokens->MjcKeyframe);
|
||||||
}
|
}
|
||||||
auto set_attribute_data = [&](const pxr::SdfPath &attr_path,
|
auto set_attribute_data = [&](const pxr::SdfPath &attr_path,
|
||||||
const pxr::VtDoubleArray &value,
|
const pxr::VtDoubleArray &value,
|
||||||
@@ -1029,7 +1029,7 @@ class ModelWriter {
|
|||||||
mjsKey *keyframe = mjs_asKey(mjs_firstElement(spec_, mjOBJ_KEY));
|
mjsKey *keyframe = mjs_asKey(mjs_firstElement(spec_, mjOBJ_KEY));
|
||||||
while (keyframe) {
|
while (keyframe) {
|
||||||
std::string keyframe_name = mjs_getName(keyframe->element)->empty()
|
std::string keyframe_name = mjs_getName(keyframe->element)->empty()
|
||||||
? MjcPhysicsTokens->Keyframe
|
? kTokens->keyframe
|
||||||
: *mjs_getName(keyframe->element);
|
: *mjs_getName(keyframe->element);
|
||||||
keyframes_map[keyframe_name].push_back(keyframe);
|
keyframes_map[keyframe_name].push_back(keyframe);
|
||||||
keyframe = mjs_asKey(mjs_nextElement(spec_, keyframe->element));
|
keyframe = mjs_asKey(mjs_nextElement(spec_, keyframe->element));
|
||||||
@@ -1063,7 +1063,7 @@ class ModelWriter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ApplyApiSchema(data_, transmission_path,
|
ApplyApiSchema(data_, transmission_path,
|
||||||
MjcPhysicsTokens->PhysicsActuatorAPI);
|
MjcPhysicsTokens->MjcActuatorAPI);
|
||||||
|
|
||||||
if (!actuator->refsite->empty()) {
|
if (!actuator->refsite->empty()) {
|
||||||
int refsite_id =
|
int refsite_id =
|
||||||
@@ -1438,7 +1438,7 @@ class ModelWriter {
|
|||||||
pxr::SdfPath site_path = WriteSiteGeom(site, body_path);
|
pxr::SdfPath site_path = WriteSiteGeom(site, body_path);
|
||||||
SetPrimPurpose(data_, site_path, pxr::UsdGeomTokens->guide);
|
SetPrimPurpose(data_, site_path, pxr::UsdGeomTokens->guide);
|
||||||
|
|
||||||
ApplyApiSchema(data_, site_path, MjcPhysicsTokens->SiteAPI);
|
ApplyApiSchema(data_, site_path, MjcPhysicsTokens->MjcSiteAPI);
|
||||||
|
|
||||||
int site_id = mjs_getId(site->element);
|
int site_id = mjs_getId(site->element);
|
||||||
auto transform = MujocoPosQuatToTransform(&model_->site_pos[3 * site_id],
|
auto transform = MujocoPosQuatToTransform(&model_->site_pos[3 * site_id],
|
||||||
@@ -1491,7 +1491,7 @@ class ModelWriter {
|
|||||||
model_->geom_conaffinity[geom_id] != 0)) {
|
model_->geom_conaffinity[geom_id] != 0)) {
|
||||||
ApplyApiSchema(data_, geom_path,
|
ApplyApiSchema(data_, geom_path,
|
||||||
pxr::UsdPhysicsTokens->PhysicsCollisionAPI);
|
pxr::UsdPhysicsTokens->PhysicsCollisionAPI);
|
||||||
ApplyApiSchema(data_, geom_path, MjcPhysicsTokens->CollisionAPI);
|
ApplyApiSchema(data_, geom_path, MjcPhysicsTokens->MjcCollisionAPI);
|
||||||
|
|
||||||
WriteUniformAttribute(
|
WriteUniformAttribute(
|
||||||
geom_path, pxr::SdfValueTypeNames->Bool,
|
geom_path, pxr::SdfValueTypeNames->Bool,
|
||||||
@@ -1834,7 +1834,7 @@ class ModelWriter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Finally write the mjcPhysicsJointAPI attributes.
|
// Finally write the mjcPhysicsJointAPI attributes.
|
||||||
ApplyApiSchema(data_, joint_path, MjcPhysicsTokens->PhysicsJointsAPI);
|
ApplyApiSchema(data_, joint_path, MjcPhysicsTokens->MjcJointAPI);
|
||||||
|
|
||||||
WriteUniformAttribute(
|
WriteUniformAttribute(
|
||||||
joint_path, pxr::SdfValueTypeNames->DoubleArray,
|
joint_path, pxr::SdfValueTypeNames->DoubleArray,
|
||||||
|
|||||||
Reference in New Issue
Block a user