Skip to content

Commit

Permalink
feat: add invert transformation matrix operation
Browse files Browse the repository at this point in the history
  • Loading branch information
juancarlosfarah committed Jul 29, 2021
1 parent 87c530b commit ab24fd6
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/matlab/operations/InvertTransformationMatrix.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
function [status, result] = InvertTransformationMatrix(pathToWorkspace, ...
params, ...
config)
%INVERTTRANSFORMATIONMATRIX Invert a transformation matrix.
% Uses `convert_xfm` with `inverse` to invert a transformation matrix.
%
% Input:
% - pathToWorkspace: Path to the workspace.
% - params: Parameters to be used in the operation.
% - config: Configuration to be used in the operation.
%
% Output:
% - status: Status returned by system call.
% - result: Result returned by system call.

arguments
pathToWorkspace char = '.'
params.inputMatrix char = ''
params.outputMatrix char = ''
config.verbose logical = false
end

fullInputMatrix = fullfile(pathToWorkspace, params.inputMatrix);
fullOutputMatrix = fullfile(pathToWorkspace, params.outputMatrix);

command = 'convert_xfm -inverse %s -omat %s';
sentence = sprintf(command, fullInputMatrix, fullOutputMatrix);
[status, result] = CallSystem(sentence, config.verbose);

end

0 comments on commit ab24fd6

Please sign in to comment.