30 #include <boost/bind.hpp> 31 #include <OgreSceneNode.h> 32 #include <OgreSceneManager.h> 33 #include <OgreManualObject.h> 60 QString::fromStdString(ros::message_traits::datatype<nav_msgs::GridCells>()),
61 "nav_msgs::GridCells topic to subscribe to.",
this, SLOT(
updateTopic()));
68 #pragma GCC diagnostic push 69 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 75 #pragma GCC diagnostic pop 82 ss <<
"PolyLine" << count++;
95 #pragma GCC diagnostic push 96 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 102 #pragma GCC diagnostic pop 209 "Message contained invalid floating point values (nans or infs)");
215 Ogre::Vector3 position;
216 Ogre::Quaternion orientation;
219 ROS_DEBUG(
"Error transforming from frame '%s' to frame '%s'", msg->header.frame_id.c_str(),
226 if (msg->cell_width == 0)
230 else if (msg->cell_height == 0)
238 uint32_t num_points = msg->cells.size();
240 typedef std::vector<PointCloud::Point> V_Point;
242 points.resize(num_points);
243 for (uint32_t i = 0; i < num_points; i++)
246 current_point.
position.x = msg->cells[i].x;
247 current_point.
position.y = msg->cells[i].y;
248 current_point.
position.z = msg->cells[i].z;
249 current_point.
color = color_int;
void addPoints(Point *points, uint32_t num_points)
Add points to this point cloud.
RosTopicProperty * topic_property_
uint32_t messages_received_
virtual void setString(const QString &str)
message_filters::Subscriber< nav_msgs::GridCells > sub_
void setRenderMode(RenderMode mode)
Set what type of rendering primitives should be used, currently points, billboards and boxes are supp...
virtual tf::TransformListener * getTFClient() const =0
Convenience function: returns getFrameManager()->getTFClient().
virtual uint64_t getFrameCount() const =0
Return the current value of the frame count.
DisplayContext * context_
This DisplayContext pointer is the main connection a Display has into the rest of rviz...
virtual QColor getColor() const
ros::NodeHandle update_nh_
A NodeHandle whose CallbackQueue is run from the main GUI thread (the "update" thread).
void setTopic(const QString &topic, const QString &datatype) override
Set the ROS topic to listen to for this display.
FloatProperty * alpha_property_
void incomingMessage(const nav_msgs::GridCells::ConstPtr &msg)
void onDisable() override
Derived classes override this to do the actual work of disabling themselves.
uint64_t last_frame_count_
Property specialized to enforce floating point max/min.
std::string getTopicStd() const
tf::MessageFilter< nav_msgs::GridCells > * tf_filter_
Ogre::SceneNode * scene_node_
The Ogre::SceneNode to hold all 3D scene elements shown by this Display.
Ogre::ColourValue qtToOgre(const QColor &c)
QString fixed_frame_
A convenience variable equal to context_->getFixedFrame().
void setCommonUpVector(const Ogre::Vector3 &vec)
See Ogre::BillboardSet::setCommonUpVector.
Displays a nav_msgs::GridCells message.
void onInitialize() override
Override this function to do subclass-specific initialization.
bool validateFloats(const sensor_msgs::CameraInfo &msg)
void reset() override
Called to tell the display to clear its state.
virtual void reset()
Called to tell the display to clear its state.
void registerFilterForTransformStatusCheck(tf::MessageFilter< M > *filter, Display *display)
Connect a tf::MessageFilter's callbacks to success and failure handler functions in this FrameManager...
ColorProperty * color_property_
Representation of a point, with x/y/z position and r/g/b color.
void setDimensions(float width, float height, float depth)
Set the dimensions of the billboards used to render each point.
virtual FrameManager * getFrameManager() const =0
Return the FrameManager instance.
void setAlpha(float alpha, bool per_point_alpha=false)
void clear()
Clear all the points.
void onEnable() override
Derived classes override this to do the actual work of enabling themselves.
virtual void queueRender()=0
Queues a render. Multiple calls before a render happens will only cause a single render.
bool isEnabled() const
Return true if this Display is enabled, false if not.
void subscribe(ros::NodeHandle &nh, const std::string &topic, uint32_t queue_size, const ros::TransportHints &transport_hints=ros::TransportHints(), ros::CallbackQueueInterface *callback_queue=0)
~GridCellsDisplay() override
A visual representation of a set of points.
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 setTargetFrame(const std::string &target_frame)
void setCommonDirection(const Ogre::Vector3 &vec)
See Ogre::BillboardSet::setCommonDirection.
bool initialized() const
Returns true if the display has been initialized.
void fixedFrameChanged() override
Called by setFixedFrame(). Override to respond to changes to fixed_frame_.
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
virtual void setStatus(StatusProperty::Level level, const QString &name, const QString &text)
Show status level and text. This is thread-safe.
Connection registerCallback(const C &callback)