Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef GRAFT_INCLUDE_GRAFT_GRAFT_IMU_TOPIC_H
00035 #define GRAFT_INCLUDE_GRAFT_GRAFT_IMU_TOPIC_H
00036
00037 #include <graft/GraftSensor.h>
00038 #include <ros/ros.h>
00039 #include <Eigen/Dense>
00040 #include <sensor_msgs/Imu.h>
00041 #include <tf/transform_datatypes.h>
00042 #include <numeric>
00043
00044 using namespace Eigen;
00045
00046 class GraftImuTopic: public GraftSensor
00047 {
00048 public:
00049 GraftImuTopic();
00050
00051 ~GraftImuTopic();
00052
00053 void callback(const sensor_msgs::Imu::ConstPtr& msg);
00054
00055 virtual graft::GraftSensorResidual::Ptr h(const graft::GraftState& state);
00056
00057 virtual graft::GraftSensorResidual::Ptr z();
00058
00059 virtual void setName(const std::string& name);
00060
00061 virtual std::string getName();
00062
00063 virtual void clearMessage();
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 void useDeltaOrientation(bool delta_orientation);
00074
00075
00076
00077
00078
00079 void setTimeout(double timeout);
00080
00081 void setOrientationCovariance(boost::array<double, 9>& cov);
00082
00083 void setAngularVelocityCovariance(boost::array<double, 9>& cov);
00084
00085 void setLinearAccelerationCovariance(boost::array<double, 9>& cov);
00086
00087 private:
00088
00089 sensor_msgs::Imu::ConstPtr getMsg();
00090
00091 ros::Subscriber sub_;
00092 sensor_msgs::Imu::ConstPtr msg_;
00093 sensor_msgs::Imu::ConstPtr last_msg_;
00094
00095 std::string name_;
00096 bool absolute_orientation_;
00097 bool delta_orientation_;
00098 bool use_velocities_;
00099 bool use_accelerations_;
00100 ros::Duration timeout_;
00101
00102 boost::array<double, 9> orientation_covariance_;
00103 boost::array<double, 9> angular_velocity_covariance_;
00104 boost::array<double, 9> linear_acceleration_covariance_;
00105 };
00106
00107 #endif // GRAFT_INCLUDE_GRAFT_GRAFT_IMU_TOPIC_H