00001 #ifndef ARTICULATION_RVIZ_PLUGIN_PLANNING_DISPLAY_H
00002 #define ARTICULATION_RVIZ_PLUGIN_PLANNING_DISPLAY_H
00003
00004 #include "rviz/display.h"
00005 #include "rviz/properties/forwards.h"
00006
00007 #include "articulation_models/TrackMsg.h"
00008
00009 #include <ros/ros.h>
00010
00011 #include <map>
00012
00013 namespace Ogre
00014 {
00015 class Entity;
00016 class SceneNode;
00017 }
00018
00019 namespace articulation_rviz_plugin
00020 {
00021
00026 class TrackDisplay : public rviz::Display
00027 {
00028 public:
00029 TrackDisplay( const std::string& name, rviz::VisualizationManager* manager );
00030 virtual ~TrackDisplay();
00031
00032 void setTopic( const std::string& topic );
00033 const std::string& getTopic() { return track_topic_; }
00034
00035 virtual void update(float wall_dt, float ros_dt);
00036
00037
00038 virtual void targetFrameChanged();
00039 virtual void fixedFrameChanged() {}
00040 virtual void createProperties();
00041
00042
00043 protected:
00044 void subscribe();
00045 void unsubscribe();
00046
00047 void incomingTrack(const articulation_models::TrackMsg::ConstPtr& msg);
00048
00049
00050 virtual void onEnable();
00051 virtual void onDisable();
00052
00053 ros::Subscriber sub_;
00054 std::string track_topic_;
00055 articulation_models::TrackMsg::ConstPtr incoming_track_message_;
00056 articulation_models::TrackMsg::ConstPtr displaying_track_message_;
00057
00058 rviz::ROSTopicStringPropertyWPtr topic_property_;
00059 };
00060
00061 }
00062
00063 #endif
00064
00065