Syntax
smbSetJointInputTorque(Joint,[InpPS])
Input Parameter
Joint : | | Unique(!) Joint name 'R1' or 'R1.J' |
InpPS : | | |
Copyright 2017-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This function, smbSetJointInputTorque
, is designed to change the actuation mode of a joint in a SimMechanics model to "InputTorque". Below is a detailed explanation of the algorithm and its parameters.
Input Parameters
- Joint: A unique identifier for the joint, such as 'R1' or 'R1.J'. This is a required parameter.
- InpPS: An optional parameter that can be provided as a second argument. It is initialized as an empty string if not provided.
Algorithm Steps
- The function checks if the second argument,
InpPS
, is provided. If it is, InpPS
is set to the value of the second argument; otherwise, it remains an empty string.
- If no arguments are provided, the function retrieves the full name of the current block using
getfullname(gcb)
and prints a message indicating the joint being processed.
- The original joint name is stored in
OJ
, and the function attempts to find the joint using smbWhich
by appending '.J' to the original joint name.
- If the joint is not found with the appended '.J', the function tries to find it using the original joint name.
- The function sets the joint's torque actuation mode to 'InputTorque' using
set_param
. This changes the joint's behavior to accept an input torque.
- The motion actuation mode of the joint is set to 'ComputedMotion', indicating that the motion is computed based on the input torque.
- Finally, the function calls
smbshow
to display the joint's configuration or status.
Algorithm explaination created using ChatGPT on 2025-08-18 22:59. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21