00001 #ifndef Listener_H 00002 #define Listener_H 00003 00004 #include <ros/ros.h> 00005 #include <std_msgs/String.h> 00006 #include <std_msgs/Float64.h> 00007 #include <std_msgs/UInt8.h> 00008 #include <sensor_msgs/Imu.h> 00009 00010 #include "door_detection_messages/Door.h" 00011 #include "door_detection_messages/DoorHandle.h" 00012 00013 #include <QObject> 00014 #include <QString> 00015 00016 namespace Ui { 00017 class MainWindow; 00018 } 00019 00020 namespace cv { 00021 class Mat; 00022 } 00023 00024 class QImage; 00025 00026 class Listener : public QObject { 00027 00028 Q_OBJECT 00029 00030 public: 00031 00032 Listener(ros::NodeHandle nh); 00033 00034 float getTiltAngle() const {return m_TiltAngle;} 00035 float getTiltStatus() const {return m_TiltStatus;} 00036 geometry_msgs::Vector3& getImu() const {return m_Imu;} 00037 00038 private: 00039 00040 void curTiltAngleCallback(const std_msgs::Float64 msg); 00041 void curTiltStatusCallback(const std_msgs::UInt8 msg); 00042 void imuCallback(const sensor_msgs::ImuConstPtr& msg); 00043 00044 ros::Subscriber m_CurTiltAngleSubscriber; 00045 ros::Subscriber m_CurTiltStatusSubscriber; 00046 00047 float m_TiltAngle; 00048 int m_TiltStatus; 00049 00050 geometry_msgs::Vector3 m_Imu; 00051 00052 }; 00053 00054 #endif