From 08ec705241d062cbffe33e2f6d0907c480257ff6 Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Fri, 10 May 2019 09:43:54 -0700 Subject: [PATCH] Update ROS node graph API (#387) * Handle new ROS type name format If there are only two parts to a type name, log a warning and insert the 'msg' namespace. This is under the assumption that all plugins are supporting types in the 'msg' namespace. * Add subnamespace to type name for default plugins Signed-off-by: Jacob Perron --- .../src/rviz_common/add_display_dialog.cpp | 18 ++++++++ rviz_default_plugins/plugins_description.xml | 44 +++++++++---------- 2 files changed, 40 insertions(+), 22 deletions(-) diff --git a/rviz_common/src/rviz_common/add_display_dialog.cpp b/rviz_common/src/rviz_common/add_display_dialog.cpp index 40514e748..96f64286c 100644 --- a/rviz_common/src/rviz_common/add_display_dialog.cpp +++ b/rviz_common/src/rviz_common/add_display_dialog.cpp @@ -587,6 +587,24 @@ void TopicDisplayWidget::findPlugins(DisplayFactory * factory) for (const auto & plugin : plugins) { QSet topic_types = factory->getMessageTypes(plugin.id); Q_FOREACH (QString topic_type, topic_types) { + // Check if the type name is fully qualified (e.g. in 'msg' namespace). + // If not, then insert 'msg' and log a warning. + // For now, we assume that all types supported by plugins have the form + // "/msg/", though in the future zero or more namespaces may be + // permitted. + QRegExp delim("/"); + QStringList topic_type_parts = topic_type.split(delim); + if (topic_type_parts.size() == 2) { + topic_type = topic_type_parts.at(0) + "/msg/" + topic_type_parts.at(1); + RVIZ_COMMON_LOG_WARNING_STREAM( + "The plugin '" << plugin.id.toStdString() << + "' message type may not be in a fully qualified namespace. " << std::endl << + "Assuming that the type is in the 'msg' namespace with resultant type '" << + topic_type.toStdString() << "'." << std::endl << + "Please update the plugin description as this assumption will not be made in a " << + "future release." + ); + } datatype_plugins_.insertMulti(topic_type, plugin.id); } } diff --git a/rviz_default_plugins/plugins_description.xml b/rviz_default_plugins/plugins_description.xml index e27c8f209..a12fee459 100644 --- a/rviz_default_plugins/plugins_description.xml +++ b/rviz_default_plugins/plugins_description.xml @@ -10,8 +10,8 @@ Displays an image from a camera, with the visualized world rendered behind it. <a href="http://www.ros.org/wiki/rviz/DisplayTypes/Camera">More Information</a>. - sensor_msgs/Image - sensor_msgs/CompressedImage + sensor_msgs/msg/Image + sensor_msgs/msg/CompressedImage Displays data from a nav_msgs::GridCells message as billboards. <a href="http://www.ros.org/wiki/rviz/DisplayTypes/GridCells">More Information</a>. - nav_msgs/GridCells + nav_msgs/msg/GridCells Displays data from a sensor_msgs::FluidPressure as pointcloud with one point - sensor_msgs/FluidPressure + sensor_msgs/msg/FluidPressure Displays data from a sensor_msgs::Illuminance as pointcloud with one point - sensor_msgs/Illuminance + sensor_msgs/msg/Illuminance The Image display creates a new rendering window with an image. - sensor_msgs/Image + sensor_msgs/msg/Image Displays the data from a sensor_msgs::LaserScan message as points in the world, drawn as points, billboards, or cubes. <a href="http://www.ros.org/wiki/rviz/DisplayTypes/LaserScan">More Information</a>. - sensor_msgs/LaserScan + sensor_msgs/msg/LaserScan Displays an occupancy grid on the ground plane from a nav_msgs::OccupancyGrid. <a href="http://www.ros.org/wiki/rviz/DisplayTypes/Map">More Information</a>. - nav_msgs/OccupancyGrid + nav_msgs/msg/OccupancyGrid The Point Cloud display shows data from a (legacy) sensor_msgs/PointCloud message. - sensor_msgs/PointCloud + sensor_msgs/msg/PointCloud The Point Cloud2 display shows data from a (recommended) sensor_msgs/PointCloud2 message. - sensor_msgs/PointCloud2 + sensor_msgs/msg/PointCloud2 Displays data from a geometry_msgs::PolygonStamped message as lines. <a href="http://www.ros.org/wiki/rviz/DisplayTypes/Polygon">More Information</a>. - geometry_msgs/PolygonStamped + geometry_msgs/msg/PolygonStamped Displays a geometry_msgs::PoseStamped message. <a href="http://www.ros.org/wiki/rviz/DisplayTypes/Pose">More Information</a>. - geometry_msgs/PoseStamped + geometry_msgs/msg/PoseStamped Displays the data from sensor_msgs::Range messages as cones. <a href="http://www.ros.org/wiki/rviz/DisplayTypes/Range">More Information</a> - sensor_msgs/Range + sensor_msgs/msg/Range Displays the data from sensor_msgs::RelativeHumidity messages as point cloud with one point - sensor_msgs/RelativeHumidity + sensor_msgs/msg/RelativeHumidity Displays the data from sensor_msgs::Temperature messages as point cloud with one point - sensor_msgs/Temperature + sensor_msgs/msg/Temperature Displays the TF transform hierarchy. <a href="http://www.ros.org/wiki/rviz/DisplayTypes/TF">More Information</a>. - tf2_msgs/TFMessage + tf2_msgs/msg/TFMessage Displays visualization_msgs::Marker messages. <a href="http://www.ros.org/wiki/rviz/DisplayTypes/Marker">More Information</a>. - visualization_msgs/Marker + visualization_msgs/msg/Marker More Information. - visualization_msgs/MarkerArray + visualization_msgs/msg/MarkerArray Accumulates and displays poses from a nav_msgs::Odometry message. <a href="http://www.ros.org/wiki/rviz/DisplayTypes/Odometry">More Information</a> - nav_msgs/Odometry + nav_msgs/msg/Odometry The Pose Array display shows a geometry_msgs/PoseArray message, as a collection of arrows. <a href="http://www.ros.org/wiki/rviz/DisplayTypes/PoseArray">More Information</a>. - geometry_msgs/PoseArray + geometry_msgs/msg/PoseArray Displays data from a nav_msgs::Path message as lines. <a href="http://www.ros.org/wiki/rviz/DisplayTypes/Path">More Information</a>. - nav_msgs/Path + nav_msgs/msg/Path Displays from geometry_msgs/PointStamped message - geometry_msgs/PointStamped + geometry_msgs/msg/PointStamped