Add JointAPI schema in mjcPhysics.
PiperOrigin-RevId: 778030981 Change-Id: I22a4bf2a550fb78e47bef0ff171b10ce5912887e
This commit is contained in:
committed by
Copybara-Service
parent
3db03dcce5
commit
862436f9b3
@@ -355,3 +355,58 @@ class Keyframe "Keyframe" (
|
||||
)
|
||||
}
|
||||
|
||||
class "PhysicsJointsAPI" (
|
||||
doc = "API describing a Mujoco joint."
|
||||
)
|
||||
{
|
||||
uniform token mjc:actuatorfrclimited = "auto" (
|
||||
allowedTokens = ["false", "true", "auto"]
|
||||
doc = "This attribute specifies whether actuator forces acting on the joint should be clamped. See Force limits for details. It is available only for scalar joints (hinge and slider) and ignored for ball and free joints. This attribute interacts with the actuatorfrcrange attribute. If this attribute is 'false', actuator force clamping is disabled. If it is 'true', actuator force clamping is enabled. If this attribute is 'auto', and autolimits is set in compiler, actuator force clamping will be enabled if actuatorfrcrange is defined."
|
||||
)
|
||||
uniform double mjc:actuatorfrcrange:max = 0 (
|
||||
doc = "Maximum range for clamping total actuator forces acting on this joint. See Force limits for details. It is available only for scalar joints (hinge and slider) and ignored for ball and free joints. The compiler expects the first value to be smaller than the second value. Setting this attribute without specifying actuatorfrclimited is an error if compiler-autolimits is 'false'."
|
||||
)
|
||||
uniform double mjc:actuatorfrcrange:min = 0 (
|
||||
doc = "Minimum range for clamping total actuator forces acting on this joint. See Force limits for details. It is available only for scalar joints (hinge and slider) and ignored for ball and free joints. The compiler expects the first value to be smaller than the second value. Setting this attribute without specifying actuatorfrclimited is an error if compiler-autolimits is 'false'."
|
||||
)
|
||||
uniform bool mjc:actuatorgravcomp = 0 (
|
||||
doc = "If this flag is enabled, gravity compensation applied to this joint is added to actuator forces (mjData.qfrc_actuator) rather than passive forces (mjData.qfrc_passive). Notionally, this means that gravity compensation is the result of a control system rather than natural buoyancy. In practice, enabling this flag is useful when joint-level actuator force clamping is used. In this case, the total actuation force applied on a joint, including gravity compensation, is guaranteed to not exceed the specified limits. See Force limits and actuatorfrcrange for more details on this type of force limit."
|
||||
)
|
||||
uniform double mjc:armature = 0 (
|
||||
doc = "Additional inertia associated with movement of the joint that is not due to body mass. This added inertia is usually due to a rotor (a.k.a armature) spinning faster than the joint itself due to a geared transmission. The value applies to all degrees of freedom created by this joint. Besides increasing the realism of joints with geared transmission, positive armature significantly improves simulation stability, even for small values, and is a recommended possible fix when encountering stability issues."
|
||||
)
|
||||
uniform double mjc:damping = 0 (
|
||||
doc = "Damping applied to all degrees of freedom created by this joint. Unlike friction loss which is computed by the constraint solver, damping is simply a force linear in velocity. It is included in the passive forces. Despite this simplicity, larger damping values can make numerical integrators unstable, which is why our Euler integrator handles damping implicitly. See Integration in the Computation chapter."
|
||||
)
|
||||
uniform double mjc:frictionloss = 0 (
|
||||
doc = "Friction loss due to dry friction. This value is the same for all degrees of freedom created by this joint. Semantically friction loss does not make sense for free joints, but the compiler allows it. To enable friction loss, set this attribute to a positive value."
|
||||
)
|
||||
uniform double mjc:margin = 0 (
|
||||
doc = "The distance threshold below which limits become active. Recall that the Constraint solver normally generates forces as soon as a constraint becomes active, even if the margin parameter makes that happen at a distance. This attribute together with solreflimit and solimplimit can be used to model a soft joint limit."
|
||||
)
|
||||
uniform double mjc:ref = 0 (
|
||||
doc = "The reference position or angle of the joint. This attribute is only used for slide and hinge joints. It defines the joint value corresponding to the initial model configuration. The amount of spatial transformation that the joint applies at runtime equals the current joint value stored in mjData.qpos minus this reference value stored in mjModel.qpos0. The meaning of these vectors was discussed in the Stand-alone section in the Overview chapter."
|
||||
)
|
||||
uniform double[] mjc:solimpfriction = [0.9, 0.95, 0.001, 0.5, 2] (
|
||||
doc = "Constraint solver parameters for simulating dry friction."
|
||||
)
|
||||
uniform double[] mjc:solimplimit = [0.9, 0.95, 0.001, 0.5, 2] (
|
||||
doc = "Constraint solver parameters for simulating joint limits."
|
||||
)
|
||||
uniform double[] mjc:solreffriction = [0.02, 1] (
|
||||
doc = "Constraint solver parameters for simulating dry friction."
|
||||
)
|
||||
uniform double[] mjc:solreflimit = [0.02, 1] (
|
||||
doc = "Constraint solver parameters for simulating joint limits."
|
||||
)
|
||||
uniform double[] mjc:springdamper = [0, 0] (
|
||||
doc = "When both numbers are positive, the compiler will override any stiffness and damping values specified with the attributes below, and will instead set them automatically so that the resulting mass-spring-damper for this joint has the desired time constant (first value) and damping ratio (second value). This is done by taking into account the joint inertia in the model reference configuration. Note that the format is the same as the solref parameter of the constraint solver."
|
||||
)
|
||||
uniform double mjc:springref = 0 (
|
||||
doc = "The joint position or angle in which the joint spring (if any) achieves equilibrium. Similar to the vector mjModel.qpos0 which stores all joint reference values specified with the ref attribute above, all spring reference values specified with this attribute are stored in the vector mjModel.qpos_spring. The model configuration corresponding to mjModel.qpos_spring is also used to compute the spring reference lengths of all tendons, stored in mjModel.tendon_lengthspring. This is because tendons can also have springs."
|
||||
)
|
||||
uniform double mjc:stiffness = 0 (
|
||||
doc = "Joint stiffness. If this value is positive, a spring will be created with equilibrium position given by springref below. The spring force is computed along with the other passive forces."
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,303 @@
|
||||
// Copyright 2025 DeepMind Technologies Limited
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include <mujoco/experimental/usd/mjcPhysics/jointAPI.h>
|
||||
|
||||
#include <pxr/usd/sdf/assetPath.h>
|
||||
#include <pxr/usd/sdf/types.h>
|
||||
#include <pxr/usd/usd/schemaRegistry.h>
|
||||
#include <pxr/usd/usd/typed.h>
|
||||
|
||||
PXR_NAMESPACE_OPEN_SCOPE
|
||||
|
||||
// Register the schema with the TfType system.
|
||||
TF_REGISTRY_FUNCTION(TfType) {
|
||||
TfType::Define<MjcPhysicsJointAPI, TfType::Bases<UsdAPISchemaBase> >();
|
||||
}
|
||||
|
||||
/* virtual */
|
||||
MjcPhysicsJointAPI::~MjcPhysicsJointAPI() {}
|
||||
|
||||
/* static */
|
||||
MjcPhysicsJointAPI MjcPhysicsJointAPI::Get(const UsdStagePtr &stage,
|
||||
const SdfPath &path) {
|
||||
if (!stage) {
|
||||
TF_CODING_ERROR("Invalid stage");
|
||||
return MjcPhysicsJointAPI();
|
||||
}
|
||||
return MjcPhysicsJointAPI(stage->GetPrimAtPath(path));
|
||||
}
|
||||
|
||||
/* virtual */
|
||||
UsdSchemaKind MjcPhysicsJointAPI::_GetSchemaKind() const {
|
||||
return MjcPhysicsJointAPI::schemaKind;
|
||||
}
|
||||
|
||||
/* static */
|
||||
bool MjcPhysicsJointAPI::CanApply(const UsdPrim &prim, std::string *whyNot) {
|
||||
return prim.CanApplyAPI<MjcPhysicsJointAPI>(whyNot);
|
||||
}
|
||||
|
||||
/* static */
|
||||
MjcPhysicsJointAPI MjcPhysicsJointAPI::Apply(const UsdPrim &prim) {
|
||||
if (prim.ApplyAPI<MjcPhysicsJointAPI>()) {
|
||||
return MjcPhysicsJointAPI(prim);
|
||||
}
|
||||
return MjcPhysicsJointAPI();
|
||||
}
|
||||
|
||||
/* static */
|
||||
const TfType &MjcPhysicsJointAPI::_GetStaticTfType() {
|
||||
static TfType tfType = TfType::Find<MjcPhysicsJointAPI>();
|
||||
return tfType;
|
||||
}
|
||||
|
||||
/* static */
|
||||
bool MjcPhysicsJointAPI::_IsTypedSchema() {
|
||||
static bool isTyped = _GetStaticTfType().IsA<UsdTyped>();
|
||||
return isTyped;
|
||||
}
|
||||
|
||||
/* virtual */
|
||||
const TfType &MjcPhysicsJointAPI::_GetTfType() const {
|
||||
return _GetStaticTfType();
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::GetMjcSpringdamperAttr() const {
|
||||
return GetPrim().GetAttribute(MjcPhysicsTokens->mjcSpringdamper);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::CreateMjcSpringdamperAttr(
|
||||
VtValue const &defaultValue, bool writeSparsely) const {
|
||||
return UsdSchemaBase::_CreateAttr(
|
||||
MjcPhysicsTokens->mjcSpringdamper, SdfValueTypeNames->DoubleArray,
|
||||
/* custom = */ false, SdfVariabilityUniform, defaultValue, writeSparsely);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::GetMjcSolreflimitAttr() const {
|
||||
return GetPrim().GetAttribute(MjcPhysicsTokens->mjcSolreflimit);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::CreateMjcSolreflimitAttr(
|
||||
VtValue const &defaultValue, bool writeSparsely) const {
|
||||
return UsdSchemaBase::_CreateAttr(
|
||||
MjcPhysicsTokens->mjcSolreflimit, SdfValueTypeNames->DoubleArray,
|
||||
/* custom = */ false, SdfVariabilityUniform, defaultValue, writeSparsely);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::GetMjcSolimplimitAttr() const {
|
||||
return GetPrim().GetAttribute(MjcPhysicsTokens->mjcSolimplimit);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::CreateMjcSolimplimitAttr(
|
||||
VtValue const &defaultValue, bool writeSparsely) const {
|
||||
return UsdSchemaBase::_CreateAttr(
|
||||
MjcPhysicsTokens->mjcSolimplimit, SdfValueTypeNames->DoubleArray,
|
||||
/* custom = */ false, SdfVariabilityUniform, defaultValue, writeSparsely);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::GetMjcSolreffrictionAttr() const {
|
||||
return GetPrim().GetAttribute(MjcPhysicsTokens->mjcSolreffriction);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::CreateMjcSolreffrictionAttr(
|
||||
VtValue const &defaultValue, bool writeSparsely) const {
|
||||
return UsdSchemaBase::_CreateAttr(
|
||||
MjcPhysicsTokens->mjcSolreffriction, SdfValueTypeNames->DoubleArray,
|
||||
/* custom = */ false, SdfVariabilityUniform, defaultValue, writeSparsely);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::GetMjcSolimpfrictionAttr() const {
|
||||
return GetPrim().GetAttribute(MjcPhysicsTokens->mjcSolimpfriction);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::CreateMjcSolimpfrictionAttr(
|
||||
VtValue const &defaultValue, bool writeSparsely) const {
|
||||
return UsdSchemaBase::_CreateAttr(
|
||||
MjcPhysicsTokens->mjcSolimpfriction, SdfValueTypeNames->DoubleArray,
|
||||
/* custom = */ false, SdfVariabilityUniform, defaultValue, writeSparsely);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::GetMjcStiffnessAttr() const {
|
||||
return GetPrim().GetAttribute(MjcPhysicsTokens->mjcStiffness);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::CreateMjcStiffnessAttr(
|
||||
VtValue const &defaultValue, bool writeSparsely) const {
|
||||
return UsdSchemaBase::_CreateAttr(
|
||||
MjcPhysicsTokens->mjcStiffness, SdfValueTypeNames->Double,
|
||||
/* custom = */ false, SdfVariabilityUniform, defaultValue, writeSparsely);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::GetMjcActuatorfrcrangeMinAttr() const {
|
||||
return GetPrim().GetAttribute(MjcPhysicsTokens->mjcActuatorfrcrangeMin);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::CreateMjcActuatorfrcrangeMinAttr(
|
||||
VtValue const &defaultValue, bool writeSparsely) const {
|
||||
return UsdSchemaBase::_CreateAttr(
|
||||
MjcPhysicsTokens->mjcActuatorfrcrangeMin, SdfValueTypeNames->Double,
|
||||
/* custom = */ false, SdfVariabilityUniform, defaultValue, writeSparsely);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::GetMjcActuatorfrcrangeMaxAttr() const {
|
||||
return GetPrim().GetAttribute(MjcPhysicsTokens->mjcActuatorfrcrangeMax);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::CreateMjcActuatorfrcrangeMaxAttr(
|
||||
VtValue const &defaultValue, bool writeSparsely) const {
|
||||
return UsdSchemaBase::_CreateAttr(
|
||||
MjcPhysicsTokens->mjcActuatorfrcrangeMax, SdfValueTypeNames->Double,
|
||||
/* custom = */ false, SdfVariabilityUniform, defaultValue, writeSparsely);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::GetMjcActuatorfrclimitedAttr() const {
|
||||
return GetPrim().GetAttribute(MjcPhysicsTokens->mjcActuatorfrclimited);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::CreateMjcActuatorfrclimitedAttr(
|
||||
VtValue const &defaultValue, bool writeSparsely) const {
|
||||
return UsdSchemaBase::_CreateAttr(
|
||||
MjcPhysicsTokens->mjcActuatorfrclimited, SdfValueTypeNames->Token,
|
||||
/* custom = */ false, SdfVariabilityUniform, defaultValue, writeSparsely);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::GetMjcActuatorgravcompAttr() const {
|
||||
return GetPrim().GetAttribute(MjcPhysicsTokens->mjcActuatorgravcomp);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::CreateMjcActuatorgravcompAttr(
|
||||
VtValue const &defaultValue, bool writeSparsely) const {
|
||||
return UsdSchemaBase::_CreateAttr(
|
||||
MjcPhysicsTokens->mjcActuatorgravcomp, SdfValueTypeNames->Bool,
|
||||
/* custom = */ false, SdfVariabilityUniform, defaultValue, writeSparsely);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::GetMjcMarginAttr() const {
|
||||
return GetPrim().GetAttribute(MjcPhysicsTokens->mjcMargin);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::CreateMjcMarginAttr(
|
||||
VtValue const &defaultValue, bool writeSparsely) const {
|
||||
return UsdSchemaBase::_CreateAttr(
|
||||
MjcPhysicsTokens->mjcMargin, SdfValueTypeNames->Double,
|
||||
/* custom = */ false, SdfVariabilityUniform, defaultValue, writeSparsely);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::GetMjcRefAttr() const {
|
||||
return GetPrim().GetAttribute(MjcPhysicsTokens->mjcRef);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::CreateMjcRefAttr(VtValue const &defaultValue,
|
||||
bool writeSparsely) const {
|
||||
return UsdSchemaBase::_CreateAttr(
|
||||
MjcPhysicsTokens->mjcRef, SdfValueTypeNames->Double,
|
||||
/* custom = */ false, SdfVariabilityUniform, defaultValue, writeSparsely);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::GetMjcSpringrefAttr() const {
|
||||
return GetPrim().GetAttribute(MjcPhysicsTokens->mjcSpringref);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::CreateMjcSpringrefAttr(
|
||||
VtValue const &defaultValue, bool writeSparsely) const {
|
||||
return UsdSchemaBase::_CreateAttr(
|
||||
MjcPhysicsTokens->mjcSpringref, SdfValueTypeNames->Double,
|
||||
/* custom = */ false, SdfVariabilityUniform, defaultValue, writeSparsely);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::GetMjcArmatureAttr() const {
|
||||
return GetPrim().GetAttribute(MjcPhysicsTokens->mjcArmature);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::CreateMjcArmatureAttr(
|
||||
VtValue const &defaultValue, bool writeSparsely) const {
|
||||
return UsdSchemaBase::_CreateAttr(
|
||||
MjcPhysicsTokens->mjcArmature, SdfValueTypeNames->Double,
|
||||
/* custom = */ false, SdfVariabilityUniform, defaultValue, writeSparsely);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::GetMjcDampingAttr() const {
|
||||
return GetPrim().GetAttribute(MjcPhysicsTokens->mjcDamping);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::CreateMjcDampingAttr(
|
||||
VtValue const &defaultValue, bool writeSparsely) const {
|
||||
return UsdSchemaBase::_CreateAttr(
|
||||
MjcPhysicsTokens->mjcDamping, SdfValueTypeNames->Double,
|
||||
/* custom = */ false, SdfVariabilityUniform, defaultValue, writeSparsely);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::GetMjcFrictionlossAttr() const {
|
||||
return GetPrim().GetAttribute(MjcPhysicsTokens->mjcFrictionloss);
|
||||
}
|
||||
|
||||
UsdAttribute MjcPhysicsJointAPI::CreateMjcFrictionlossAttr(
|
||||
VtValue const &defaultValue, bool writeSparsely) const {
|
||||
return UsdSchemaBase::_CreateAttr(
|
||||
MjcPhysicsTokens->mjcFrictionloss, SdfValueTypeNames->Double,
|
||||
/* custom = */ false, SdfVariabilityUniform, defaultValue, writeSparsely);
|
||||
}
|
||||
|
||||
namespace {
|
||||
static inline TfTokenVector _ConcatenateAttributeNames(
|
||||
const TfTokenVector &left, const TfTokenVector &right) {
|
||||
TfTokenVector result;
|
||||
result.reserve(left.size() + right.size());
|
||||
result.insert(result.end(), left.begin(), left.end());
|
||||
result.insert(result.end(), right.begin(), right.end());
|
||||
return result;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
/*static*/
|
||||
const TfTokenVector &MjcPhysicsJointAPI::GetSchemaAttributeNames(
|
||||
bool includeInherited) {
|
||||
static TfTokenVector localNames = {
|
||||
MjcPhysicsTokens->mjcSpringdamper,
|
||||
MjcPhysicsTokens->mjcSolreflimit,
|
||||
MjcPhysicsTokens->mjcSolimplimit,
|
||||
MjcPhysicsTokens->mjcSolreffriction,
|
||||
MjcPhysicsTokens->mjcSolimpfriction,
|
||||
MjcPhysicsTokens->mjcStiffness,
|
||||
MjcPhysicsTokens->mjcActuatorfrcrangeMin,
|
||||
MjcPhysicsTokens->mjcActuatorfrcrangeMax,
|
||||
MjcPhysicsTokens->mjcActuatorfrclimited,
|
||||
MjcPhysicsTokens->mjcActuatorgravcomp,
|
||||
MjcPhysicsTokens->mjcMargin,
|
||||
MjcPhysicsTokens->mjcRef,
|
||||
MjcPhysicsTokens->mjcSpringref,
|
||||
MjcPhysicsTokens->mjcArmature,
|
||||
MjcPhysicsTokens->mjcDamping,
|
||||
MjcPhysicsTokens->mjcFrictionloss,
|
||||
};
|
||||
static TfTokenVector allNames = _ConcatenateAttributeNames(
|
||||
UsdAPISchemaBase::GetSchemaAttributeNames(true), localNames);
|
||||
|
||||
if (includeInherited)
|
||||
return allNames;
|
||||
else
|
||||
return localNames;
|
||||
}
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
|
||||
// ===================================================================== //
|
||||
// Feel free to add custom code below this line. It will be preserved by
|
||||
// the code generator.
|
||||
//
|
||||
// Just remember to wrap code in the appropriate delimiters:
|
||||
// 'PXR_NAMESPACE_OPEN_SCOPE', 'PXR_NAMESPACE_CLOSE_SCOPE'.
|
||||
// ===================================================================== //
|
||||
// --(BEGIN CUSTOM CODE)--
|
||||
@@ -23,6 +23,16 @@
|
||||
],
|
||||
"schemaKind": "singleApplyAPI"
|
||||
},
|
||||
"MjcPhysicsJointAPI": {
|
||||
"alias": {
|
||||
"UsdSchemaBase": "PhysicsJointsAPI"
|
||||
},
|
||||
"autoGenerated": true,
|
||||
"bases": [
|
||||
"UsdAPISchemaBase"
|
||||
],
|
||||
"schemaKind": "singleApplyAPI"
|
||||
},
|
||||
"MjcPhysicsKeyframe": {
|
||||
"alias": {
|
||||
"UsdSchemaBase": "Keyframe"
|
||||
|
||||
@@ -695,3 +695,78 @@ class Keyframe "Keyframe"
|
||||
)
|
||||
}
|
||||
|
||||
class "PhysicsJointsAPI"
|
||||
(
|
||||
customData = {
|
||||
string className = "JointAPI"
|
||||
}
|
||||
doc = """API describing a Mujoco joint."""
|
||||
|
||||
inherits = </APISchemaBase>
|
||||
)
|
||||
{
|
||||
uniform double[] mjc:springdamper = [0, 0] (
|
||||
doc = "When both numbers are positive, the compiler will override any stiffness and damping values specified with the attributes below, and will instead set them automatically so that the resulting mass-spring-damper for this joint has the desired time constant (first value) and damping ratio (second value). This is done by taking into account the joint inertia in the model reference configuration. Note that the format is the same as the solref parameter of the constraint solver."
|
||||
)
|
||||
|
||||
uniform double[] mjc:solreflimit = [0.02, 1.0] (
|
||||
doc = "Constraint solver parameters for simulating joint limits."
|
||||
)
|
||||
|
||||
uniform double[] mjc:solimplimit = [0.9, 0.95, 0.001, 0.5, 2.0] (
|
||||
doc = "Constraint solver parameters for simulating joint limits."
|
||||
)
|
||||
|
||||
uniform double[] mjc:solreffriction = [0.02, 1.0] (
|
||||
doc = "Constraint solver parameters for simulating dry friction."
|
||||
)
|
||||
|
||||
uniform double[] mjc:solimpfriction = [0.9, 0.95, 0.001, 0.5, 2.0] (
|
||||
doc = "Constraint solver parameters for simulating dry friction."
|
||||
)
|
||||
|
||||
uniform double mjc:stiffness = 0 (
|
||||
doc = "Joint stiffness. If this value is positive, a spring will be created with equilibrium position given by springref below. The spring force is computed along with the other passive forces."
|
||||
)
|
||||
|
||||
uniform double mjc:actuatorfrcrange:min = 0 (
|
||||
doc = "Minimum range for clamping total actuator forces acting on this joint. See Force limits for details. It is available only for scalar joints (hinge and slider) and ignored for ball and free joints. The compiler expects the first value to be smaller than the second value. Setting this attribute without specifying actuatorfrclimited is an error if compiler-autolimits is 'false'."
|
||||
)
|
||||
|
||||
uniform double mjc:actuatorfrcrange:max = 0 (
|
||||
doc = "Maximum range for clamping total actuator forces acting on this joint. See Force limits for details. It is available only for scalar joints (hinge and slider) and ignored for ball and free joints. The compiler expects the first value to be smaller than the second value. Setting this attribute without specifying actuatorfrclimited is an error if compiler-autolimits is 'false'."
|
||||
)
|
||||
|
||||
uniform token mjc:actuatorfrclimited = "auto" (
|
||||
doc = "This attribute specifies whether actuator forces acting on the joint should be clamped. See Force limits for details. It is available only for scalar joints (hinge and slider) and ignored for ball and free joints. This attribute interacts with the actuatorfrcrange attribute. If this attribute is 'false', actuator force clamping is disabled. If it is 'true', actuator force clamping is enabled. If this attribute is 'auto', and autolimits is set in compiler, actuator force clamping will be enabled if actuatorfrcrange is defined."
|
||||
allowedTokens = ["false", "true", "auto"]
|
||||
)
|
||||
|
||||
uniform bool mjc:actuatorgravcomp = false (
|
||||
doc = "If this flag is enabled, gravity compensation applied to this joint is added to actuator forces (mjData.qfrc_actuator) rather than passive forces (mjData.qfrc_passive). Notionally, this means that gravity compensation is the result of a control system rather than natural buoyancy. In practice, enabling this flag is useful when joint-level actuator force clamping is used. In this case, the total actuation force applied on a joint, including gravity compensation, is guaranteed to not exceed the specified limits. See Force limits and actuatorfrcrange for more details on this type of force limit."
|
||||
)
|
||||
|
||||
uniform double mjc:margin = 0 (
|
||||
doc = "The distance threshold below which limits become active. Recall that the Constraint solver normally generates forces as soon as a constraint becomes active, even if the margin parameter makes that happen at a distance. This attribute together with solreflimit and solimplimit can be used to model a soft joint limit."
|
||||
)
|
||||
|
||||
uniform double mjc:ref = 0 (
|
||||
doc = "The reference position or angle of the joint. This attribute is only used for slide and hinge joints. It defines the joint value corresponding to the initial model configuration. The amount of spatial transformation that the joint applies at runtime equals the current joint value stored in mjData.qpos minus this reference value stored in mjModel.qpos0. The meaning of these vectors was discussed in the Stand-alone section in the Overview chapter."
|
||||
)
|
||||
|
||||
uniform double mjc:springref = 0 (
|
||||
doc = "The joint position or angle in which the joint spring (if any) achieves equilibrium. Similar to the vector mjModel.qpos0 which stores all joint reference values specified with the ref attribute above, all spring reference values specified with this attribute are stored in the vector mjModel.qpos_spring. The model configuration corresponding to mjModel.qpos_spring is also used to compute the spring reference lengths of all tendons, stored in mjModel.tendon_lengthspring. This is because tendons can also have springs."
|
||||
)
|
||||
|
||||
uniform double mjc:armature = 0 (
|
||||
doc = "Additional inertia associated with movement of the joint that is not due to body mass. This added inertia is usually due to a rotor (a.k.a armature) spinning faster than the joint itself due to a geared transmission. The value applies to all degrees of freedom created by this joint. Besides increasing the realism of joints with geared transmission, positive armature significantly improves simulation stability, even for small values, and is a recommended possible fix when encountering stability issues."
|
||||
)
|
||||
|
||||
uniform double mjc:damping = 0 (
|
||||
doc = "Damping applied to all degrees of freedom created by this joint. Unlike friction loss which is computed by the constraint solver, damping is simply a force linear in velocity. It is included in the passive forces. Despite this simplicity, larger damping values can make numerical integrators unstable, which is why our Euler integrator handles damping implicitly. See Integration in the Computation chapter."
|
||||
)
|
||||
|
||||
uniform double mjc:frictionloss = 0 (
|
||||
doc = "Friction loss due to dry friction. This value is the same for all degrees of freedom created by this joint. Semantically friction loss does not make sense for free joints, but the compiler allows it. To enable friction loss, set this attribute to a positive value."
|
||||
)
|
||||
}
|
||||
|
||||
@@ -39,6 +39,11 @@ MjcPhysicsTokensType::MjcPhysicsTokensType()
|
||||
mjcActLimited("mjc:actLimited", TfToken::Immortal),
|
||||
mjcActRangeMax("mjc:actRange:max", TfToken::Immortal),
|
||||
mjcActRangeMin("mjc:actRange:min", TfToken::Immortal),
|
||||
mjcActuatorfrclimited("mjc:actuatorfrclimited", TfToken::Immortal),
|
||||
mjcActuatorfrcrangeMax("mjc:actuatorfrcrange:max", TfToken::Immortal),
|
||||
mjcActuatorfrcrangeMin("mjc:actuatorfrcrange:min", TfToken::Immortal),
|
||||
mjcActuatorgravcomp("mjc:actuatorgravcomp", TfToken::Immortal),
|
||||
mjcArmature("mjc:armature", TfToken::Immortal),
|
||||
mjcBiasPrm("mjc:biasPrm", TfToken::Immortal),
|
||||
mjcBiasType("mjc:biasType", TfToken::Immortal),
|
||||
mjcCrankLength("mjc:crankLength", TfToken::Immortal),
|
||||
@@ -46,6 +51,7 @@ MjcPhysicsTokensType::MjcPhysicsTokensType()
|
||||
mjcCtrlLimited("mjc:ctrlLimited", TfToken::Immortal),
|
||||
mjcCtrlRangeMax("mjc:ctrlRange:max", TfToken::Immortal),
|
||||
mjcCtrlRangeMin("mjc:ctrlRange:min", TfToken::Immortal),
|
||||
mjcDamping("mjc:damping", TfToken::Immortal),
|
||||
mjcDynPrm("mjc:dynPrm", TfToken::Immortal),
|
||||
mjcDynType("mjc:dynType", TfToken::Immortal),
|
||||
mjcFlagActuation("mjc:flag:actuation", TfToken::Immortal),
|
||||
@@ -74,6 +80,7 @@ MjcPhysicsTokensType::MjcPhysicsTokensType()
|
||||
mjcForceLimited("mjc:forceLimited", TfToken::Immortal),
|
||||
mjcForceRangeMax("mjc:forceRange:max", TfToken::Immortal),
|
||||
mjcForceRangeMin("mjc:forceRange:min", TfToken::Immortal),
|
||||
mjcFrictionloss("mjc:frictionloss", TfToken::Immortal),
|
||||
mjcGainPrm("mjc:gainPrm", TfToken::Immortal),
|
||||
mjcGainType("mjc:gainType", TfToken::Immortal),
|
||||
mjcGear("mjc:gear", TfToken::Immortal),
|
||||
@@ -81,6 +88,7 @@ MjcPhysicsTokensType::MjcPhysicsTokensType()
|
||||
mjcJointInParent("mjc:jointInParent", TfToken::Immortal),
|
||||
mjcLengthRangeMax("mjc:lengthRange:max", TfToken::Immortal),
|
||||
mjcLengthRangeMin("mjc:lengthRange:min", TfToken::Immortal),
|
||||
mjcMargin("mjc:margin", TfToken::Immortal),
|
||||
mjcMpos("mjc:mpos", TfToken::Immortal),
|
||||
mjcMquat("mjc:mquat", TfToken::Immortal),
|
||||
mjcOptionActuatorgroupdisable("mjc:option:actuatorgroupdisable",
|
||||
@@ -114,9 +122,17 @@ MjcPhysicsTokensType::MjcPhysicsTokensType()
|
||||
mjcOptionWind("mjc:option:wind", TfToken::Immortal),
|
||||
mjcQpos("mjc:qpos", TfToken::Immortal),
|
||||
mjcQvel("mjc:qvel", TfToken::Immortal),
|
||||
mjcRef("mjc:ref", TfToken::Immortal),
|
||||
mjcRefSite("mjc:refSite", TfToken::Immortal),
|
||||
mjcShellinertia("mjc:shellinertia", TfToken::Immortal),
|
||||
mjcSliderSite("mjc:sliderSite", TfToken::Immortal),
|
||||
mjcSolimpfriction("mjc:solimpfriction", TfToken::Immortal),
|
||||
mjcSolimplimit("mjc:solimplimit", TfToken::Immortal),
|
||||
mjcSolreffriction("mjc:solreffriction", TfToken::Immortal),
|
||||
mjcSolreflimit("mjc:solreflimit", TfToken::Immortal),
|
||||
mjcSpringdamper("mjc:springdamper", TfToken::Immortal),
|
||||
mjcSpringref("mjc:springref", TfToken::Immortal),
|
||||
mjcStiffness("mjc:stiffness", TfToken::Immortal),
|
||||
muscle("muscle", TfToken::Immortal),
|
||||
newton("newton", TfToken::Immortal),
|
||||
none("none", TfToken::Immortal),
|
||||
@@ -131,6 +147,7 @@ MjcPhysicsTokensType::MjcPhysicsTokensType()
|
||||
Keyframe("Keyframe", TfToken::Immortal),
|
||||
MeshCollisionAPI("MeshCollisionAPI", TfToken::Immortal),
|
||||
PhysicsActuatorAPI("PhysicsActuatorAPI", TfToken::Immortal),
|
||||
PhysicsJointsAPI("PhysicsJointsAPI", TfToken::Immortal),
|
||||
SceneAPI("SceneAPI", TfToken::Immortal),
|
||||
SiteAPI("SiteAPI", TfToken::Immortal),
|
||||
allTokens({affine,
|
||||
@@ -155,6 +172,11 @@ MjcPhysicsTokensType::MjcPhysicsTokensType()
|
||||
mjcActLimited,
|
||||
mjcActRangeMax,
|
||||
mjcActRangeMin,
|
||||
mjcActuatorfrclimited,
|
||||
mjcActuatorfrcrangeMax,
|
||||
mjcActuatorfrcrangeMin,
|
||||
mjcActuatorgravcomp,
|
||||
mjcArmature,
|
||||
mjcBiasPrm,
|
||||
mjcBiasType,
|
||||
mjcCrankLength,
|
||||
@@ -162,6 +184,7 @@ MjcPhysicsTokensType::MjcPhysicsTokensType()
|
||||
mjcCtrlLimited,
|
||||
mjcCtrlRangeMax,
|
||||
mjcCtrlRangeMin,
|
||||
mjcDamping,
|
||||
mjcDynPrm,
|
||||
mjcDynType,
|
||||
mjcFlagActuation,
|
||||
@@ -190,6 +213,7 @@ MjcPhysicsTokensType::MjcPhysicsTokensType()
|
||||
mjcForceLimited,
|
||||
mjcForceRangeMax,
|
||||
mjcForceRangeMin,
|
||||
mjcFrictionloss,
|
||||
mjcGainPrm,
|
||||
mjcGainType,
|
||||
mjcGear,
|
||||
@@ -197,6 +221,7 @@ MjcPhysicsTokensType::MjcPhysicsTokensType()
|
||||
mjcJointInParent,
|
||||
mjcLengthRangeMax,
|
||||
mjcLengthRangeMin,
|
||||
mjcMargin,
|
||||
mjcMpos,
|
||||
mjcMquat,
|
||||
mjcOptionActuatorgroupdisable,
|
||||
@@ -227,9 +252,17 @@ MjcPhysicsTokensType::MjcPhysicsTokensType()
|
||||
mjcOptionWind,
|
||||
mjcQpos,
|
||||
mjcQvel,
|
||||
mjcRef,
|
||||
mjcRefSite,
|
||||
mjcShellinertia,
|
||||
mjcSliderSite,
|
||||
mjcSolimpfriction,
|
||||
mjcSolimplimit,
|
||||
mjcSolreffriction,
|
||||
mjcSolreflimit,
|
||||
mjcSpringdamper,
|
||||
mjcSpringref,
|
||||
mjcStiffness,
|
||||
muscle,
|
||||
newton,
|
||||
none,
|
||||
@@ -244,6 +277,7 @@ MjcPhysicsTokensType::MjcPhysicsTokensType()
|
||||
Keyframe,
|
||||
MeshCollisionAPI,
|
||||
PhysicsActuatorAPI,
|
||||
PhysicsJointsAPI,
|
||||
SceneAPI,
|
||||
SiteAPI}) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user