28 #include <boost/thread.hpp> 40 ROS_ERROR(
"Parameter 'joint_names' not set");
47 ROS_ERROR(
"Parameter 'chain_base_link' not set");
52 ROS_ERROR(
"Parameter 'chain_tip_link' not set");
60 ROS_ERROR(
"Failed to construct kdl tree");
66 ROS_ERROR(
"Failed to initialize kinematic chain");
71 if (nh_identifier.
hasParam(
"output_file_path"))
99 double x_dot_lin_in, y_dot_lin_in, z_dot_lin_in;
100 double x_dot_rot_in, y_dot_rot_in, z_dot_rot_in;
101 double x_dot_lin_out, y_dot_lin_out, z_dot_lin_out;
102 double x_dot_rot_out, y_dot_rot_out, z_dot_rot_out;
103 double x_lin_start, y_lin_start, z_lin_start;
104 double x_rot_start, y_rot_start, z_rot_start;
106 std::vector<double> x_dot_lin_integrated, y_dot_lin_integrated, z_dot_lin_integrated;
107 std::vector<double> x_dot_rot_integrated, y_dot_rot_integrated, z_dot_rot_integrated;
108 geometry_msgs::Pose q_soll, q_ist;
113 ROS_INFO(
"Waiting for Twist callback");
121 boost::thread start_thread;
125 ROS_INFO(
"Start recording \n Enter any key to stop it.");
132 x_lin_start = q_ist.position.x;
133 y_lin_start = q_ist.position.y;
134 z_lin_start = q_ist.position.z;
136 double roll, pitch, yaw;
143 start_thread.interrupt();
145 period = time - last_update_time;
152 q =
tf::Quaternion(q_ist.orientation.x, q_ist.orientation.y, q_ist.orientation.z, q_ist.orientation.w);
190 last_update_time = time;
194 tcsetattr(
kfd, TCSANOW, &cooked);
196 ROS_INFO(
"Stopped recording... preparing output for octave plot ");
216 stepResponsePlot(
"x_linear_step", &
x_dot_lin_vec_in_, &x_dot_lin_integrated, &y_dot_lin_integrated, &z_dot_lin_integrated, &x_dot_rot_integrated, &y_dot_rot_integrated, &z_dot_rot_integrated);
217 stepResponsePlot(
"y_linear_step", &
y_dot_lin_vec_in_, &x_dot_lin_integrated, &y_dot_lin_integrated, &z_dot_lin_integrated, &x_dot_rot_integrated, &y_dot_rot_integrated, &z_dot_rot_integrated);
218 stepResponsePlot(
"z_linear_step", &
z_dot_lin_vec_in_, &x_dot_lin_integrated, &y_dot_lin_integrated, &z_dot_lin_integrated, &x_dot_rot_integrated, &y_dot_rot_integrated, &z_dot_rot_integrated);
219 stepResponsePlot(
"x_angular_step", &
x_dot_rot_vec_in_, &x_dot_lin_integrated, &y_dot_lin_integrated, &z_dot_lin_integrated, &x_dot_rot_integrated, &y_dot_rot_integrated, &z_dot_rot_integrated);
220 stepResponsePlot(
"y_angular_step", &
y_dot_rot_vec_in_, &x_dot_lin_integrated, &y_dot_lin_integrated, &z_dot_lin_integrated, &x_dot_rot_integrated, &y_dot_rot_integrated, &z_dot_rot_integrated);
221 stepResponsePlot(
"z_angular_step", &
z_dot_rot_vec_in_, &x_dot_lin_integrated, &y_dot_lin_integrated, &z_dot_lin_integrated, &x_dot_rot_integrated, &y_dot_rot_integrated, &z_dot_rot_integrated);
228 tcgetattr(
kfd, &cooked);
229 memcpy(&
raw, &cooked,
sizeof(
struct termios));
230 raw.c_lflag &= ~(ICANON | ECHO);
234 tcsetattr(
kfd, TCSANOW, &
raw);
238 if (read(
kfd, &
c, 1) < 0)
253 tcsetattr(
kfd, TCSANOW, &cooked);
263 for (
unsigned int j = 0; j <
dof_; j++)
265 for (
unsigned int i = 0; i < msg->name.size(); i++)
267 if (strcmp(msg->name[i].c_str(),
joints_[j].c_str()) == 0)
269 q_temp(j) = msg->position[i];
270 q_dot_temp(j) = msg->velocity[i];
296 ROS_WARN(
"ChainFkSolverVel failed!");
301 ROS_ERROR(
"jointstateCallback: received unexpected 'joint_states'");
320 geometry_msgs::Pose pos;
333 pos.position.x = stampedTransform.
getOrigin().
x();
334 pos.position.y = stampedTransform.
getOrigin().
y();
335 pos.position.z = stampedTransform.
getOrigin().
z();
336 pos.orientation.x = stampedTransform.
getRotation()[0];
337 pos.orientation.y = stampedTransform.
getRotation()[1];
338 pos.orientation.z = stampedTransform.
getRotation()[2];
339 pos.orientation.w = stampedTransform.
getRotation()[3];
344 double OutputRecorder::calculateLS(std::vector<double>* vec_out, std::vector<double>* vec_in,
int model_order,
double& a1,
double& a2,
double& a3,
double& b1,
double& b2,
double& b3)
347 Eigen::MatrixXd F(vec_out->size()-model_order, model_order*2);
348 Eigen::VectorXd
y(vec_out->size()-model_order);
349 Eigen::MatrixXd F_pinv;
350 Eigen::MatrixXd theta;
351 std::vector<double> errorVector;
355 if (model_order == 1)
357 for (
int i = 0; i < vec_out->size()-model_order; i++)
366 F(i, 0) = -1 * vec_out->at(i);
367 y(i) = vec_out->at(i+1);
369 F(i, 1) = vec_in->at(i);
374 if (model_order == 2)
376 for (
int i = 0; i < vec_out->size()-model_order; i++)
386 F(i, 0) = -1 * vec_out->at(i+1);
387 F(i, 1) = -1 * vec_out->at(i);
388 y(i) = vec_out->at(i+2);
390 F(i, 2) = vec_in->at(i+1);
391 F(i, 3) = vec_in->at(i);
396 if (model_order == 3)
398 for (
int i = 0; i < vec_out->size()-model_order; i++)
409 F(i, 0) = -1 * vec_out->at(i+2);
410 F(i, 1) = -1 * vec_out->at(i+1);
411 F(i, 2) = -1 * vec_out->at(i);
412 y(i) = vec_out->at(i+3);
414 F(i, 3) = vec_in->at(i+2);
415 F(i, 4) = vec_in->at(i+1);
416 F(i, 5) = vec_in->at(i);
423 Eigen::MatrixXd e = y - F * theta;
424 Eigen::MatrixXd e_squared = e.transpose() * e;
425 err = e_squared(0, 0);
427 errorVector.push_back(err);
429 a1 = a2 = a3 = b1 = b2 = b3 = 0;
430 if (model_order == 1)
436 if (model_order == 2)
444 if (model_order == 3)
454 std::cout <<
"\n\nTheta: \n" << theta << std::endl;
455 std::cout <<
"\n Squared Error: \n" << err << std::endl;
462 Eigen::JacobiSVD<Eigen::MatrixXd> svdOfM(matrix, Eigen::ComputeThinU | Eigen::ComputeThinV);
463 const Eigen::MatrixXd U = svdOfM.matrixU();
464 const Eigen::MatrixXd V = svdOfM.matrixV();
465 const Eigen::VectorXd S = svdOfM.singularValues();
466 Eigen::VectorXd Sinv = S;
469 for (std::size_t i = 0; i < S.rows(); ++i)
471 if (fabs(S(i)) > maxsv)
477 for (std::size_t i = 0; i < S.rows(); ++i)
479 Sinv(i) = ((S(i)< 0.0001)?0:1/S(i));
482 matrix_inv = V * Sinv.asDiagonal() * U.transpose();
487 if (out->size() == 0)
489 out->push_back(in*dt);
493 out->push_back(out->at(out->size()-1) + in*dt);
498 double y_dot_lin_in,
double y_dot_lin_out,
499 double z_dot_lin_in,
double z_dot_lin_out,
500 double x_dot_rot_in,
double x_dot_rot_out,
501 double y_dot_rot_in,
double y_dot_rot_out,
502 double z_dot_rot_in,
double z_dot_rot_out,
503 double x_lin_out,
double y_lin_out,
double z_lin_out,
double x_rot_out,
double y_rot_out,
double z_rot_out)
532 void OutputRecorder::stepResponsePlot(std::string file_name, std::vector<double>* in, std::vector<double>* x_lin_out, std::vector<double>* y_lin_out, std::vector<double>* z_lin_out, std::vector<double>* x_rot_out, std::vector<double>* y_rot_out, std::vector<double>* z_rot_out)
534 std::ofstream myfile;
538 ROS_INFO(
"Writing results to: %s", name.c_str());
539 const char* charPath = name.c_str();
541 myfile.open(charPath);
542 myfile <<
"clear all;close all;\n\n";
545 myfile << file_name <<
"_in = [" << std::endl;
546 for (
int i = 0; i < in->size()-1; i++)
548 myfile << in->at(i) <<std::endl;
550 myfile <<
"]; \n" << std::endl;
552 myfile << file_name <<
"_x_lin_out = [" << std::endl;
553 for (
int i = 0; i < x_lin_out->size()-1; i++)
555 myfile << x_lin_out->at(i) <<std::endl;
557 myfile <<
"]; \n" << std::endl;
559 myfile << file_name <<
"_y_lin_out = [" << std::endl;
560 for (
int i = 0; i < y_lin_out->size()-1; i++)
562 myfile << y_lin_out->at(i) <<std::endl;
564 myfile <<
"]; \n" << std::endl;
566 myfile << file_name <<
"_z_lin_out = [" << std::endl;
567 for (
int i = 0; i < z_lin_out->size()-1; i++)
569 myfile << z_lin_out->at(i) <<std::endl;
571 myfile <<
"]; \n" << std::endl;
573 myfile << file_name <<
"_x_rot_out = [" << std::endl;
574 for (
int i = 0; i < x_rot_out->size()-1; i++)
576 myfile << x_rot_out->at(i) <<std::endl;
578 myfile <<
"]; \n" << std::endl;
580 myfile << file_name <<
"_y_rot_out = [" << std::endl;
581 for (
int i = 0; i < y_rot_out->size()-1; i++)
583 myfile << y_rot_out->at(i) <<std::endl;
585 myfile <<
"]; \n" << std::endl;
587 myfile << file_name <<
"_z_rot_out = [" << std::endl;
588 for (
int i = 0; i < z_rot_out->size()-1; i++)
590 myfile << z_rot_out->at(i) <<std::endl;
592 myfile <<
"]; \n" << std::endl;
594 myfile <<
"k = size(" <<file_name <<
"_in);" << std::endl;
595 myfile <<
"t = linspace(0,k(1)*" << fabs(
dt_) <<
",size(" <<file_name <<
"_in));" << std::endl;
597 myfile <<
"figure" << std::endl;
598 myfile <<
"plot(t," << file_name <<
"_in,t," << file_name <<
"_x_lin_out,t," << file_name <<
"_y_lin_out,t," << file_name <<
"_z_lin_out,t," << file_name <<
"_x_rot_out,t," << file_name <<
"_y_rot_out,t," << file_name <<
"_z_rot_out)" << std::endl;
599 myfile <<
"c=legend('Input','x_lin_out','y_lin_out','z_lin_out','x_rot_out','y_rot_out','z_rot_out','Location','NorthEastOutside'); \n set(c,'Interpreter','none');" << std::endl;
600 myfile <<
"grid" << std::endl;
606 void OutputRecorder::writeToMFile(std::string file_name, std::vector<double>* dot_in, std::vector<double>* dot_out, std::vector<double>* pos_out, std::vector<double>* dot_integrated)
608 std::ofstream myfile;
610 std::vector <double> errVec;
611 double a1, a2, a3, b1, b2, b3 = 0.0;
612 std::ostringstream a1_str, a2_str, a3_str, b1_str, b2_str, b3_str;
615 ROS_INFO(
"Writing results to: %s", name.c_str());
616 const char* charPath = name.c_str();
618 myfile.open(charPath);
620 myfile <<
"clear all;close all;\n\n";
623 myfile << file_name <<
"_dot_in = [" << std::endl;
624 for (
int i = 0; i < dot_in->size()-1; i++)
626 myfile << dot_in->at(i) <<std::endl;
628 myfile <<
"]; \n" << std::endl;
630 myfile << file_name <<
"_dot_out = [" << std::endl;
631 for (
int i = 0; i < dot_out->size()-1; i++)
633 myfile << dot_out->at(i) <<std::endl;
635 myfile <<
"]; \n" << std::endl;
637 myfile << file_name <<
"_pos_out = [" << std::endl;
638 for (
int i = 0; i < pos_out->size()-1; i++)
640 myfile << pos_out->at(i) <<std::endl;
642 myfile <<
"]; \n" << std::endl;
644 myfile << file_name <<
"_dot_integrated = [" << std::endl;
645 for (
int i=0; i < dot_integrated->size()-1; i++)
647 myfile << dot_integrated->at(i) <<std::endl;
649 myfile <<
"]; \n" << std::endl;
651 myfile <<
"t = [" << std::endl;
652 for (
int i = 0; i <
time_vec_.size()-1; i++)
656 myfile <<
"]; \n" << std::endl;
660 myfile <<
"k = size(" <<file_name <<
"_dot_in);" << std::endl;
661 myfile <<
"t = linspace(0,k(1)*" << fabs(
dt_) <<
",size(" <<file_name <<
"_dot_in));" << std::endl;
665 myfile <<
"s = tf('s'); z=tf('z',1/50);" << std::endl;
670 a1_str.str(
""); a2_str.str(
""); a3_str.str(
""); b1_str.str(
""); b2_str.str(
""); b3_str.str(
"");
671 a1_str.clear(); a2_str.clear(); a3_str.clear(); b1_str.clear(); b2_str.clear(); b3_str.clear();
673 errVec.push_back(
calculateLS(dot_out, dot_in, 1, a1, a2, a3, b1, b2, b3));
678 std::string Gz1 =
"Gz_" + file_name +
"1=" + b1_str.str() +
"*z^-1/(1" + a1_str.str() +
"*z^-1);";
679 while (Gz1.find(
"+-") != std::string::npos)
681 Gz1.replace(Gz1.find(
"+-"), 2,
"-");
687 a1_str.str(
""); a2_str.str(
""); a3_str.str(
""); b1_str.str(
""); b2_str.str(
""); b3_str.str(
"");
688 a1_str.clear(); a2_str.clear(); a3_str.clear(); b1_str.clear(); b2_str.clear(); b3_str.clear();
690 errVec.push_back(
calculateLS(dot_out, dot_in, 2, a1, a2, a3, b1, b2, b3));
699 std::string Gz2 =
"Gz_" + file_name +
"2=(" + b1_str.str() +
"*z^-1 +" + b2_str.str() +
"*z^-2)/(1 +" + a1_str.str() +
"*z^-1 +" + a2_str.str() +
"*z^-2);";
700 while (Gz2.find(
"+-") != std::string::npos)
702 Gz2.replace(Gz2.find(
"+-"), 2,
"-");
709 a1_str.str(
""); a2_str.str(
""); a3_str.str(
""); b1_str.str(
""); b2_str.str(
""); b3_str.str(
"");
710 a1_str.clear(); a2_str.clear(); a3_str.clear(); b1_str.clear(); b2_str.clear(); b3_str.clear();
712 errVec.push_back(
calculateLS(dot_out, dot_in, 3, a1, a2, a3, b1, b2, b3));
721 std::string Gz3 =
"Gz_" + file_name +
"3=(" + b1_str.str() +
"*z^-1 +" + b2_str.str() +
"*z^-2 +" + b3_str.str() +
"*z^-3)/(1 +" + a1_str.str() +
"*z^-1 +" + a2_str.str() +
"*z^-2 +" + a3_str.str() +
"*z^-3);";
722 while (Gz3.find(
"+-") != std::string::npos)
724 Gz3.replace(Gz3.find(
"+-"), 2,
"-");
730 myfile <<
"e =[" << errVec.at(0) <<
"," << errVec.at(1) <<
"," << errVec.at(2) <<
"];" << std::endl;
731 myfile <<
"figure; semilogy(e); grid;" << std::endl;
734 for (
int i = 0; i < dot_in->size()-1; i++)
738 step/=(dot_in->size()-1);
739 std::cout <<
"step = " << step <<std::endl;
741 int length =
static_cast<int>(pos_out->size()*2/3) - static_cast<int>(pos_out->size()/3);
742 double Ki = (pos_out->at(static_cast<int>(pos_out->size()*2/3)) - pos_out->at(static_cast<int>(pos_out->size()/3)))/(length *
dt_) / step;
744 ROS_INFO(
"length: %i dY: %f Ki: %f", length, (pos_out->at(static_cast<int>(pos_out->size()*2/3)) - pos_out->at(static_cast<int>(pos_out->size()/3))), Ki);
747 myfile <<
"Gz_" << file_name <<
"1 = minreal(Gz_" << file_name <<
"1);" << std::endl;
748 myfile <<
"Gs_" << file_name <<
"1=d2c(Gz_" << file_name <<
"1,'matched');" << std::endl;
750 myfile <<
"Gs_" << file_name <<
"_integrated1 = Gs_" << file_name <<
"1* (1/s);" << std::endl;
751 myfile <<
"Gs_" << file_name <<
"_out1 = lsim(Gs_" << file_name <<
"1," << file_name <<
"_dot_in,t);" << std::endl;
752 myfile <<
"Gs_" << file_name <<
"_out_integrated1 = lsim(Gs_" << file_name <<
"_integrated1," << file_name <<
"_dot_in,t);" << std::endl;
755 myfile <<
"figure" << std::endl;
756 myfile <<
"subplot(2,1,1);" << std::endl;
757 myfile <<
"plot(t," << file_name <<
"_dot_in,t," << file_name <<
"_dot_out,t,Gs_" << file_name <<
"_out1)" << std::endl;
758 myfile <<
"c=legend('Velocity Input','Velocity Systemresponse','PT1 Modelresponse','Location','NorthEastOutside'); \n set(c,'Interpreter','none');" << std::endl;
759 myfile <<
"title('" << file_name <<
" Velocity Stepresponse','interpreter','none')" << std::endl;
760 myfile <<
"grid" << std::endl;
761 myfile <<
"subplot(2,1,2);" << std::endl;
762 myfile <<
"plot(t," << file_name <<
"_dot_in,t," << file_name <<
"_dot_integrated,t,Gs_" << file_name <<
"_out_integrated1)" << std::endl;
763 myfile <<
"c=legend('Velocity Input','Position Systemresponse','IT1 Modelresponse','Location','NorthEastOutside'); \n set(c,'Interpreter','none');" << std::endl;
764 myfile <<
"title('" << file_name <<
" Position Stepresponse','interpreter','none')" << std::endl;
765 myfile <<
"grid" << std::endl;
768 myfile <<
"Gz_" << file_name <<
"2 = minreal(Gz_" << file_name <<
"2);"<< std::endl;
769 myfile <<
"Gs_" << file_name <<
"2=d2c(Gz_" << file_name <<
"2,'matched');" << std::endl;
771 myfile <<
"Gs_" << file_name <<
"_integrated2 = Gs_" << file_name <<
"2*(1/s);" << std::endl;
772 myfile <<
"Gs_" << file_name <<
"_out2 = lsim(Gs_" << file_name <<
"2," << file_name <<
"_dot_in,t);" << std::endl;
773 myfile <<
"Gs_" << file_name <<
"_out_integrated2 = lsim(Gs_" << file_name <<
"_integrated2," << file_name <<
"_dot_in,t);" << std::endl;
776 myfile <<
"figure" << std::endl;
777 myfile <<
"subplot(2,1,1);" << std::endl;
778 myfile <<
"plot(t," << file_name <<
"_dot_in,t," << file_name <<
"_dot_out,t,Gs_" << file_name <<
"_out2)" << std::endl;
779 myfile <<
"c=legend('Velocity Input','Velocity Systemresponse','PDT2 Modelresponse','Location','NorthEastOutside'); \n set(c,'Interpreter','none');" << std::endl;
780 myfile <<
"title('" << file_name <<
" Velocity Stepresponse','interpreter','none')" << std::endl;
781 myfile <<
"grid" << std::endl;
782 myfile <<
"subplot(2,1,2);" << std::endl;
783 myfile <<
"plot(t," << file_name <<
"_dot_in,t," << file_name <<
"_dot_integrated,t,Gs_" << file_name <<
"_out_integrated2)" << std::endl;
784 myfile <<
"c=legend('Velocity Input','Position Systemresponse','PIDT2 Modelresponse','Location','NorthEastOutside'); \n set(c,'Interpreter','none');" << std::endl;
785 myfile <<
"title('" << file_name <<
" Position Stepresponse','interpreter','none')" << std::endl;
786 myfile <<
"grid" << std::endl;
789 myfile <<
"Gz_" << file_name <<
"3 = minreal(Gz_" << file_name <<
"3);" << std::endl;
790 myfile <<
"Gs_" << file_name <<
"3=d2c(Gz_" << file_name <<
"3,'matched');" << std::endl;
792 myfile <<
"Gs_" << file_name <<
"_integrated3 = Gs_" << file_name <<
"3*(1/s);" << std::endl;
793 myfile <<
"Gs_" << file_name <<
"_out3 = lsim(Gs_" << file_name <<
"3," << file_name <<
"_dot_in,t);" << std::endl;
794 myfile <<
"Gs_" << file_name <<
"_out_integrated3 = lsim(Gs_" << file_name <<
"_integrated3," << file_name <<
"_dot_in,t);" << std::endl;
797 myfile <<
"figure" << std::endl;
798 myfile <<
"subplot(2,1,1);" << std::endl;
799 myfile <<
"plot(t," << file_name <<
"_dot_in,t," << file_name <<
"_dot_out,t,Gs_" << file_name <<
"_out3)" << std::endl;
800 myfile <<
"c=legend('Velocity Input','Velocity Systemresponse','PD2T3 Modelresponse','Location','NorthEastOutside'); \n set(c,'Interpreter','none');" << std::endl;
801 myfile <<
"title('" << file_name <<
" Velocity Stepresponse','interpreter','none')" << std::endl;
802 myfile <<
"grid" << std::endl;
803 myfile <<
"subplot(2,1,2);" << std::endl;
804 myfile <<
"plot(t," << file_name <<
"_dot_in,t," << file_name <<
"_dot_integrated,t,Gs_" << file_name <<
"_out_integrated3)" << std::endl;
805 myfile <<
"c=legend('Velocity Input','Position Systemresponse','PID2T3 Modelresponse','Location','NorthEastOutside'); \n set(c,'Interpreter','none');" << std::endl;
806 myfile <<
"title('" << file_name <<
" Position Stepresponse','interpreter','none')" << std::endl;
807 myfile <<
"grid" << std::endl;
std::vector< double > x_dot_lin_vec_out_
Outputs.
std::vector< double > z_dot_lin_vec_in_
void jointstateCallback(const sensor_msgs::JointState::ConstPtr &msg)
std::vector< double > x_dot_rot_vec_out_
std::vector< double > y_dot_lin_vec_out_
KDL::ChainFkSolverVel_recursive * jntToCartSolver_vel_
std::vector< double > z_dot_rot_vec_out_
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
void pseudoInverse(const Eigen::MatrixXd &matrix, Eigen::MatrixXd &matrix_inv, double tolerance)
ros::Subscriber twist_sub_
void writeToMFile(std::string file_name, std::vector< double > *dot_in, std::vector< double > *dot_out, std::vector< double > *pos_out, std::vector< double > *dot_integrated)
IMETHOD Twist GetTwist() const
tf::TransformListener listener_
Transform Listener.
std::vector< double > x_lin_vec_out_
std::vector< double > x_dot_lin_vec_in_
Inputs.
std::vector< double > time_vec_
std::vector< double > z_dot_rot_vec_in_
std::vector< double > y_dot_rot_vec_in_
TFSIMD_FORCE_INLINE const tfScalar & y() const
void twistCallback(const geometry_msgs::TwistStamped::ConstPtr &msg)
std::vector< double > y_dot_rot_vec_out_
KDL::JntArray last_q_dot_
TFSIMD_FORCE_INLINE const tfScalar & x() const
std::vector< double > x_dot_rot_vec_in_
std::vector< double > z_lin_vec_out_
std::vector< double > z_dot_lin_vec_out_
TFSIMD_FORCE_INLINE const tfScalar & z() const
void getRPY(tfScalar &roll, tfScalar &pitch, tfScalar &yaw, unsigned int solution_number=1) const
std::vector< double > y_rot_vec_out_
std::vector< double > x_rot_vec_out_
TFSIMD_FORCE_INLINE const tfScalar & y() const
ros::Subscriber jointstate_sub_
unsigned int getNrOfJoints() const
geometry_msgs::Pose getEndeffectorPose()
double calculateLS(std::vector< double > *vec_out, std::vector< double > *vec_in, int model_order, double &a1, double &a2, double &a3, double &b1, double &b2, double &b3)
std::vector< double > z_rot_vec_out_
KDL::Chain chain_
KDL Conversion.
INLINE Rall1d< T, V, S > pow(const Rall1d< T, V, S > &arg, double m)
struct termios cooked raw
void euler(std::vector< double > *out, double in, double dt)
bool getChain(const std::string &chain_root, const std::string &chain_tip, Chain &chain) const
virtual int JntToCart(const JntArrayVel &q_in, FrameVel &out, int segmentNr=-1)
KDL_PARSER_PUBLIC bool treeFromParam(const std::string ¶m, KDL::Tree &tree)
char c
For Keyboard commands.
bool getParam(const std::string &key, std::string &s) const
void stepResponsePlot(std::string file_name, std::vector< double > *in, std::vector< double > *x_lin_out, std::vector< double > *y_lin_out, std::vector< double > *z_lin_out, std::vector< double > *x_rot_out, std::vector< double > *y_rot_out, std::vector< double > *z_rot_out)
std::string chain_base_link_
TFSIMD_FORCE_INLINE tfScalar length(const Quaternion &q)
std::string output_file_path_
bool hasParam(const std::string &key) const
std::vector< double > y_dot_lin_vec_in_
ROSCPP_DECL void spinOnce()
double dt_
Euler Integration.
std::vector< std::string > joints_
std::string chain_tip_link_
std::vector< double > y_lin_vec_out_
void fillDataVectors(double x_dot_lin_in, double x_dot_lin_out, double y_dot_lin_in, double y_dot_lin_out, double z_dot_lin_in, double z_dot_lin_out, double x_dot_rot_in, double x_dot_rot_out, double y_dot_rot_in, double y_dot_rot_out, double z_dot_rot_in, double z_dot_rot_out, double x_lin_out, double y_lin_out, double z_lin_out, double x_rot_out, double y_rot_out, double z_rot_out)