Displays "markers" sent in by other ROS nodes on the "visualization_marker" topic. More...
#include <marker_display.h>
Public Member Functions | |
void | deleteMarker (MarkerID id) |
void | deleteMarkerStatus (MarkerID id) |
virtual void | fixedFrameChanged () |
Called by setFixedFrame(). Override to respond to changes to fixed_frame_. | |
MarkerDisplay () | |
virtual void | onInitialize () |
Override this function to do subclass-specific initialization. | |
virtual void | reset () |
Called to tell the display to clear its state. | |
void | setMarkerStatus (MarkerID id, StatusLevel level, const std::string &text) |
virtual void | setTopic (const QString &topic, const QString &datatype) |
Set the ROS topic to listen to for this display. | |
virtual void | update (float wall_dt, float ros_dt) |
Called periodically by the visualization manager. | |
virtual | ~MarkerDisplay () |
Protected Member Functions | |
void | incomingMarkerArray (const visualization_msgs::MarkerArray::ConstPtr &array) |
Process a MarkerArray message. | |
virtual void | onDisable () |
Derived classes override this to do the actual work of disabling themselves. | |
virtual void | onEnable () |
Derived classes override this to do the actual work of enabling themselves. | |
virtual void | subscribe () |
Subscribes to the "visualization_marker" and "visualization_marker_array" topics. | |
virtual void | unsubscribe () |
Unsubscribes from the "visualization_marker" "visualization_marker_array" topics. | |
Protected Attributes | |
ros::Subscriber | array_sub_ |
RosTopicProperty * | marker_topic_property_ |
IntProperty * | queue_size_property_ |
Private Types | |
typedef std::map< MarkerID, MarkerBasePtr > | M_IDToMarker |
typedef QHash< QString, MarkerNamespace * > | M_Namespace |
typedef std::set< MarkerBasePtr > | S_MarkerBase |
typedef std::vector < visualization_msgs::Marker::ConstPtr > | V_MarkerMessage |
Private Slots | |
void | updateQueueSize () |
void | updateTopic () |
Private Member Functions | |
void | clearMarkers () |
Removes all the markers. | |
void | deleteMarkersInNamespace (const std::string &ns) |
Delete all the markers within the given namespace. | |
void | failedMarker (const ros::MessageEvent< visualization_msgs::Marker > &marker_evt, tf::FilterFailureReason reason) |
void | incomingMarker (const visualization_msgs::Marker::ConstPtr &marker) |
ROS callback notifying us of a new marker. | |
void | processAdd (const visualization_msgs::Marker::ConstPtr &message) |
Processes an "Add" marker message. | |
void | processDelete (const visualization_msgs::Marker::ConstPtr &message) |
Processes a "Delete" marker message. | |
void | processMessage (const visualization_msgs::Marker::ConstPtr &message) |
Processes a marker message. | |
Private Attributes | |
S_MarkerBase | frame_locked_markers_ |
M_IDToMarker | markers_ |
Map of marker id to the marker info structure. | |
S_MarkerBase | markers_with_expiration_ |
V_MarkerMessage | message_queue_ |
M_Namespace | namespaces_ |
Property * | namespaces_category_ |
boost::mutex | queue_mutex_ |
message_filters::Subscriber < visualization_msgs::Marker > | sub_ |
tf::MessageFilter < visualization_msgs::Marker > * | tf_filter_ |
Friends | |
class | MarkerNamespace |
Displays "markers" sent in by other ROS nodes on the "visualization_marker" topic.
Markers come in as visualization_msgs::Marker messages. See the Marker message for more information.
Definition at line 70 of file marker_display.h.
typedef std::map<MarkerID, MarkerBasePtr> rviz::MarkerDisplay::M_IDToMarker [private] |
Definition at line 147 of file marker_display.h.
typedef QHash<QString, MarkerNamespace*> rviz::MarkerDisplay::M_Namespace [private] |
Definition at line 160 of file marker_display.h.
typedef std::set<MarkerBasePtr> rviz::MarkerDisplay::S_MarkerBase [private] |
Definition at line 148 of file marker_display.h.
typedef std::vector<visualization_msgs::Marker::ConstPtr> rviz::MarkerDisplay::V_MarkerMessage [private] |
Definition at line 152 of file marker_display.h.
Definition at line 60 of file marker_display.cpp.
rviz::MarkerDisplay::~MarkerDisplay | ( | ) | [virtual] |
Definition at line 91 of file marker_display.cpp.
void rviz::MarkerDisplay::clearMarkers | ( | ) | [private] |
Removes all the markers.
Definition at line 103 of file marker_display.cpp.
void rviz::MarkerDisplay::deleteMarker | ( | MarkerID | id | ) |
Definition at line 169 of file marker_display.cpp.
void rviz::MarkerDisplay::deleteMarkersInNamespace | ( | const std::string & | ns | ) | [private] |
Delete all the markers within the given namespace.
Definition at line 182 of file marker_display.cpp.
void rviz::MarkerDisplay::deleteMarkerStatus | ( | MarkerID | id | ) |
Definition at line 215 of file marker_display.cpp.
void rviz::MarkerDisplay::failedMarker | ( | const ros::MessageEvent< visualization_msgs::Marker > & | marker_evt, |
tf::FilterFailureReason | reason | ||
) | [private] |
Definition at line 241 of file marker_display.cpp.
void rviz::MarkerDisplay::fixedFrameChanged | ( | ) | [virtual] |
Called by setFixedFrame(). Override to respond to changes to fixed_frame_.
Reimplemented from rviz::Display.
Definition at line 449 of file marker_display.cpp.
void rviz::MarkerDisplay::incomingMarker | ( | const visualization_msgs::Marker::ConstPtr & | marker | ) | [private] |
ROS callback notifying us of a new marker.
Definition at line 234 of file marker_display.cpp.
void rviz::MarkerDisplay::incomingMarkerArray | ( | const visualization_msgs::MarkerArray::ConstPtr & | array | ) | [protected] |
Process a MarkerArray message.
Definition at line 223 of file marker_display.cpp.
void rviz::MarkerDisplay::onDisable | ( | ) | [protected, virtual] |
Derived classes override this to do the actual work of disabling themselves.
Reimplemented from rviz::Display.
Definition at line 118 of file marker_display.cpp.
void rviz::MarkerDisplay::onEnable | ( | ) | [protected, virtual] |
Derived classes override this to do the actual work of enabling themselves.
Reimplemented from rviz::Display.
Definition at line 113 of file marker_display.cpp.
void rviz::MarkerDisplay::onInitialize | ( | ) | [virtual] |
Override this function to do subclass-specific initialization.
This is called after vis_manager_ and scene_manager_ are set, and before load() or setEnabled().
setName() may or may not have been called before this.
Reimplemented from rviz::Display.
Definition at line 79 of file marker_display.cpp.
void rviz::MarkerDisplay::processAdd | ( | const visualization_msgs::Marker::ConstPtr & | message | ) | [private] |
Processes an "Add" marker message.
message | The message to process |
Definition at line 282 of file marker_display.cpp.
void rviz::MarkerDisplay::processDelete | ( | const visualization_msgs::Marker::ConstPtr & | message | ) | [private] |
Processes a "Delete" marker message.
message | The message to process |
Definition at line 392 of file marker_display.cpp.
void rviz::MarkerDisplay::processMessage | ( | const visualization_msgs::Marker::ConstPtr & | message | ) | [private] |
Processes a marker message.
message | The message to process |
Definition at line 259 of file marker_display.cpp.
void rviz::MarkerDisplay::reset | ( | ) | [virtual] |
Called to tell the display to clear its state.
Reimplemented from rviz::Display.
Definition at line 456 of file marker_display.cpp.
void rviz::MarkerDisplay::setMarkerStatus | ( | MarkerID | id, |
StatusLevel | level, | ||
const std::string & | text | ||
) |
Definition at line 207 of file marker_display.cpp.
void rviz::MarkerDisplay::setTopic | ( | const QString & | topic, |
const QString & | datatype | ||
) | [virtual] |
Set the ROS topic to listen to for this display.
By default, do nothing. Subclasses should override this method if they subscribe to a single ROS topic.
setTopic() is used by the "New display by topic" window; it is called with a user selected topic and its type.
topic | The published topic to be visualized. |
datatype | The datatype of the topic. |
Reimplemented from rviz::Display.
Definition at line 462 of file marker_display.cpp.
void rviz::MarkerDisplay::subscribe | ( | ) | [protected, virtual] |
Subscribes to the "visualization_marker" and "visualization_marker_array" topics.
Reimplemented in rviz::MarkerArrayDisplay.
Definition at line 137 of file marker_display.cpp.
void rviz::MarkerDisplay::unsubscribe | ( | ) | [protected, virtual] |
Unsubscribes from the "visualization_marker" "visualization_marker_array" topics.
Reimplemented in rviz::MarkerArrayDisplay.
Definition at line 163 of file marker_display.cpp.
void rviz::MarkerDisplay::update | ( | float | wall_dt, |
float | ros_dt | ||
) | [virtual] |
Called periodically by the visualization manager.
wall_dt | Wall-clock time, in seconds, since the last time the update list was run through. |
ros_dt | ROS time, in seconds, since the last time the update list was run through. |
Reimplemented from rviz::Display.
Definition at line 398 of file marker_display.cpp.
void rviz::MarkerDisplay::updateQueueSize | ( | ) | [private, slot] |
Definition at line 126 of file marker_display.cpp.
void rviz::MarkerDisplay::updateTopic | ( | ) | [private, slot] |
Definition at line 131 of file marker_display.cpp.
friend class MarkerNamespace [friend] |
Definition at line 165 of file marker_display.h.
ros::Subscriber rviz::MarkerDisplay::array_sub_ [protected] |
Definition at line 106 of file marker_display.h.
Definition at line 151 of file marker_display.h.
Definition at line 108 of file marker_display.h.
M_IDToMarker rviz::MarkerDisplay::markers_ [private] |
Map of marker id to the marker info structure.
Definition at line 149 of file marker_display.h.
Definition at line 150 of file marker_display.h.
Marker message queue. Messages are added to this as they are received, and then processed in our update() function
Definition at line 153 of file marker_display.h.
M_Namespace rviz::MarkerDisplay::namespaces_ [private] |
Definition at line 161 of file marker_display.h.
Definition at line 163 of file marker_display.h.
boost::mutex rviz::MarkerDisplay::queue_mutex_ [private] |
Definition at line 155 of file marker_display.h.
IntProperty* rviz::MarkerDisplay::queue_size_property_ [protected] |
Definition at line 109 of file marker_display.h.
message_filters::Subscriber<visualization_msgs::Marker> rviz::MarkerDisplay::sub_ [private] |
Definition at line 157 of file marker_display.h.
tf::MessageFilter<visualization_msgs::Marker>* rviz::MarkerDisplay::tf_filter_ [private] |
Definition at line 158 of file marker_display.h.