Go to the documentation of this file.
30 #include <boost/bind/bind.hpp>
32 #include <OgreManualObject.h>
33 #include <OgreMaterialManager.h>
34 #include <OgreRectangle2D.h>
35 #include <OgreRenderSystem.h>
36 #include <OgreRenderWindow.h>
38 #include <OgreSceneManager.h>
39 #include <OgreSceneNode.h>
40 #include <OgreTextureManager.h>
41 #include <OgreViewport.h>
42 #include <OgreTechnique.h>
43 #include <OgreCamera.h>
61 "Normalize Range",
true,
62 "If set to true, will try to estimate the range of possible values from the received images.",
72 new IntProperty(
"Median window", 5,
"Window size for median filter used for computin min/max.",
82 static uint32_t count = 0;
84 ss <<
"ImageDisplay" << count++;
85 #if (OGRE_VERSION < OGRE_VERSION_CHECK(13, 0, 0))
86 img_scene_manager_ = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC, ss.str());
89 Ogre::DefaultSceneManagerFactory::FACTORY_TYPE_NAME, ss.str());
98 ss <<
"ImageDisplayObject" << count++;
101 screen_rect_->setRenderQueueGroup(Ogre::RENDER_QUEUE_OVERLAY - 1);
105 material_ = Ogre::MaterialManager::getSingleton().create(
106 ss.str(), Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
107 material_->setSceneBlending(Ogre::SBT_REPLACE);
112 material_->getTechnique(0)->setLightingEnabled(
false);
113 Ogre::TextureUnitState* tu =
material_->getTechnique(0)->getPass(0)->createTextureUnitState();
115 tu->setTextureFiltering(Ogre::TFO_NONE);
116 tu->setTextureAddressingMode(Ogre::TextureUnitState::TAM_CLAMP);
118 material_->setCullingMode(Ogre::CULL_NONE);
119 Ogre::AxisAlignedBox aabInf;
120 aabInf.setInfinite();
135 dock->addMaximizeButton();
211 if (img_width != 0 && img_height != 0 && win_width != 0 && win_height != 0)
213 float img_aspect = img_width / img_height;
214 float win_aspect = win_width / win_height;
216 if (img_aspect > win_aspect)
219 -1.0
f * win_aspect / img_aspect,
false);
223 screen_rect_->setCorners(-1.0
f * img_aspect / win_aspect, 1.0
f, 1.0
f * img_aspect / win_aspect,
virtual bool getBool() const
void onInitialize() override
Override this function to do subclass-specific initialization.
virtual void setHidden(bool hidden)
Hide or show this property in any PropertyTreeWidget viewing its parent.
bool initialized() const
Returns true if the display has been initialized.
virtual void unsubscribe()
Ogre::Camera * getCamera() const
Ogre::SceneManager * img_scene_manager_
void processMessage(const sensor_msgs::Image::ConstPtr &msg) override
Implement this to process the contents of a message.
void setImageTopic(const QString &topic)
virtual void updateNormalizeOptions()
void setNormalizeFloatImage(bool normalize, double min=0.0, double max=1.0)
void setMaterial(Ogre::SimpleRenderable &renderable, const std::string &material_name)
void reset() override
Called to tell the display to clear its state.
BoolProperty(const QString &name=QString(), bool default_value=false, const QString &description=QString(), Property *parent=nullptr)
const std::string TYPE_16UC1
IntProperty * median_buffer_size_property_
Property specialized to enforce floating point max/min.
void setMedianFrames(unsigned median_frames)
virtual void setStatus(StatusProperty::Level level, const QString &name, const QString &text)
Show status level and text. This is thread-safe.
void removeAndDestroyChildNode(Ogre::SceneNode *parent, Ogre::SceneNode *child)
void initialize(Ogre::SceneManager *scene_manager, DisplayContext *manager)
FloatProperty * min_property_
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
virtual float getFloat() const
MouseClick * mouse_click_
BoolProperty * normalize_property_
Ogre::MaterialPtr material_
RenderPanel * render_panel_
virtual void updateTopic()
Update topic and resubscribe.
void addMessage(const sensor_msgs::Image::ConstPtr &image)
Display subclass for subscribing and displaying to image messages.
void updateTopic() override
Update topic and resubscribe.
PanelDockWidget * getAssociatedWidgetPanel()
Return the panel containing the associated widget, or NULL if there is none.
DisplayContext * context_
This DisplayContext pointer is the main connection a Display has into the rest of rviz....
const std::string TYPE_32FC1
void reset() override
Reset display.
Ogre::SceneNode * img_scene_node_
void setDimensions(int img_width, int img_height, int win_width, int win_height)
void onEnable() override
Derived classes override this to do the actual work of enabling themselves.
virtual int getInt() const
Return the internal property value as an integer.
void onDisable() override
Derived classes override this to do the actual work of disabling themselves.
const std::string TYPE_16SC1
void setAutoRender(bool auto_render)
void setAssociatedWidget(QWidget *widget)
Associate the given widget with this Display.
void setOverlaysEnabled(bool overlays_enabled)
const Ogre::TexturePtr & getTexture()
RosTopicProperty * topic_property_
Class for capturing mouse clicks.
ros::NodeHandle update_nh_
A NodeHandle whose CallbackQueue is run from the main GUI thread (the "update" thread).
void update(float wall_dt, float ros_dt) override
Called periodically by the visualization manager.
void onInitialize() override
Override this function to do subclass-specific initialization.
virtual void subscribe()
ROS topic management.
Property specialized to provide max/min enforcement for integers.
Ogre::Rectangle2D * screen_rect_
FloatProperty * max_property_
rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Fri Dec 13 2024 03:31:02