This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

addFrameVariables

Create kinematic variables from select frame pair in KinematicsSolver object

Syntax

addFrameVariables(ks,groupName,type,base,follower)
addFrameVariables(ks,groupName,type,base,follower,Name,Value)

Description

addFrameVariables(ks,groupName,type,base,follower) adds to the KinematicsSolver object ks the variables needed to capture the transforms between a frame pair. The frames can be any pair of interest, one serving as follower, the other as base.

The transforms can be of two types: translations and rotations. The variables are their vector components, bundled to form a new variable group, or to extend one already formed.

The translation variables comprise an x-y-z Cartesian displacement sequence. The rotation variables comprise an x-y-z intrinsic angle sequence. The angles are each about the axes of the rotating follower frame.

The output is an updated table with the frame variables—both new and old—in rows. Each row gives the ID of a variable, the Simulink block paths to the base and follower frames from which it derives, and the unit in which its value is expressed.

The figure shows the variables of a general KinematicsSolver object. Target (T), guess (G), and output (O) variables can be joint variables (J) or frame variables (F). Joint variables are native to the object and can be assigned from its start as targets, guesses, and outputs. Frame variables must first be created with addFrameVariables.

addFrameVariables(ks,groupName,type,base,follower,Name,Value) adds the frame variables to the KinematicsSolver object ks and changes their units to an equivalent measure specified in the Name-Value pair arguments.

Input Arguments

collapse all

Name of the KinematicsSolver object for which to run the analysis. The object is a kinematic representation of the model from which it derives. It contains the variables upon which the analysis depends.

Example: 'fourBarKS'

Data Types: char | string

Name of the group in which to place the new frame variables. Each variable corresponds to a transform component. If adding variables to an existing group, use the name of that group.

The group name is the first of three strings in the IDs of frame variables. The IDs are each structured group.type.component.

Example: 'wrist_position'

Data Types: char | string

Type of transform which the new frame variables are to capture. Use Translation for the linear offsets from base to follower. Use Rotation for the angular offsets. The first arrange in x-y-z Cartesian sequences, and the second arrange in x-y-z angle sequences.

The transform type is the second of three strings in the IDs of frame variables. The IDs are each structured group.type.component.

Example: 'translation'

Data Types: char | string

Simulink path from the root of the model to the frame port from which to obtain the base frame. Frame variables each derive from a frame pair, one serving as base, the other as follower. The base frame is that relative to which the transforms given in the frame variables are specified.

Example: 'sm_import_humanoid_urdf/World/W'

Data Types: char | string

Simulink path from the root of the model to the frame port from which to obtain the follower frame. Frame variables each derive from a frame pair, one serving as base, the other as follower. The follower frame is that relative to which the transforms given in the frame variables are specified.

Example: 'sm_import_humanoid_urdf/left_hand/F'

Data Types: char | string

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: addFrameVariables('ks','Translation','sm_four_bar/'World Frame/W','sm_four_bar/Connector Link/Left End Cap/R');

Unit in which to express the frame variables if of type Rotation. The new unit overrides the object default for angles.

Example: 'rad'

Data Types: char | string

Unit in which to express the frame variables if of type Translation. The new unit overrides the object default for length.

Example: 'in'

Data Types: char | string

Introduced in R2019a