@@ -15,14 +15,14 @@ using namespace Eigen;
1515
1616
1717vector<double > fillVector (string repoBags, string fileName){
18- vector<double > fillVector (1000 );
18+ vector<double > fillVector (2000 );
1919 ifstream file ((repoBags + fileName).c_str (),ios::in);
2020 if (!file){
2121 cerr << " File " << fileName.c_str () << " not Read" << endl;
2222 }
2323
2424 double val;
25- for (int j=0 ; j<1000 ; j++) {
25+ for (int j=0 ; j<2000 ; j++) {
2626 string line;
2727 getline (file, line);
2828 stringstream ss (line);
@@ -61,24 +61,26 @@ int main (int argc, char *argv[])
6161 costFunction.setTauLimit (70 );
6262 costFunction.setJointLimit (0.0 , -2.35619449019 );
6363 costFunction.setJointVelLimit (30.0 , -30.0 );
64- CostFunction<double ,2 ,1 >::stateMat_t Q;
65- Q << 100.0 ,0.0 ,0.0 ,0.01 ;
66- costFunction.setCostGainState (Q);
67- // PyreneActuator.setLoadMass(20.0);
64+ // CostFunction<double,2,1>::stateMat_t Q;
65+ // Q << 500.0,0.0,0.0,0.01;
66+ // CostFunction<double,2,1>::commandMat_t P;
67+ // P << 100.0;
68+ // costFunction.setCostGainState(Q);
69+ // costFunction.setCostGainTorqueConstraint(P);
70+ // PyreneActuator.setLoadParam(30.0,-0.021481595, 0.10);
6871 DDPSolver<double ,2 ,1 > testSolverActuator (PyreneActuator,costFunction,DISABLE_FULLDDP,DISABLE_QPBOX);
6972
7073 double dx_joint;
7174 dx_joint = 0.5422 ;
7275 xinit << vec_joint_pos[0 ],
7376 dx_joint;
74-
75- unsigned int nbIterTestMax=1000 .0 ;
77+ xDes << vec_joint_pos[ 1 ], 0.0 ;
78+ unsigned int nbIterTestMax=2000 .0 ;
7679 unsigned int iter;
7780 testSolverActuator.FirstInitSolver (xinit,xDes,T,dt,iterMax,stopCrit);
7881
7982 for (int i=0 ; i<nbIterTestMax-1 ; i++) {
8083
81- xDes << vec_joint_pos[i+1 ], 0.0 ;
8284 gettimeofday (&tbegin,NULL );
8385
8486 testSolverActuator.initSolver (xinit,xDes);
@@ -91,6 +93,7 @@ int main (int argc, char *argv[])
9193
9294 xinit << xList[1 ](0 ,0 ),
9395 xList[1 ](1 ,0 );
96+ xDes << vec_joint_pos[i+1 ], 0.0 ;
9497
9598
9699 texec+=((double )(tend.tv_sec -tbegin.tv_sec )*1000.0 +((tend.tv_usec -tbegin.tv_usec )/1000.0 ));
0 commit comments