Main Content

jointPrimitivePosition

Class: simscape.multibody.CompiledMultibody
Namespace: simscape.multibody

Return position of specified joint primitive

Since R2022a

Description

[pos,status] = jointPrimitivePosition(cmb,jointPrimitive,state) returns the position of the specified joint primitive in a simscape.multibody.CompiledMultibody object, cmb, in the state, state.

You can query the positions of these joint primitives:

  • Revolute primitive

  • Prismatic primitive

  • Spherical primitive

  • Lead Screw primitive

  • Constant Velocity primitive

Input Arguments

expand all

Compiled multibody system, specified as a simscape.multibody.CompiledMultibody object.

Path of the joint primitive, specified as a string scalar or character vector. Separate the path elements by using forward slashes.

Example: 'Bottom_Right_Joint/Rz'

State of the compiled multibody system, specified as a simscape.multibody.State object. The state object includes the position and velocity of every joint primitive in the compiled multibody system.

Output Arguments

expand all

Position of the joint primitive, returned as a simscape.Value or simscape.multibody.QuaternionRotation object. The form of the value depends on the type of the joint primitive:

Primitive TypeType of Returned Position
Revolutesimscape.Value object that represents a scalar with a unit of angle
Prismaticsimscape.Value object that represents a scalar with a unit of length
Sphericalsimscape.multibody.QuaternionRotation object
Lead Screwsimscape.Value object that represents a scalar with a unit of angle
Constant Velocitysimscape.Value object that represents a 2-by-1 vector with a unit of angle, where the first element is the bend angle and second element is the azimuth

Status of the joint primitive in the given state, returned as a member of the simscape.multibody.StateStatus class that indicates whether the returned value is valid:

  • simscape.multibody.StateStatus.Valid: All kinematic constraints of the joint primitive are satisfied. Note that a valid status does not indicate that all the specified targets of the joint primitive have been met.

  • simscape.multibody.StateStatus.PositionViolation: Not all position constraints of the joint primitive are satisfied.

  • simscape.multibody.StateStatus.VelocityViolation: All position constraints of the joint primitive are satisfied, but not all velocity constraints of the joint primitive are satisfied.

  • simscape.multibody.StateStatus.SingularityViolation: All kinematic constraints of the joint primitive are satisfied, but the joint primitive is in a kinematic singularity.

Attributes

Accesspublic

To learn about attributes of methods, see Method Attributes.

Version History

Introduced in R2022a