00001 00008 /***************************************************************************** 00009 ** Ifdefs 00010 *****************************************************************************/ 00011 00012 #ifndef drc_gui_QNODE_HPP_ 00013 #define drc_gui_QNODE_HPP_ 00014 00015 /***************************************************************************** 00016 ** Includes 00017 *****************************************************************************/ 00018 00019 #include <ros/ros.h> 00020 #include <string> 00021 #include <QThread> 00022 #include <QStringListModel> 00023 00024 #include <tf/transform_listener.h> 00025 #include <drc_gui/ObjectsStamped.h> 00026 #include <drc_gui/SendPos.h> 00027 00028 #include <move_base_msgs/MoveBaseAction.h> 00029 #include <actionlib/client/simple_action_client.h> 00030 00031 /***************************************************************************** 00032 ** Namespaces 00033 *****************************************************************************/ 00034 00035 namespace drc_gui { 00036 00037 typedef actionlib::SimpleActionClient<move_base_msgs::MoveBaseAction> MoveBaseClient; 00038 00039 /***************************************************************************** 00040 ** Class 00041 *****************************************************************************/ 00042 00043 class QNode : public QThread { 00044 Q_OBJECT 00045 public: 00046 QNode(int argc, char** argv ); 00047 virtual ~QNode(); 00048 bool init(); 00049 void run(); 00050 00051 MoveBaseClient *ac; 00052 00053 00054 float global_ori[4]; 00055 float global_pos[3]; 00056 float camera_ori[4]; 00057 float camera_pos[3]; 00058 00059 00060 std::string mapFrameId; 00061 std::string objectFramePrefix; 00062 00063 tf::TransformListener tfListener; 00064 00065 ros::Subscriber sub_object_tf; 00066 ros::Publisher pub_object_pos; 00067 00068 void publishPos(); 00069 void callback_object_tf(const ObjectsStampedConstPtr &msg); 00070 00071 00072 Q_SIGNALS: 00073 void rosShutdown(); 00074 void sig_new_object_tf(); 00075 00076 private: 00077 int init_argc; 00078 char** init_argv; 00079 ros::Publisher chatter_publisher; 00080 }; 00081 00082 } // namespace drc_gui 00083 00084 #endif /* drc_gui_QNODE_HPP_ */