image_display_base.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2012, Willow Garage, Inc.
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions are met:
00007  *
00008  *     * Redistributions of source code must retain the above copyright
00009  *       notice, this list of conditions and the following disclaimer.
00010  *     * Redistributions in binary form must reproduce the above copyright
00011  *       notice, this list of conditions and the following disclaimer in the
00012  *       documentation and/or other materials provided with the distribution.
00013  *     * Neither the name of the Willow Garage, Inc. nor the names of its
00014  *       contributors may be used to endorse or promote products derived from
00015  *       this software without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00018  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00020  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00021  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00022  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00023  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00024  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00025  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00026  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00027  * POSSIBILITY OF SUCH DAMAGE.
00028  */
00029 #ifndef IMAGE_DISPLAY_BASE_H
00030 #define IMAGE_DISPLAY_BASE_H
00031 
00032 #include <QObject>
00033 
00034 #ifndef Q_MOC_RUN  // See: https://bugreports.qt-project.org/browse/QTBUG-22829
00035 # include <message_filters/subscriber.h>
00036 # include <tf/message_filter.h>
00037 # include <sensor_msgs/Image.h>
00038 
00039 # include <image_transport/image_transport.h>
00040 # include <image_transport/subscriber_filter.h>
00041 
00042 # include "rviz/display_context.h"
00043 # include "rviz/frame_manager.h"
00044 # include "rviz/properties/ros_topic_property.h"
00045 # include "rviz/properties/enum_property.h"
00046 # include "rviz/properties/int_property.h"
00047 
00048 # include "rviz/display.h"
00049 #endif
00050 
00051 namespace rviz
00052 {
00060 class ImageDisplayBase : public Display
00061 {
00062 Q_OBJECT
00063 public:
00064 
00066   ImageDisplayBase();
00067   virtual ~ImageDisplayBase();
00068 
00069   virtual void setTopic( const QString &topic, const QString &datatype );
00070 
00071 protected Q_SLOTS:
00073   virtual void updateTopic();
00074 
00076   virtual void updateQueueSize();
00077 
00079   void fillTransportOptionList(EnumProperty* property);
00080 
00081 protected:
00082   virtual void onInitialize();
00083 
00085   virtual void reset();
00086 
00088   void enableTFFilter(std::string& targetFrame)
00089   {
00090     targetFrame_ = targetFrame;
00091     reset();
00092   }
00093 
00095   virtual void subscribe();
00096   virtual void unsubscribe();
00097 
00098   virtual void fixedFrameChanged();
00099 
00103   void incomingMessage(const sensor_msgs::Image::ConstPtr& msg);
00104 
00108   virtual void processMessage(const sensor_msgs::Image::ConstPtr& msg) = 0;
00109 
00110   void scanForTransportSubscriberPlugins();
00111 
00112   boost::scoped_ptr<image_transport::ImageTransport> it_;
00113   boost::shared_ptr<image_transport::SubscriberFilter> sub_;
00114   boost::shared_ptr<tf::MessageFilter<sensor_msgs::Image> > tf_filter_;
00115 
00116   std::string targetFrame_;
00117 
00118   uint32_t messages_received_;
00119 
00120   RosTopicProperty* topic_property_;
00121   EnumProperty* transport_property_;
00122   IntProperty* queue_size_property_;
00123 
00124   std::string transport_;
00125 
00126   std::set<std::string> transport_plugin_types_;
00127 
00128   BoolProperty* unreliable_property_;
00129 };
00130 
00131 } // end namespace rviz
00132 
00133 #endif // IMAGE_DISPLAY_BASE_H


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Tue Oct 3 2017 03:19:30