-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCreateHumanoid.m
98 lines (84 loc) · 1.97 KB
/
CreateHumanoid.m
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
87
88
89
90
91
92
93
94
95
96
97
function robot=CreateHumanoid(chest_pose)
%
% function robot=CreateHumanoid(pose)
%
% Create the humanoid structure
%
% Inputs:
% chest_pose: 4x4 homogeneous matrix containing the pose of the chest in the
% world frame
%
% Outputs:
% robot: data strcture of the robot
%
%
l_hip=0.1;
h_chest=0.25;
h_thigh=0.25;
h_shin=0.2;
h_zmp=0.1;
i=1;
robot.body(i).name='CHEST';
robot.body(i).father=[];
robot.body(i).child=['R_HIP';'L_HIP'];
robot.body(i).Tabs=chest_pose;
% RIGHT
i=i+1;
robot.body(i).name='R_HIP';
robot.body(i).father=['CHEST'];
robot.body(i).child=['R_THIGH'];
robot.body(i).a=[1.0;0.0;0.0];
robot.body(i).b=[0.0;l_hip;-h_chest];
robot.body(i).q=0.0;
i=i+1;
robot.body(i).name='R_THIGH';
robot.body(i).father=['R_HIP'];
robot.body(i).child=['R_SHIN'];
robot.body(i).a=[0.0;1.0;0.0];
robot.body(i).b=[0.0;0.0;0.0];
robot.body(i).q=0.0;
i=i+1;
robot.body(i).name='R_SHIN';
robot.body(i).father=['R_THIGH'];
robot.body(i).child=['R_FOOT'];
robot.body(i).a=[0.0;1.0;0.0];
robot.body(i).b=[0.0;0.0;-h_thigh];
robot.body(i).q=0.0;
i=i+1;
robot.body(i).name='R_FOOT';
robot.body(i).father=['R_SHIN'];
robot.body(i).child=[];
robot.body(i).a=[0.0;1.0;0.0];
robot.body(i).b=[0.0;0.0;-h_shin];
robot.body(i).q=0.0;
% LEFT
i=i+1;
robot.body(i).name='L_HIP';
robot.body(i).father=['CHEST'];
robot.body(i).child=['L_THIGH'];
robot.body(i).a=[1.0;0.0;0.0];
robot.body(i).b=[0.0;-l_hip;-h_chest];
robot.body(i).q=0.0;
i=i+1;
robot.body(i).name='L_THIGH';
robot.body(i).father=['L_HIP'];
robot.body(i).child=['L_SHIN'];
robot.body(i).a=[0.0;1.0;0.0];
robot.body(i).b=[0.0;0.0;0.0];
robot.body(i).q=0.0;
i=i+1;
robot.body(i).name='L_SHIN';
robot.body(i).father=['L_THIGH'];
robot.body(i).child=['L_FOOT'];
robot.body(i).a=[0.0;1.0;0.0];
robot.body(i).b=[0.0;0.0;-h_thigh];
robot.body(i).q=0.0;
i=i+1;
robot.body(i).name='L_FOOT';
robot.body(i).father=['L_SHIN'];
robot.body(i).child=[];
robot.body(i).a=[0.0;1.0;0.0];
robot.body(i).b=[0.0;0.0;-h_shin];
robot.body(i).q=0.0;
robot.h_zmp=h_zmp;
robot.nbody=i;