Go to the documentation of this file.
51 #include <OGRE/OgreSceneNode.h>
52 #include <OGRE/OgreSceneManager.h>
68 #include <boost/random/mersenne_twister.hpp>
69 #include <boost/random/uniform_int.hpp>
70 #include <boost/random/variate_generator.hpp>
89 QString::fromStdString(ros::message_traits::datatype<mesh_msgs::TriangleMeshStamped>()),
90 "Mesh topic to subscribe to.",
99 "Number of prior meshes to display.",
108 "Select Display Type for Mesh",
122 "The color of the faces.",
132 "The alpha-value of the faces",
154 "The color of the wireframe.",
164 "The alpha-value of the wireframe",
184 "The color of the normals.",
193 "The alpha-value of the normals",
202 "Normals Scaling Factor",
204 "Scaling factor of the normals",
337 bool showFaces =
false;
338 bool showTextures =
false;
339 bool useVertexColors =
false;
348 useVertexColors =
true;
364 it->get()->updateMaterial(
375 Ogre::Quaternion orientation;
376 Ogre::Vector3 position;
379 meshMsg->header.stamp,
380 position, orientation)
382 ROS_ERROR(
"Error transforming from frame '%s' to frame '%s'",
395 int randomId = (int)((
double)rand() / RAND_MAX * 9998);
403 visual->setMessage(meshMsg);
405 visual->setFramePosition(position);
406 visual->setFrameOrientation(orientation);
virtual bool getBool() const
virtual int getOptionInt()
void subscribe()
Set the topics to subscribe.
rviz::FloatProperty * m_scalingFactor
Property to set the size of the normals.
rviz::RosTopicProperty * m_meshTopic
Property to handle topic for meshMsg.
virtual void queueRender()=0
rviz::FloatProperty * m_normalsAlpha
Property to set the transparency of the normals.
rviz::FloatProperty * m_facesAlpha
Property to set faces transparency.
void onInitialize()
Initialises all nessessary things to get started.
size_t m_displayID
DisplayID.
void updateTopic()
Updates the subscribed topic.
void onEnable()
Calls subscribe() if display is enabled.
tf2_ros::MessageFilter< mesh_msgs::TriangleMeshStamped > * m_tfMeshFilter
Messagefilter for meshMsg.
rviz::ColorProperty * m_normalsColor
Property to set the color of the normals.
message_filters::Cache< mesh_msgs::TriangleMeshStamped > * m_synchronizer
Synchronizer for meshMsgs.
void reset()
Clears whole stored data.
void updateMeshBufferSize()
Sets capacity of trianglemesh_visual.
void incomingMessage(const mesh_msgs::TriangleMeshStamped::ConstPtr &meshMsg)
Tests if messages are valid, calls processMessage().
message_filters::Subscriber< mesh_msgs::TriangleMeshStamped > m_meshSubscriber
Subscriber for meshMsg.
boost::circular_buffer< boost::shared_ptr< TriangleMeshVisual > > m_meshVisuals
Shared pointer to store the created objects of trianglemesh_visual.
virtual void setStatus(StatusProperty::Level level, const QString &name, const QString &text)
rviz::EnumProperty * m_displayType
Property to select the display type.
uint32_t m_messagesReceived
Counter for the received messages.
void updateMesh()
Updates material for each mesh displayed by trianglemesh_visual.
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
virtual float getFloat() const
virtual void addOption(const QString &option, int value=0)
rviz::IntProperty * m_meshBufferSize
Property to set meshBufferSize.
rviz::ColorProperty * m_wireframeColor
Property to set wireframe color.
Class to display mesh data in the main panel of rviz.
void processMessage(const mesh_msgs::TriangleMeshStamped::ConstPtr &meshMsg)
Sets data for trianglemesh_visual and updates the mesh.
~TriangleMeshDisplay()
Destructor.
rviz::ColorProperty * m_facesColor
Property to set faces color.
Connection registerCallback(const boost::function< void(P)> &callback)
void setTargetFrame(const std::string &target_frame)
static size_t displayCounter
Counter for the number of displays.
rviz::BoolProperty * m_showNormals
Property to select the normals.
virtual FrameManager * getFrameManager() const=0
std::string getTopicStd() const
rviz::FloatProperty * m_wireframeAlpha
Property to set wireframe transparency.
bool getTransform(const Header &header, Ogre::Vector3 &position, Ogre::Quaternion &orientation)
DisplayContext * context_
void registerFilterForTransformStatusCheck(tf2_ros::MessageFilter< M > *filter, Display *display)
virtual int getInt() const
void onDisable()
Calls unsubscribe() and reset() if display is disabled.
void unsubscribe()
Unsubscribes all topics.
size_t m_meshCounter
Counter for the meshes.
rviz::BoolProperty * m_showWireframe
Property to select the wireframe.
ros::NodeHandle update_nh_
Ogre::ColourValue getOgreColor() const
void fixedFrameChanged()
Sets the fixed frame.
TriangleMeshDisplay()
Constructor.
rviz_mesh_plugin
Author(s): Sebastian Pütz
, Henning Deeken , Marcel Mrozinski , Kristin Schmidt , Jan Philipp Vogtherr
autogenerated on Fri Feb 12 2021 04:03:57