30 #include <boost/bind.hpp> 32 #include <OgreSceneNode.h> 33 #include <OgreSceneManager.h> 34 #include <OgreManualObject.h> 35 #include <OgreBillboardSet.h> 56 , messages_received_(0)
57 , last_frame_count_( uint64_t( -1 ))
60 "Color of the grid cells.",
this );
63 "Amount of transparency to apply to the cells.",
69 QString::fromStdString( ros::message_traits::datatype<nav_msgs::GridCells>() ),
70 "nav_msgs::GridCells topic to subscribe to.",
80 ss <<
"PolyLine" << count++;
202 Ogre::Vector3 position;
203 Ogre::Quaternion orientation;
206 ROS_DEBUG(
"Error transforming from frame '%s' to frame '%s'",
207 msg->header.frame_id.c_str(), qPrintable(
fixed_frame_ ));
213 if( msg->cell_width == 0 )
217 else if( msg->cell_height == 0 )
225 uint32_t num_points = msg->cells.size();
227 typedef std::vector< PointCloud::Point > V_Point;
229 points.resize( num_points );
230 for(uint32_t i = 0; i < num_points; i++)
233 current_point.
position.x = msg->cells[i].x;
234 current_point.
position.y = msg->cells[i].y;
235 current_point.
position.z = msg->cells[i].z;
236 current_point.
color = color_int;
241 if ( !points.empty() )
virtual QColor getColor() const
void addPoints(Point *points, uint32_t num_points)
Add points to this point cloud.
virtual void onDisable()
Derived classes override this to do the actual work of disabling themselves.
RosTopicProperty * topic_property_
uint32_t messages_received_
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...
ros::NodeHandle update_nh_
A NodeHandle whose CallbackQueue is run from the main GUI thread (the "update" thread).
virtual float getFloat() const
FloatProperty * alpha_property_
void incomingMessage(const nav_msgs::GridCells::ConstPtr &msg)
uint64_t last_frame_count_
Property specialized to enforce floating point max/min.
tf::MessageFilter< nav_msgs::GridCells > * tf_filter_
Ogre::SceneNode * scene_node_
The Ogre::SceneNode to hold all 3D scene elements shown by this Display.
bool isEnabled() const
Return true if this Display is enabled, false if not.
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.
bool validateFloats(const sensor_msgs::CameraInfo &msg)
virtual void reset()
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_
virtual void onEnable()
Derived classes override this to do the actual work of enabling themselves.
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.
virtual void queueRender()=0
Queues a render. Multiple calls before a render happens will only cause a single render.
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)
A visual representation of a set of points.
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.
virtual void fixedFrameChanged()
Called by setFixedFrame(). Override to respond to changes to fixed_frame_.
virtual ~GridCellsDisplay()
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.
std::string getTopicStd() const
virtual void onInitialize()
Override this function to do subclass-specific initialization.
#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)