00001 #ifndef CANCEL_ACTION_H 00002 #define CANCEL_ACTION_H 00003 00004 #ifndef Q_MOC_RUN 00005 #include <ros/ros.h> 00006 00007 #include <rviz/panel.h> 00008 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) 00009 # include <QtWidgets> 00010 #else 00011 # include <QtGui> 00012 #endif 00013 #endif 00014 00015 class QLineEdit; 00016 class QLabel; 00017 class QPushButton; 00018 //class QSignalMapper; 00019 00020 namespace jsk_rviz_plugins 00021 { 00022 class CancelAction: public rviz::Panel 00023 { 00024 // This class uses Qt slots and is a subclass of QObject, so it needs 00025 // the Q_OBJECT macro. 00026 Q_OBJECT 00027 public: 00028 CancelAction( QWidget* parent = 0 ); 00029 00030 00031 virtual void load( const rviz::Config& config ); 00032 virtual void save( rviz::Config config ) const; 00033 00034 public Q_SLOTS: 00035 00036 void setTopic( const QString& topic ) {}; 00037 00038 protected Q_SLOTS: 00039 00040 void updateTopic() {}; 00041 00042 void sendTopic(); 00043 void addTopic(); 00044 void initComboBox(); 00045 00046 void addTopicList(std::string topic_name); 00047 00048 void OnClickDeleteButton(int id); 00049 00050 protected: 00051 QString output_topic_; 00052 00053 QPushButton* add_topic_button_; 00054 00055 QComboBox* add_topic_box_; 00056 00057 QPushButton* send_topic_button_; 00058 00059 QSignalMapper *m_sigmap; 00060 00061 QVBoxLayout* layout; 00062 00063 struct topicListLayout{ 00064 int id; 00065 QHBoxLayout* layout_; 00066 QPushButton* remove_button_; 00067 QLabel* topic_name_; 00068 ros::Publisher publisher_; 00069 }; 00070 00071 std::vector<topicListLayout> topic_list_layouts_; 00072 00073 // The ROS publisher for the command velocity. 00074 ros::Publisher velocity_publisher_; 00075 00076 // The ROS node handle. 00077 ros::NodeHandle nh_; 00078 00079 }; 00080 00081 } 00082 00083 #endif // TELEOP_PANEL_H