17 void outputLine(
double,
double,
double,
double,
double,
double,
double);
20 int main(
int argc ,
char** argv){
33 Vector grav(0.0,0.0,-9.81);
49 std::cout<<
"pose (with dynamic model): \n"<<T<<std::endl;
50 std::cout<<
"tau (with dynamic model): \n"<<tau<<std::endl;
53 chaindynparams.JntToMass(q,H);
54 chaindynparams.JntToCoriolis(q,qdot,C);
55 chaindynparams.JntToGravity(q,G);
59 Add(tauHCG,C,tauHCGa);
60 Add(tauHCGa,G,tauHCG);
62 std::cout<<
"H= \n"<<H<<
"\n C = \n "<<C<<
"\n G= \n"<<G<<
" \n tau (with HCG)= \n"<< tauHCG <<std::endl;
65 std::ofstream outPoseFile(
"poseResultaat.dat",std::ios::app);
68 std::cerr <<
"File poseResultaat could not be opened" <<std::endl;
71 outPoseFile <<
"linenumber=experimentnr= "<< linenum <<
"\n";
72 outPoseFile << T <<
"\n \n";
75 std::ofstream outTauFile(
"tauResultaat.dat",std::ios::app);
78 std::cerr <<
"File tauResultaat could not be opened" <<std::endl;
81 outTauFile << setiosflags(std::ios::left) << setw(10) << linenum;
82 outTauFile << tau <<
"\n";
100 std::cout <<
"Give experiment number= line number in files \n ?";
109 std::ifstream inQfile(
"interpreteerbaar/q", std::ios::in);
113 std::cerr <<
"File q could not be opened \n";
118 std::cout << setiosflags(std::ios::left) << setw(15) <<
"_q(0)" << setw(15) <<
"_q(1)" << setw(15) <<
"_q(2)" << setw(15) <<
"_q(3)" << setw(15) <<
"_q(4)" << setw(15) <<
"_q(5)" << setw(15) <<
"_q(6)" <<
" \n" ;
120 while(!inQfile.eof())
123 inQfile >> _q(0) >> _q(1) >> _q(2) >> _q(3) >> _q(4) >> _q(5) >> _q(6);
127 outputLine( _q(0), _q(1), _q(2), _q(3), _q(4), _q(5), _q(6));
138 std::ifstream inQdotfile(
"interpreteerbaar/qdot", std::ios::in);
142 std::cerr <<
"File qdot could not be opened \n";
147 std::cout << setiosflags(std::ios::left) << setw(15) <<
"_qdot(0)" << setw(15) <<
"_qdot(1)" << setw(15) <<
"_qdot(2)" << setw(15) <<
"_qdot(3)" << setw(15) <<
"_qdot(4)" << setw(15) <<
"_qdot(5)" << setw(15) <<
"_qdot(6)" <<
" \n" ;
149 while(!inQdotfile.eof())
152 inQdotfile >> _qdot(0) >> _qdot(1) >> _qdot(2) >> _qdot(3) >> _qdot(4) >> _qdot(5) >> _qdot(6) ;
156 outputLine( _qdot(0), _qdot(1), _qdot(2), _qdot(3), _qdot(4), _qdot(5), _qdot(6));
167 std::ifstream inQdotdotfile(
"interpreteerbaar/qddot", std::ios::in);
171 std::cerr <<
"File qdotdot could not be opened \n";
176 std::cout << setiosflags(std::ios::left) << setw(15) <<
"_qdotdot(0)" << setw(15) <<
"_qdotdot(1)" << setw(15) <<
"_qdotdot(2)" << setw(15) <<
"_qdotdot(3)" << setw(15) <<
"_qdotdot(4)" << setw(15) <<
"_qdotdot(5)" << setw(15) <<
"_qdotdot(6)" <<
" \n" ;
178 while(!inQdotdotfile.eof())
181 inQdotdotfile >> _qdotdot(0) >> _qdotdot(1) >> _qdotdot(2) >> _qdotdot(3) >> _qdotdot(4) >> _qdotdot(5) >> _qdotdot(6);
185 outputLine(_qdotdot(0), _qdotdot(1), _qdotdot(2), _qdotdot(3), _qdotdot(4), _qdotdot(5), _qdotdot(6) );
190 inQdotdotfile.close();
195 void outputLine(
double x1,
double x2,
double x3,
double x4,
double x5,
double x6,
double x7)
197 std::cout << setiosflags(std::ios::left) << setiosflags(std::ios::fixed | std::ios::showpoint) <<setw(15)
198 << x1 << setw(15) << x2 <<setw(15) <<setw(15) << x3 <<setw(15) << x4 <<setw(15) << x5 <<setw(15) << x6 <<setw(15) << x7 <<
"\n";
virtual int JntToCart(const JntArray &q_in, Frame &p_out, int segmentNr=-1)
void outputLine(double, double, double, double, double, double, double)
This class encapsulates a serial kinematic interconnection structure. It is built out of segments...
unsigned int getNrOfSegments() const
This class represents an fixed size array containing joint values of a KDL::Chain.
int main(int argc, char **argv)
void Add(const JntArray &src1, const JntArray &src2, JntArray &dest)
unsigned int getNrOfJoints() const
A concrete implementation of a 3 dimensional vector class.
Recursive newton euler inverse dynamics solver.
int CartToJnt(const JntArray &q, const JntArray &q_dot, const JntArray &q_dotdot, const Wrenches &f_ext, JntArray &torques)
int getInputs(JntArray &, JntArray &, JntArray &, int &)
std::vector< Wrench > Wrenches
represents a frame transformation in 3D space (rotation + translation)
void Multiply(const JntArray &src, const double &factor, JntArray &dest)