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
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
- PS: The initial pose.
- ng: An optional parameter specifying the number of grid points.
- nn: The selected grid point. If not provided, the nearest grid point is selected by default.
Output
- PS: The resulting pose after transformation.
Algorithm Steps
- Retrieve the optional parameters
ng
and nn
using the getfuncparams
function.
- If
ng
is not empty, update the grid points of PS
using GPLauxgridpointsCPS2
with the current pose's CPLE and ng
.
- Calculate the transformation matrix
T
from the pose PS
using TofPose
.
- Transform the grid points
PS.GPL
using the transformation matrix T
to get P1
.
- If
nn
is empty, find the nearest grid point to the current position by calculating the Euclidean distance and selecting the minimum.
- Calculate the new position
PLN
by transforming the selected grid point back using the inverse of the transformation matrix.
- Create a new transformation matrix
TN
with the new position PLN
.
- Transform the pose
PS
using PosetransrelCPLE
with the new transformation matrix TN
.
- 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