Go to the documentation of this file.
30 #include <boost/algorithm/string/erase.hpp>
31 #include <boost/foreach.hpp>
32 #include <boost/shared_ptr.hpp>
47 "Image Topic",
"", QString::fromStdString(ros::message_traits::datatype<sensor_msgs::Image>()),
58 "Advanced: set the size of the incoming message queue. Increasing this "
59 "is useful if your incoming TF data is delayed significantly from your"
60 " image data, but it can greatly increase memory usage if the messages are big.",
83 if (
datatype == ros::message_traits::datatype<sensor_msgs::Image>())
90 int index = topic.lastIndexOf(
"/");
93 ROS_WARN(
"ImageDisplayBase::setTopic() Invalid topic name: %s", topic.toStdString().c_str());
96 QString transport = topic.mid(index + 1);
97 QString base_topic = topic.mid(0, index);
126 msg->header.stamp,
"", reason));
183 sub_->registerCallback(
193 tf_filter_->registerFailureCallback(boost::bind(
227 "image_transport",
"image_transport::SubscriberPlugin");
236 std::string transport_name = boost::erase_last_copy(lookup_name,
"_sub");
237 transport_name = transport_name.substr(lookup_name.find(
'/') + 1);
266 property->clearOptions();
268 std::vector<std::string> choices;
270 choices.push_back(
"raw");
275 ros::master::V_TopicInfo::iterator it = topics.begin();
276 ros::master::V_TopicInfo::iterator end = topics.end();
277 for (; it != end; ++it)
285 const std::string& topic_name = ti.
name;
288 if (topic_name.find(topic) == 0 && topic_name != topic && topic_name[topic.size()] ==
'/' &&
289 topic_name.find(
'/', topic.size() + 1) == std::string::npos)
291 std::string transport_type = topic_name.substr(topic.size() + 1);
297 choices.push_back(transport_type);
302 for (
size_t i = 0; i < choices.size(); i++)
304 property->addOptionStd(choices[i]);
TransportHints & unreliable()
void failedMessage(const sensor_msgs::Image::ConstPtr &msg, tf2_ros::FilterFailureReason reason)
Callback for messages, whose frame_id cannot resolved.
virtual bool getBool() const
bool isEnabled() const
Return true if this Display is enabled, false if not.
void fixedFrameChanged() override
Called by setFixedFrame(). Override to respond to changes to fixed_frame_.
void onInitialize() override
Override this function to do subclass-specific initialization.
virtual void queueRender()=0
Queues a render. Multiple calls before a render happens will only cause a single render.
void emitTimeSignal(ros::Time time)
Emit a time signal that other Displays can synchronize to.
virtual void setString(const QString &str)
Set the value of this property to the given string. Does not force the value to be one of the list of...
virtual void unsubscribe()
virtual void setString(const QString &str)
BoolProperty * unreliable_property_
void requestOptions(EnumProperty *property_in_need_of_options)
requestOptions() is emitted each time createEditor() is called.
virtual void processMessage(const sensor_msgs::Image::ConstPtr &msg)=0
Implement this to process the contents of a message.
boost::shared_ptr< tf2_ros::MessageFilter< sensor_msgs::Image > > tf_filter_
QString fixed_frame_
A convenience variable equal to context_->getFixedFrame().
void fillTransportOptionList(EnumProperty *property)
Fill list of available and working transport options.
ROSCPP_DECL bool getTopics(V_TopicInfo &topics)
BoolProperty(const QString &name=QString(), bool default_value=false, const QString &description=QString(), Property *parent=nullptr)
QMetaObject::Connection connect(const QObject *receiver, const char *slot, Qt::ConnectionType type=Qt::AutoConnection)
Connect changed() signal to given slot of receiver.
void setTopic(const QString &topic, const QString &datatype) override
Set the ROS topic to listen to for this display.
void incomingMessage(const sensor_msgs::Image::ConstPtr &msg)
Incoming message callback. Checks if the message pointer is valid, increments messages_received_,...
virtual void setStatus(StatusProperty::Level level, const QString &name, const QString &text)
Show status level and text. This is thread-safe.
boost::scoped_ptr< image_transport::ImageTransport > it_
std::vector< TopicInfo > V_TopicInfo
~ImageDisplayBase() override
std::string getStdString()
void scanForTransportSubscriberPlugins()
ImageDisplayBase()
Constructor.
virtual void updateTopic()
Update topic and resubscribe.
virtual FrameManager * getFrameManager() const =0
Return the FrameManager instance.
std::string getTopicStd() const
void setStatusStd(StatusProperty::Level level, const std::string &name, const std::string &text)
Show status level and text, using a std::string. Convenience function which converts std::string to Q...
DisplayContext * context_
This DisplayContext pointer is the main connection a Display has into the rest of rviz....
boost::shared_ptr< T > createInstance(const std::string &lookup_name)
boost::shared_ptr< image_transport::SubscriberFilter > sub_
void reset() override
Reset display.
virtual void updateQueueSize()
Update queue size of tf filter
bool setStdString(const std::string &std_str)
virtual void reset()
Called to tell the display to clear its state.
virtual int getInt() const
Return the internal property value as an integer.
RosTopicProperty * topic_property_
IntProperty * queue_size_property_
uint32_t messages_received_
EnumProperty * transport_property_
std::set< std::string > transport_plugin_types_
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).
virtual void subscribe()
ROS topic management.
std::string discoverFailureReason(const std::string &frame_id, const ros::Time &stamp, const std::string &caller_id, tf2_ros::FilterFailureReason reason)
Property specialized to provide max/min enforcement for integers.
std::vector< std::string > getDeclaredClasses()
rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Fri Aug 2 2024 08:43:09