10 (std::vector<int16_t>& _strokes,
const std::vector<double> _angles)
12 float rad2Deg = 180.0 / M_PI;
14 dualJoint right_wrist =
16 rad2Deg * _angles[23]);
17 dualJoint left_wrist =
19 -rad2Deg * _angles[9]);
22 rad2Deg * _angles[1]);
25 rad2Deg * _angles[15]);
28 _strokes[0] = scale * rad2Deg * _angles[14];
29 _strokes[1] = scale * neck.one;
30 _strokes[2] = scale * neck.two;
36 _strokes[5] = -scale * rad2Deg * _angles[19];
38 _strokes[7] = -scale * rad2Deg * _angles[21];
39 _strokes[8] = scale * right_wrist.one;
40 _strokes[9] = scale * right_wrist.two;
41 _strokes[10] = -scale * (rad2Deg * _angles[27] - 50.0) * 0.18;
47 _strokes[13] = -scale * rad2Deg * _angles[5];
49 _strokes[15] = -scale * rad2Deg * _angles[7];
50 _strokes[16] = scale * left_wrist.one;
51 _strokes[17] = scale * left_wrist.two;
52 _strokes[18] = scale * (rad2Deg * _angles[13] + 50.0) * 0.18;
54 _strokes[19] = scale * waist.two;
55 _strokes[20] = scale * waist.one;
56 _strokes[21] = scale * rad2Deg * _angles[0];
58 _strokes[22] = scale *
LegTable( rad2Deg * _angles[29]);
59 _strokes[23] = scale *
LegTable(- rad2Deg * _angles[28]);
64 (std::vector<double>& _angles,
const std::vector<int16_t> _strokes)
67 float left_wrist_roll_stroke =
68 (scale * _strokes[16] + scale * _strokes[17]) * 0.5;
69 float right_wrist_roll_stroke =
70 (scale * _strokes[8] + scale * _strokes[9]) * 0.5;
71 float waist_pitch_stroke =
72 (scale * _strokes[19] + scale * _strokes[20]) * 0.5;
73 float neck_pitch_stroke =
74 (scale * _strokes[1] + scale * _strokes[2]) * 0.5;
75 float deg2Rad = M_PI / 180.0;
76 float knee_angle = - deg2Rad *
LegInvTable(scale * _strokes[23]);
77 float ankle_angle = deg2Rad *
LegInvTable(scale * _strokes[22]);
81 deg2Rad * scale * _strokes[21];
92 -deg2Rad * scale * _strokes[13];
96 -deg2Rad * scale * _strokes[15];
102 -deg2Rad * (scale * _strokes[18] * 5.556 - 50.0);
106 deg2Rad * (scale * _strokes[18] * 5.556 - 50.0);
109 deg2Rad * scale * _strokes[0];
120 -deg2Rad * scale * _strokes[5];
124 -deg2Rad * scale * _strokes[7];
130 deg2Rad * (scale * _strokes[10] * 5.556 - 50.0);
134 -deg2Rad * (scale * _strokes[10] * 5.556 - 50.0);
136 _angles[28] = knee_angle;
137 _angles[29] = ankle_angle;
float ShoulderRollInvTable(float _stroke)
float ElbowPitchTable(float _angle)
void Angle2Stroke(std::vector< int16_t > &_strokes, const std::vector< double > _angles)
float WristPitchInvTable(float _stroke)
float WristRollInvTable(float _stroke)
float WaistPitchInvTable(float _stroke)
float ShoulderPitchTable(float _angle)
float NeckPitchInvTable(float _stroke)
float ElbowPitchInvTable(float _stroke)
dualJoint WaistRollPitchTable(float _angle1, float _angle2)
void Stroke2Angle(std::vector< double > &_angles, const std::vector< int16_t > _strokes)
float ShoulderPitchInvTable(float _stroke)
float ShoulderRollTable(float _angle)
float NeckRollInvTable(float _stroke)
float LegTable(float _angle)
float WaistRollInvTable(float _stroke)
dualJoint NeckRollPitchTable(float _angle1, float _angle2)
float LegInvTable(float _stroke)
dualJoint WristRollPitchTable(float _angle1, float _angle2)