58 #define clock() GetTickCount()
66 using namespace ROBOOP;
72 {1.758, 2.8, -1.015, 0.225, 0.0, -0.228, 3.358, 0.05, 4.237, 0.1406, 10, 12.5, 0.5, 0.35, 0.0, 0.0, 0.0,
73 1.6021, 3.07, -0.925, 0.1125, 0.1949, -0.228, 3.358, 0.05, 4.237, 0.1406, 10, 12.5, 0.5, 0.35, 0.0, 0.0, 0.0,
74 -1.7580, 2.8, -1.015, -0.1125, 0.1949, -0.228, 3.358, 0.05, 4.237, 0.1406, 10, 12.5, 0.5, 0.35, 0.0, 0.0, 0.0,
75 -1.6021, 3.07, -0.925, -0.225, 0.0, -0.228, 3.358, 0.05, 4.237, 0.1406, 10, 12.5, 0.5, 0.35, 0.0, 0.0, 0.0,
76 0.0, 2.8, 2.03, -0.1125, -0.1949, -0.228, 3.358, 0.05, 4.237, 0.1406, 10, 12.5, 0.5, 0.35, 0.0, 0.0, 0.0,
77 0.0, 3.07, 1.85, 0.1125, -0.1949, -0.228, 3.358, 0.05, 4.237, 0.1406, 10, 12.5, 0.5, 0.35, 0.0, 0.0, 0.0,
78 0.0, 0.0, -0.114, 1.001, 0.59, 0.843, 10, 0.12, 0.04, 0.5, 0.5, 0.5, 1.5, 0.5, 0.005, 5.44, 0.443};
81 {0.2, 0.3, -0.4, 0.1, -1.4, 0.1};
83 {0.25, 0.25, -0.45, 0.07, -1.7, 0.07};
85 {3.0508, 3.2324, 3.2997, 3.4560, 3.5797, 3.6935};
87 {0.2, 0.3, -0.4, 0.1, -1.4, 0.1};
89 {-10.0, -10.0, -10, -10.0, -10, -10};
95 {126.219689, 789.968672, 0.708602, 79.122963, 81.806978, -31.61797};
100 Matrix InitPlatt(7,17);
102 Matrix _q(6,1), qg(6,1), _dq(6,1), _ddq(6,1), _l(6,1), To(6,1),
103 V(6,1), L(6,1), tddq(6,1);
106 InitPlatt<<Stewart_Ini;
112 tddq << Stewart_tddq;
116 platt_Stewart =
Stewart(InitPlatt);
119 platt_Stewart.
set_q(_q);
120 platt_Stewart.
set_dq(_dq);
123 cout<<
"===============================\n";
124 cout<<
"Benchmarks for Stewart platform\n";
125 cout<<
"===============================\n\n";
126 cout<<
"Inverse Kinematics :\n";
128 for(i =0; i<20000; i++)
131 cout<<
"Time : "<<((end - start)/(Real)CLOCKS_PER_SEC)*1000.0/20000<<"\nResult : "<<L.t()<<endl;
134 cout<<"Forward Kinematics :\n";
135 platt_Stewart.set_q(qg);
137 for(i =0; i<100; i++){
139 platt_Stewart.
set_q(qg);}
141 cout<<
"Time : "<<((end - start)/(Real)CLOCKS_PER_SEC)*1000.0/100<<"\nResult : "<<L.t()<<endl;
143 platt_Stewart.set_q(_q);
147 for(i =0; i<100; i++)
148 L = platt_Stewart.Torque();
150 cout<<"Time : "<<((end - start)/(Real)CLOCKS_PER_SEC)*1000.0/100<<"\nResult : "<<L.t()<<endl;
152 platt_Stewart.set_ddq(tddq);
156 for(i =0; i<100; i++)
157 L = platt_Stewart.ForwardDyn(To);
159 cout<<"Time : "<<((end - start)/(Real)CLOCKS_PER_SEC)*1000.0/100<<"\nResult : "<<L.t()<<endl;
164 L=platt_Stewart.ForwardDyn_AD(V,t);
166 cout<<"Forward
Dynamics with actuators:\nResult : "<<L.t()<<endl;
171 const Real PUMA560_data[] =
172 {0, 0, 0, 0, M_PI/2.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.35, 0, 0, 0, 0, 0, 0, 0,
173 0, 0, 0, 0.4318, 0, 0, 0, 0, 17.4, -0.3638, 0.006, 0.2275, 0.13, 0, 0, 0.524, 0, 0.539, 0, 0, 0, 0, 0,
174 0, 0, 0.15005, 0.0203, -M_PI/2.0, 0, 0, 0, 4.8, -0.0203, -0.0141, 0.07, 0.066, 0, 0, 0.086, 0, 0.0125, 0, 0, 0, 0, 0,
175 0, 0, 0.4318, 0.0, M_PI/2.0, 0, 0, 0, 0.82, 0, 0.019, 0, 0.0018, 0, 0, 0.0013, 0, 0.0018, 0, 0, 0, 0, 0,
176 0, 0, 0, 0.0, -M_PI/2.0, 0, 0, 0, 0.34, 0.0, 0.0, 0.0, 0.0003, 0.0, 0.0, 0.0004, 0.0, 0.0003, 0, 0, 0, 0, 0,
177 0, 0, 0, 0, 0, 0, 0, 0, 0.09, 0.0, 0.0, 0.032, 0.00015, 0.0, 0.0, 0.00015, 0.0, 0.00004, 0, 0, 0, 0, 0};
183 Matrix initrob(6,23), thomo, temp2;
184 ColumnVector q(6), qs(6), temp;
187 initrob << PUMA560_data;
188 robot =
Robot(initrob);
192 printf(
"=================================\n");
193 printf(
"Benchmarks for serial 6 dof robot\n");
194 printf(
"=================================\n\n");
196 printf(
"Begin compute Forward Kinematics\n");
198 for (i = 1; i <= NTRY; i++) {
200 temp2 = robot.
kine();
203 printf(
"MilliSeconds %6.2f\n", ((end - start) / (Real)CLOCKS_PER_SEC)*1000.0/NTRY);
209 thomo = robot.
kine();
210 printf(
"Begin compute Inverse Kinematics\n");
212 for (i = 1; i <= NTRY; i++) {
217 printf(
"MilliSeconds %6.2f\n", ((end - start) / (Real)CLOCKS_PER_SEC)*1000.0/NTRY);
220 printf(
"Begin compute Jacobian\n");
222 for (i = 1; i <= NTRY; i++) {
227 printf(
"MilliSeconds %6.2f\n", ((end - start) / (Real)CLOCKS_PER_SEC)*1000.0/NTRY);
230 printf(
"Begin compute Torque\n");
232 for (i = 1; i <= NTRY; i++) {
233 temp = robot.
torque(q,q,q);
236 printf(
"MilliSeconds %6.2f\n", ((end - start) / (Real)CLOCKS_PER_SEC)*1000.0/NTRY);
239 printf(
"Begin acceleration\n");
241 for (i = 1; i <= NTRY; i++) {
245 printf(
"MilliSeconds %6.2f\n", ((end - start) / (Real)CLOCKS_PER_SEC)*1000.0/NTRY);