00001 #ifndef STATE_PUBLISHER_ROSTOPIC_H 00002 #define STATE_PUBLISHER_ROSTOPIC_H 00003 00004 #include <QObject> 00005 #include <QtPlugin> 00006 #include <map> 00007 #include <ros/ros.h> 00008 #include "PlotJuggler/statepublisher_base.h" 00009 00010 00011 class TopicPublisherROS: public QObject, StatePublisher 00012 { 00013 Q_OBJECT 00014 Q_PLUGIN_METADATA(IID "com.icarustechnology.PlotJuggler.StatePublisher" "../statepublisher.json") 00015 Q_INTERFACES(StatePublisher) 00016 00017 public: 00018 TopicPublisherROS(); 00019 virtual ~TopicPublisherROS(); 00020 00021 virtual void updateState(PlotDataMap* datamap, double current_time) override; 00022 virtual const char* name() const override { return "TopicPublisherROS"; } 00023 00024 virtual bool enabled() const override { return enabled_; } 00025 00026 void setParentMenu(QMenu *menu); 00027 00028 public slots: 00029 virtual void setEnabled(bool enabled) override; 00030 00031 private: 00032 std::map<std::string, ros::Publisher> publishers_; 00033 bool enabled_; 00034 ros::NodeHandlePtr _node; 00035 00036 QAction* _current_time; 00037 }; 00038 00039 #endif // DATALOAD_CSV_H