1 #ifndef state_estimator_h
2 #define state_estimator_h
5 #include "ros/console.h"
6 #include "std_msgs/Float64MultiArray.h"
7 #include "geometry_msgs/Twist.h"
11 #include <bits/stdc++.h>
15 public:
StateEstimator(
double gait_period,
double controller_frequency);
23 private: Eigen::Matrix<double, 3, 1>
_attitude = Eigen::Matrix<double, 3, 1>::Zero();
25 private: Eigen::Matrix<double, 3, 1>
_lin_vel_body = Eigen::Matrix<double, 3, 1>::Zero();
27 private: Eigen::Matrix<double, 3, 1>
_ang_vel = Eigen::Matrix<double, 3, 1>::Zero();
29 private: Eigen::Matrix<double, 3, 1>
_lin_vel_world = Eigen::Matrix<double, 3, 1>::Zero();
47 private: std::string
_node_name =
"state_estimation_node";
ros::Subscriber _generalized_position_subscriber
Eigen::Matrix< double, 3, 1 > _attitude
std::vector< double > _ang_vel_body_z_history
std::vector< double > _lin_vel_body_y_history
double _avg_ang_gait_vel_z
Eigen::Matrix< double, 3, 1 > _lin_vel_body
double _avg_lin_gait_vel_y
ros::Publisher _body_twist_state_publisher
ros::Subscriber _generalized_velocity_subscriber
StateEstimator(double gait_period, double controller_frequency)
int number_of_gait_iterations
Eigen::Matrix< double, 3, 1 > _lin_vel_world
std::vector< double > _lin_vel_body_x_history
void GeneralizedPositionCallback(const std_msgs::Float64MultiArrayConstPtr &msg)
void PublishBodyTwistState()
void GeneralizedVelocityCallback(const std_msgs::Float64MultiArrayConstPtr &msg)
double _avg_lin_gait_vel_x
ros::NodeHandlePtr _node_handle
Eigen::Matrix< double, 3, 1 > _ang_vel