18 #ifndef OUTPUT_RECORDER_H 19 #define OUTPUT_RECORDER_H 28 #include <std_srvs/Empty.h> 29 #include <geometry_msgs/Pose.h> 30 #include <geometry_msgs/Twist.h> 31 #include <sensor_msgs/JointState.h> 36 #include <Eigen/Dense> 40 #include <kdl/chainiksolvervel_pinv.hpp> 41 #include <kdl/chainfksolvervel_recursive.hpp> 42 #include <kdl/frames.hpp> 43 #include <kdl/framevel.hpp> 44 #include <kdl/jntarray.hpp> 45 #include <kdl/jntarrayvel.hpp> 47 #include <boost/thread.hpp> 59 void twistCallback(
const geometry_msgs::TwistStamped::ConstPtr& msg);
63 double calculateLS(std::vector<double>* vec_out, std::vector<double>* vec_in,
int model_order,
64 double& a1,
double& a2,
double& a3,
65 double& b1,
double& b2,
double& b3);
66 void pseudoInverse(
const Eigen::MatrixXd& matrix, Eigen::MatrixXd& matrix_inv,
double tolerance);
67 void euler(std::vector<double>* out,
double in,
double dt);
69 double y_dot_lin_in,
double y_dot_lin_out,
70 double z_dot_lin_in,
double z_dot_lin_out,
71 double x_dot_rot_in,
double x_dot_rot_out,
72 double y_dot_rot_in,
double y_dot_rot_out,
73 double z_dot_rot_in,
double z_dot_rot_out,
74 double x_lin_out,
double y_lin_out,
double z_lin_out,
double x_rot_out,
double y_rot_out,
double z_rot_out);
76 std::vector<double>* x_lin_out, std::vector<double>* y_lin_out, std::vector<double>* z_lin_out,
77 std::vector<double>* x_rot_out, std::vector<double>* y_rot_out, std::vector<double>* z_rot_out);
78 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);
127 struct termios cooked,
raw;
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_
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)
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_
void twistCallback(const geometry_msgs::TwistStamped::ConstPtr &msg)
std::vector< double > y_dot_rot_vec_out_
KDL::JntArray last_q_dot_
std::vector< double > x_dot_rot_vec_in_
std::vector< double > z_lin_vec_out_
std::vector< double > z_dot_lin_vec_out_
std::vector< double > y_rot_vec_out_
std::vector< double > x_rot_vec_out_
ros::Subscriber jointstate_sub_
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.
struct termios cooked raw
void euler(std::vector< double > *out, double in, double dt)
char c
For Keyboard commands.
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_
std::string output_file_path_
std::vector< double > y_dot_lin_vec_in_
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)