Go to the documentation of this file.
29 #ifndef MESSAGE_FILTER_DISPLAY_H
30 #define MESSAGE_FILTER_DISPLAY_H
43 #include <rviz/rviz_export.h>
59 unreliable_property_ =
new BoolProperty(
"Unreliable",
false,
"Prefer UDP topic transport",
this,
61 queue_size_property_ =
63 "Size of TF message filter queue.\n"
64 "Increasing this is useful if your TF data is delayed significantly "
65 "w.r.t. your data, but it can greatly increase memory usage as well.",
67 queue_size_property_->setMin(0);
68 qRegisterMetaType<boost::shared_ptr<const void>>();
72 virtual void updateTopic() = 0;
73 virtual void updateQueueSize() = 0;
89 template <
class MessageType>
100 QString message_type = QString::fromStdString(ros::message_traits::datatype<MessageType>());
132 void setTopic(
const QString& topic,
const QString& )
override
209 QMetaObject::invokeMethod(
this,
"processTypeErasedMessage", Qt::QueuedConnection,
211 boost::static_pointer_cast<const void>(msg)));
219 auto msg = boost::static_pointer_cast<const MessageType>(type_erased_msg);
229 virtual void processMessage(
const typename MessageType::ConstPtr& msg) = 0;
238 #endif // MESSAGE_FILTER_DISPLAY_H
TransportHints & unreliable()
virtual bool getBool() const
bool isEnabled() const
Return true if this Display is enabled, false if not.
Display subclass using a tf2_ros::MessageFilter, templated on the ROS message type.
void reset() override
Called to tell the display to clear its state.
virtual void queueRender()=0
Queues a render. Multiple calls before a render happens will only cause a single render.
virtual void unsubscribe()
void updateQueueSize() override
void fixedFrameChanged() override
Called by setFixedFrame(). Override to respond to changes to fixed_frame_.
Helper superclass for MessageFilterDisplay, needed because Qt's moc and c++ templates don't work nice...
void incomingMessage(const typename MessageType::ConstPtr &msg)
Incoming message callback. Checks if the message pointer is valid, increments messages_received_,...
Property specialized to provide getter for booleans.
virtual void setString(const QString &str)
Q_DECLARE_METATYPE(ros::Time)
QString fixed_frame_
A convenience variable equal to context_->getFixedFrame().
void onEnable() override
Derived classes override this to do the actual work of enabling themselves.
IntProperty * queue_size_property_
TransportHints & reliable()
void setTopic(const QString &topic, const QString &) override
Set the ROS topic to listen to for this display.
virtual void setStatus(StatusProperty::Level level, const QString &name, const QString &text)
Show status level and text. This is thread-safe.
virtual void updateQueueSize()=0
BoolProperty * unreliable_property_
void processTypeErasedMessage(boost::shared_ptr< const void > type_erased_msg) override
MessageFilterDisplay< MessageType > MFDClass
Convenience typedef so subclasses don't have to use the long templated class name to refer to their s...
~MessageFilterDisplay() override
void setTargetFrame(const std::string &target_frame)
RosTopicProperty * topic_property_
virtual FrameManager * getFrameManager() const =0
Return the FrameManager instance.
uint32_t messages_received_
virtual void setQueueSize(uint32_t new_queue_size)
std::string getTopicStd() const
void onInitialize() override
Override this function to do subclass-specific initialization.
void onDisable() override
Derived classes override this to do the actual work of disabling themselves.
virtual void setDescription(const QString &description)
Set the description.
virtual void updateTopic()=0
DisplayContext * context_
This DisplayContext pointer is the main connection a Display has into the rest of rviz....
void setMessageType(const QString &message_type)
void registerFilterForTransformStatusCheck(tf2_ros::MessageFilter< M > *filter, Display *display)
tf2_ros::MessageFilter< MessageType > * tf_filter_
virtual void reset()
Called to tell the display to clear its state.
virtual int getInt() const
Return the internal property value as an integer.
virtual void processMessage(const typename MessageType::ConstPtr &msg)=0
Implement this to process the contents of a message.
std::shared_ptr< tf2_ros::Buffer > getTF2BufferPtr() const
Convenience function: returns getFrameManager()->getTF2BufferPtr().
ros::NodeHandle update_nh_
A NodeHandle whose CallbackQueue is run from the main GUI thread (the "update" thread).
void updateTopic() override
Property specialized to provide max/min enforcement for integers.
message_filters::Subscriber< MessageType > sub_
rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Fri Dec 13 2024 03:31:02