32 #include <boost/bind.hpp> 34 #include <OgreSceneNode.h> 35 #include <OgreSceneManager.h> 52 "The TF frame this grid will use for its origin.",
this,
nullptr,
true);
55 new IntProperty(
"Plane Cell Count", 10,
"The number of cells to draw in the plane of the grid.",
60 "The number of cells to draw along the normal vector of the grid. " 61 " Setting to anything but 0 makes the grid 3D.",
66 new FloatProperty(
"Cell Size", 1.0
f,
"The length, in meters, of the side of each cell.",
this,
71 new EnumProperty(
"Line Style",
"Lines",
"The rendering operation to use to draw the grid lines.",
85 new FloatProperty(
"Alpha", 0.5
f,
"The amount of transparency to apply to the grid lines.",
this,
97 "Offset", Ogre::Vector3::ZERO,
98 "Allows you to offset the grid from the origin of the reference frame. In meters.",
this,
127 std::string frame = qframe.toStdString();
129 Ogre::Vector3 position;
130 Ogre::Quaternion orientation;
147 "Could not transform from [" + qframe +
"] to [" +
fixed_frame_ +
"]");
210 Ogre::Quaternion orient;
214 orient = Ogre::Quaternion(1, 0, 0, 0);
217 orient = Ogre::Quaternion(Ogre::Vector3(0, -1, 0), Ogre::Vector3(0, 0, 1), Ogre::Vector3(1, 0, 0));
221 orient = Ogre::Quaternion(Ogre::Vector3(1, 0, 0), Ogre::Vector3(0, 0, -1), Ogre::Vector3(0, 1, 0));
IntProperty * height_property_
Ogre::SceneNode * getSceneNode()
Get the Ogre scene node associated with this grid.
EnumProperty * plane_property_
Grid * grid_
Handles actually drawing the grid.
bool transformHasProblems(const std::string &frame, ros::Time time, std::string &error)
Check to see if a transform is known between a given frame and the fixed frame.
DisplayContext * context_
This DisplayContext pointer is the main connection a Display has into the rest of rviz...
virtual QColor getColor() const
FloatProperty * line_width_property_
FloatProperty * cell_size_property_
IntProperty * cell_count_property_
virtual Ogre::Vector3 getVector() const
void setHeight(uint32_t count)
Property specialized to enforce floating point max/min.
EnumProperty * style_property_
Property specialized to provide max/min enforcement for integers.
Ogre::SceneNode * scene_node_
The Ogre::SceneNode to hold all 3D scene elements shown by this Display.
void setStyle(Style style)
Ogre::ColourValue qtToOgre(const QColor &c)
QString fixed_frame_
A convenience variable equal to context_->getFixedFrame().
void setCellCount(uint32_t count)
void setCellLength(float len)
FloatProperty * alpha_property_
virtual void addOption(const QString &option, int value=0)
Displays a grid in either the XY, YZ, or XZ plane.
ColorProperty * color_property_
void show()
Show this Property in any PropertyTreeWidgets.
virtual FrameManager * getFrameManager() const =0
Return the FrameManager instance.
void onInitialize() override
Override this function to do subclass-specific initialization.
Displays a grid of cells, drawn with lines.
Ogre::SceneManager * scene_manager_
A convenience variable equal to context_->getSceneManager().
virtual int getInt() const
Return the internal property value as an integer.
virtual void queueRender()=0
Queues a render. Multiple calls before a render happens will only cause a single render.
void setLineWidth(float width)
static const QString FIXED_FRAME_STRING
virtual float getFloat() const
bool getTransform(const Header &header, Ogre::Vector3 &position, Ogre::Quaternion &orientation)
Return the pose for a header, relative to the fixed frame, in Ogre classes.
void setFrameManager(FrameManager *frame_manager)
void hide()
Hide this Property in any PropertyTreeWidgets.
bool initialized() const
Returns true if the display has been initialized.
virtual int getOptionInt()
Return the int value of the currently-chosen option, or 0 if the current option string does not have ...
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
void setColor(const Ogre::ColourValue &color)
void update(float dt, float ros_dt) override
Called periodically by the visualization manager.
virtual void setStatus(StatusProperty::Level level, const QString &name, const QString &text)
Show status level and text. This is thread-safe.
TfFrameProperty * frame_property_
VectorProperty * offset_property_