1function [g_thrusters] = calculateThrusterTransformations(g_joints, num_thrusters, thruster_ax, thruster_pos, thruster_moduleNumber)
2
3
4
5
6
7
8
9
10
11g_thrusters = zeros(4,4,num_thrusters);
12
13for i = 1:num_thrusters
14
15 switch thruster_ax(i)
16 case 'Y'
17 g_joint2Thruster = [rotationZ(pi/2), thruster_pos(i,:)'; zeros(1,3), 1];
18 case 'Z'
19 g_joint2Thruster = [rotationY(-pi/2), thruster_pos(i,:)'; zeros(1,3), 1];
20 otherwise
21 g_joint2Thruster = eye(4);
22 end
23
24 g_thrusters(:,:,i) = g_joints(:,:,thruster_moduleNumber(i)-1) * g_joint2Thruster;
25end
26
27end
28
29
30