29 #ifndef MESSAGE_FILTER_DISPLAY_H 30 #define MESSAGE_FILTER_DISPLAY_H 33 #include <OgreSceneManager.h> 34 #include <OgreSceneNode.h> 62 "Prefer UDP topic transport",
81 template<
class MessageType>
92 , messages_received_( 0 )
94 QString message_type = QString::fromStdString( ros::message_traits::datatype<MessageType>() );
119 messages_received_ = 0;
122 virtual void setTopic(
const QString &topic,
const QString &datatype )
178 tf_filter_->setTargetFrame(
fixed_frame_.toStdString() );
192 ++messages_received_;
195 processMessage( msg );
201 virtual void processMessage(
const typename MessageType::ConstPtr& msg ) = 0;
210 #endif // MESSAGE_FILTER_DISPLAY_H
virtual void setTopic(const QString &topic, const QString &datatype)
Set the ROS topic to listen to for this display.
virtual void setString(const QString &str)
TransportHints & reliable()
virtual void onInitialize()
Override this function to do subclass-specific initialization.
virtual tf::TransformListener * getTFClient() const =0
Convenience function: returns getFrameManager()->getTFClient().
DisplayContext * context_
This DisplayContext pointer is the main connection a Display has into the rest of rviz...
MessageFilterDisplay< MessageType > MFDClass
Convenience typedef so subclasses don't have to use the long templated class name to refer to their s...
ros::NodeHandle update_nh_
A NodeHandle whose CallbackQueue is run from the main GUI thread (the "update" thread).
RosTopicProperty * topic_property_
virtual void updateTopic()=0
tf::MessageFilter< MessageType > * tf_filter_
virtual void reset()
Called to tell the display to clear its state.
virtual void setDescription(const QString &description)
Set the description.
virtual void unsubscribe()
bool isEnabled() const
Return true if this Display is enabled, false if not.
void setMessageType(const QString &message_type)
virtual bool getBool() const
QString fixed_frame_
A convenience variable equal to context_->getFixedFrame().
virtual void onEnable()
Derived classes override this to do the actual work of enabling themselves.
TransportHints & unreliable()
virtual ~MessageFilterDisplay()
Display subclass using a tf::MessageFilter, templated on the ROS message type.
virtual void reset()
Called to tell the display to clear its state.
void registerFilterForTransformStatusCheck(tf::MessageFilter< M > *filter, Display *display)
Connect a tf::MessageFilter's callbacks to success and failure handler functions in this FrameManager...
virtual void onDisable()
Derived classes override this to do the actual work of disabling themselves.
virtual FrameManager * getFrameManager() const =0
Return the FrameManager instance.
virtual void fixedFrameChanged()
Called by setFixedFrame(). Override to respond to changes to fixed_frame_.
BoolProperty * unreliable_property_
uint32_t messages_received_
virtual void queueRender()=0
Queues a render. Multiple calls before a render happens will only cause a single render.
Property specialized to provide getter for booleans.
void incomingMessage(const typename MessageType::ConstPtr &msg)
Incoming message callback. Checks if the message pointer is valid, increments messages_received_, then calls processMessage().
message_filters::Subscriber< MessageType > sub_
virtual void updateTopic()
std::string getTopicStd() const
BoolProperty(const QString &name=QString(), bool default_value=false, const QString &description=QString(), Property *parent=0, const char *changed_slot=0, QObject *receiver=0)
virtual void setStatus(StatusProperty::Level level, const QString &name, const QString &text)
Show status level and text. This is thread-safe.
Helper superclass for MessageFilterDisplay, needed because Qt's moc and c++ templates don't work nice...