image_display_base.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012, Willow Garage, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Willow Garage, Inc. nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 #ifndef IMAGE_DISPLAY_BASE_H
30 #define IMAGE_DISPLAY_BASE_H
31 
32 #include <QObject>
33 
34 #ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829
36 # include <tf/message_filter.h>
37 # include <sensor_msgs/Image.h>
38 
41 
42 # include "rviz/display_context.h"
43 # include "rviz/frame_manager.h"
47 
48 # include "rviz/display.h"
49 #endif
50 
51 namespace rviz
52 {
60 class ImageDisplayBase : public Display
61 {
62 Q_OBJECT
63 public:
64 
67  virtual ~ImageDisplayBase();
68 
69  virtual void setTopic( const QString &topic, const QString &datatype );
70 
71 protected Q_SLOTS:
73  virtual void updateTopic();
74 
76  virtual void updateQueueSize();
77 
79  void fillTransportOptionList(EnumProperty* property);
80 
81 protected:
82  virtual void onInitialize();
83 
85  virtual void reset();
86 
88  void enableTFFilter(std::string& targetFrame)
89  {
90  targetFrame_ = targetFrame;
91  reset();
92  }
93 
95  virtual void subscribe();
96  virtual void unsubscribe();
97 
98  virtual void fixedFrameChanged();
99 
103  void incomingMessage(const sensor_msgs::Image::ConstPtr& msg);
104 
108  virtual void processMessage(const sensor_msgs::Image::ConstPtr& msg) = 0;
109 
111 
112  boost::scoped_ptr<image_transport::ImageTransport> it_;
115 
116  std::string targetFrame_;
117 
119 
123 
124  std::string transport_;
125 
126  std::set<std::string> transport_plugin_types_;
127 
129 };
130 
131 } // end namespace rviz
132 
133 #endif // IMAGE_DISPLAY_BASE_H
void fillTransportOptionList(EnumProperty *property)
Fill list of available and working transport options.
Property specialized to provide max/min enforcement for integers.
Definition: int_property.h:38
virtual void fixedFrameChanged()
Called by setFixedFrame(). Override to respond to changes to fixed_frame_.
BoolProperty * unreliable_property_
virtual void processMessage(const sensor_msgs::Image::ConstPtr &msg)=0
Implement this to process the contents of a message.
IntProperty * queue_size_property_
virtual void subscribe()
ROS topic management.
Display subclass for subscribing and displaying to image messages.
void enableTFFilter(std::string &targetFrame)
Enabling TF filtering by defining a target frame.
virtual void updateQueueSize()
Update queue size of tf filter.
virtual void onInitialize()
Override this function to do subclass-specific initialization.
virtual void reset()
Reset display.
EnumProperty * transport_property_
RosTopicProperty * topic_property_
virtual void updateTopic()
Update topic and resubscribe.
Property specialized to provide getter for booleans.
Definition: bool_property.h:38
boost::shared_ptr< tf::MessageFilter< sensor_msgs::Image > > tf_filter_
std::set< std::string > transport_plugin_types_
void incomingMessage(const sensor_msgs::Image::ConstPtr &msg)
Incoming message callback. Checks if the message pointer is valid, increments messages_received_, then calls processMessage().
boost::shared_ptr< image_transport::SubscriberFilter > sub_
Enum property.
Definition: enum_property.h:47
boost::scoped_ptr< image_transport::ImageTransport > it_
virtual void setTopic(const QString &topic, const QString &datatype)
Set the ROS topic to listen to for this display.


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Wed Aug 28 2019 04:01:51