Syntax
T=KMT(KM,N);
Input Parameter
KM : | | Kinematic Model {Solid ' Name'} |
N : | | Name "Solid.Frame" |
Output Parameter
Copyright 2015-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, KMT, is designed to return a homogeneous transformation (HT) matrix from a kinematic model. The function takes two input parameters and provides one output result.
Input Parameters
- KM: This is the kinematic model, which consists of a list of solids and a list of strings that identify each solid in the list. It is expected to be a structured data type with fields such as 'Sname' and 'SG'.
- N: This is a string in the format "Solid.Frame", where "Solid" is the name of the solid and "Frame" is the name of the frame within that solid.
Output Results
- T: The output is the HT matrix, which represents the transformation from the base frame to the specified frame within the solid.
Algorithm Steps
- Initialize the output matrix
T
as an empty array and the index i
as 0.
- Find the position of the dot in the string
N
to separate the solid name from the frame name.
- Extract the solid name
Bd
and the frame name Fm
from N
.
- Initialize flags
ins
and frm
as false to track if the solid and frame are found.
- Loop through the list of solid names in
KM.Sname
to find a match for Bd
:
- If a match is found, set
ins
to true and break the loop.
- If the solid is found (
ins
is true):
- Retrieve the solid group
SG
corresponding to the solid.
- Loop through the list of frame names in
SG.Tname
to find a match for Fm
:
- If a match is found, set
frm
to true and break the loop.
- If the frame is found (
frm
is true), calculate the HT matrix T
as the product of the base transformation KM.BT{i}
and the frame transformation SG.T{j}
.
- If the frame is not found, print an error message indicating the frame does not exist.
- If the solid is not found, print an error message indicating the solid does not exist.
Algorithm explaination created using ChatGPT on 2025-08-19 00:16. (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