PosetransrelGPL

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - 4Bar/Linkages
Introduced first in SolidGeometry 5.1, Creation date: 2021-12-15, Last change: 2025-09-15

shifts the poses into an effector grid point



See Also: PosetransrelCPLE , GPLauxgridpointsCPS2

Example Illustration

 missing image of PosetransrelGPL(PS,ng,nn)

Syntax

PS=PosetransrelGPL(PS,[ng,nn])

Input Parameter

PS: Pose
ng: optional number of grid points
nn: selected grid point; default is nearest

Output Parameter

PS: Resulting Pose

Examples


PosetransrelGPL(Posesample(12)); % GPL unchanged, just shifted to nearest Grid point
PosetransrelGPL(Posesample(12),'','1); % GPL unchanged, just shifted to Grid point 1
PosetransrelGPL(Posesample(12),30); % New GPL with 30 entries and nearst is selected




Copyright 2021-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, PosetransrelGPL, is designed to shift poses into an effector grid point. It is part of the SG-Library and was introduced in SolidGeometry 5.1. The function takes in a pose and optionally a number of grid points and a selected grid point, and returns the resulting pose.

Input Parameters

Output

Algorithm Steps

  1. Retrieve the optional parameters ng and nn using the getfuncparams function.
  2. If ng is not empty, update the grid points of PS using GPLauxgridpointsCPS2 with the current pose's CPLE and ng.
  3. Calculate the transformation matrix T from the pose PS using TofPose.
  4. Transform the grid points PS.GPL using the transformation matrix T to get P1.
  5. If nn is empty, find the nearest grid point to the current position by calculating the Euclidean distance and selecting the minimum.
  6. Calculate the new position PLN by transforming the selected grid point back using the inverse of the transformation matrix.
  7. Create a new transformation matrix TN with the new position PLN.
  8. Transform the pose PS using PosetransrelCPLE with the new transformation matrix TN.
  9. If no output is requested, plot the results using SGfigure, Poseplotspace, Poseplot, PLplot, and CPSplot.
Algorithm explaination created using ChatGPT on 2025-08-19 07:21. (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