Main Content

addFrame

Class: simscape.multibody.RigidBody
Namespace: simscape.multibody

Add frame to rigid body

Since R2022a

Description

addFrame(rb,newFrame,parentFrame,T) adds a new frame to a simscape.multibody.RigidBody object through a simscape.multibody.RigidTransform object. Note that the new frame is rigidly attached to a top-level frame of the RigidBody object, and the newly added frame does have a connector by default. To add a connector to a frame, use addConnector method.

The rb argument is the RigidBody object to which you add the new frame. The newFrame argument specifies the name of the new frame. The parentFrame argument is the name of the top-level frame to which the new frame is attached. The T is the RigidTransform object used to attach the new frame.

addFrame(___,side) adds a new frame to the rb object through a RigidTransfom object that has the specified orientation. Use a simscape.multibody.FrameSide object to specify the side argument that specifies the orientation of the RigidTransform object.

addFrame(rb,newFrame,subbodyConnector) adds a new frame to the simscape.multibody.RigidBody object, rb, through the subbody connector, subbodyConnector. The subbodyConnector argument is a two-element path.

Note that the subbody must be a RigidBody object that has at least two connectors. The connector used to attach the new frame must not be the connector that has already connected to the structure tree of the rb object.

Input Arguments

expand all

Rigid body, specified as a simscape.multibody.RigidBody object. The rb object represents the rigid body to which you add the new frame.

Name of the new frame, specified as a string scalar or character vector. The name must be unique among the names of frames and component objects at the top level of the RigidBody object to which you add the frame object. In addition, the name must be valid a MATLAB® identifier.

Example: "fnew"

Data Types: char | string

Name of the frame to which the new frame is connected, specified as a string scalar or character vector. The name must correspond to an existing frame at the top level of the RigidBody object.

Example: "reference"

Data Types: char | string

Rigid transform, specified as a simscape.multibody.RigidTransform object. The RigidTransform object represents the rigid transform between the new frame and the parent frame.

Which side of the RigidTransform object is connected to the parent frame, specified as a simscape.multibody.FrameSide.Base or simscape.multibody.FrameSide.Follower object. Omitting the side argument connects the base frame of theRigidTransfom object to the parent frame.

This argument specifies the orientation of the RigidTransfom object used for the T argument. Use the simscape.multibody.FrameSide.Base object to connect the base frame of the RigidTransfom object to the parent frame, or use the simscape.multibody.FrameSide.Follower object to connect the follower frame of the RigidTransform object to the parent frame.

Name of a connector of a subbody of the RigidBody object, specified as a string scalar or character vector. The name is a two-element path, and the path elements are separated by a forward slash. The first element is the name of the subbody, and the second element is the name of the connector.

Note that the subbody object must have at least two connectors. The specified connector must not be a connector that is already connected to the tree structure of the parent RigidBody object.

Example: "subrb/reference"

Data Types: char | string

Attributes

Accesspublic

To learn about attributes of methods, see Method Attributes.

Version History

Introduced in R2022a