[d164bf]: / tool_funcs / createTorsionProfile.m

Download this file

37 lines (25 with data), 1.5 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
%-------------------------------------------------------------------------%
% Copyright (c) 2021 Modenese L. %
% Author: Luca Modenese, 2021 %
% email: l.modenese@imperial.ac.uk %
% ----------------------------------------------------------------------- %
function [torsion_angle_func_rad, torsion_doc_string] = createTorsionProfile(LengthProfilePoints, TorsionProfilePointsDeg, torsionAxis)
disp('--------------------------');
disp(' CREATING TORSION PROFILE ');
disp('--------------------------');
% get axis indices
[~, axis_ind] = getAxisRotMat(torsionAxis);
disp(['Axis of torsion: ', upper(torsionAxis)]);
disp('Profile (Tors Point, Coordinate)')
% pointProfile on axis of interest
axis_LengthProfilePoints = LengthProfilePoints(:, axis_ind)';
for np = 1:length(TorsionProfilePointsDeg)
disp([num2str(TorsionProfilePointsDeg(np)), ' deg |------> ' num2str(axis_LengthProfilePoints(np))]);
end
% create implicit function for calculating torsion at a certain quote
torsion_angle_func_rad = @(L)torsionProfile(L, axis_LengthProfilePoints, TorsionProfilePointsDeg);
% round degrees of torsion at joints
torsion_bounds_deg = round([torsion_angle_func_rad(axis_LengthProfilePoints(1)) torsion_angle_func_rad(axis_LengthProfilePoints(2))]*180/pi);
% strings to use for naming models
torsion_doc_string = ['Prox',num2str(torsion_bounds_deg(1)),'Dist',num2str(torsion_bounds_deg(2)),'Deg'];
end