Main Content

simscape.multibody.JointActuationDictionary Class

Namespace: simscape.multibody

Dictionary that store joint primitive actuations

Since R2024a

Description

Use an object of the simscape.multibody.JointActuationDictionary class to store joint actuations to apply to a compiled multibody model. The object functions like a dictionary in that you can store joint primitives and their corresponding actuations as key-value pairs. The keys are the paths of the joint primitives. To construct actuation forces and torques, use these classes:

Class Attributes

Sealed
true
ConstructOnLoad
true
RestrictsSubclassing
true

For information on class attributes, see Class Attributes.

Creation

Description

dict = simscape.multibody.JointActuationDictionary creates a default joint actuation dictionary.

You can use dict(keys) = Values to pair an actuation force or torque with the path of corresponding joint primitive as the key-value pair. If you assign multiple values to the same key, the last value you assign overwrites the previous values of the key.

Examples

collapse all

  1. Create a joint actuation dictionary.

    dict = simscape.multibody.JointActuationDictionary
    
    dict = 
    
      JointActuationDictionary with no actuations.
  2. Construct actuations for the desired joint primitives. Create a force of 5 N for a prismatic joint primitive, a torque of 10 N*m for the revolute joint primitive, and a torque of [3 4 5] N*m for a spherical joint primitive.

    force = simscape.multibody.PrismaticPrimitiveActuationForce(...
                         simscape.Value(5,"N"));
    torque_r = simscape.multibody.RevolutePrimitiveActuationTorque(...
                         simscape.Value(10,"N*m"));
    torque_s = simscape.multibody.SphericalPrimitiveActuationTorque(...
                         simscape.Value([3 4 5],"N*m"));
    
  3. Use the dict dictionary to store the force and torque for the joint primitives as key-value pairs. The keys are the paths of the joint primitives.

    dict("Pg/Pz") = force;
    dict("Ri/Rz") = torque_r;
    dict("Ro/S") = torque_s
    
    dict = 
      JointActuationDictionary with actuations:
    
      RevolutePrimitiveActuationTorque:
    
      Primitive Path  Value  Unit
      ______________  _____  ____
    
      "Ri/Rz"         10     N*m 
    
      PrismaticPrimitiveActuationForce:
    
      Primitive Path  Value  Unit
      ______________  _____  ____
    
      "Pg/Pz"         5      N   
    
      SphericalPrimitiveActuationTorque:
    
      Primitive Path  Value    Unit
      ______________  _______  ____
    
      "Ro/S"          [3 4 5]  N*m 

    You can change the force and torque. For example, to replace the actuation torque for the Ri joint primitive with a new torque, enter:

    torque_r_new = simscape.multibody.RevolutePrimitiveActuationTorque(...
                         simscape.Value(-5,"N*m"));
    dict("Ri/Rz") = torque_r_new
    
    dict = 
      JointActuationDictionary with actuations:
    
      RevolutePrimitiveActuationTorque:
    
      Primitive Path  Value  Unit
      ______________  _____  ____
    
      "Ri/Rz"         -5     N*m 
    
      PrismaticPrimitiveActuationForce:
    
      Primitive Path  Value  Unit
      ______________  _____  ____
    
      "Pg/Pz"         5      N   
    
      SphericalPrimitiveActuationTorque:
    
      Primitive Path  Value    Unit
      ______________  _______  ____
    
      "Ro/S"          [3 4 5]  N*m 

Version History

Introduced in R2024a

expand all