-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloadStaticConstraints.m
More file actions
87 lines (64 loc) · 3.18 KB
/
loadStaticConstraints.m
File metadata and controls
87 lines (64 loc) · 3.18 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
function [constr_count] = loadStaticConstraints(constr_count)
% Function loads the stationary constraints for a range of trial cases
% Loads into the constraint global structure, using options (in global structure OPT)
% for testcase and trial. Input and output to track constraint count
global OPT
switch OPT.testcase
case 1
switch OPT.static
case 1
%% Spherical ellipsoid constraint only
% Define Properties
x0 = [0;0;0]; % Centroid
r_sphere = 0.2; % Radius of sphere
axes_sizes = [r_sphere;r_sphere;r_sphere]; % Axes vector
Rot_Mat = eye(3); % Rotation matrix (identity for sphere)
% Create Constraint (input into constraints global variable)
[constr_count] = initEllipsoidConstraint(x0,axes_sizes,Rot_Mat,constr_count);
case 2
%% Rotated ellipsoid constraint only
% Define Properties
x0 = [0;0;0]; % Centroid
axes_sizes = [0.2;0.6;0.1]; % Axes vector
Rot_Mat = DCM_be([pi/4;2*pi/3;pi/2]); % Rotation matrix
% Create ellipsoid constraint (input into constraints global variable)
[constr_count] = initEllipsoidConstraint(x0,axes_sizes,Rot_Mat,constr_count);
case 3
%% Cylinder constraint only
% locations of the ends of the cylinder
x1 = [-0.2;0.05;0.2];
x2 = [0.2;-0.05;-0.2];
% Radius of Cylinder
r = 0.15;
% size of endcap (out from the circular end of the cylinder)
l = r./100;
% Create the cylinder constraint
constr_count = initCylinderConstraint(x1, x2, r, l, constr_count);
% locations of the ends of the cylinder
x1 = [0.2;0.05;0.2];
x2 = [-0.2;-0.05;-0.2];
% Radius of Cylinder
r = 0.05;
% size of endcap (out from the circular end of the cylinder)
l = r./100;
% Create the cylinder constraint
constr_count = initCylinderConstraint(x1, x2, r, l, constr_count);
case 4
%% Cube Constraint only
% Define Properties
x0 = [0.0;0;0.0]; % Centroid
r = 0.1; % Half side length
Rot_Mat = DCM_be([0.1;0.5;15*pi/180]); % Rotation matrix
% create the cube constraint
constr_count = initCubeConstraint(x0,r,Rot_Mat,constr_count);
case 5
%% Cube and sphere
% Define Properties
x0 = [0;0;0]; % Centroid
r = 0.1; % Half side length
Rot_Mat = DCM_be([0;0;0*pi/180]); % Rotation matrix
% create the cube constraint
constr_count = initCubeConstraint(x0,r,Rot_Mat,constr_count);
case 6
end
end