From 4aaa893cfc7140d921a73f33236d6cd2df2aca37 Mon Sep 17 00:00:00 2001 From: Andreas Holzner Date: Sat, 31 Mar 2018 02:59:06 +0200 Subject: [PATCH] Restore icons throughout RViz2 (#235) * Move icons to rviz_common or rviz_default_plugins * Unify installs in CMakeLists * Install icons * Reenable loading of PixMaps using ament_index_cpp * Rename plugins in plugin_description and classes - This is necessary to be able to find icons (name=path) * Adapt names so that all icons are found * Change names in default config - Otherwise using the default config can't load classes anymore * Reenable image loading for cursor icons - this does not functionally reenable different cursors * Improve error message in loading from ament_index_cpp * Set cursor for RenderWindow * Fix rviz crash for invalid config file By catching the exception rviz will start with a visibly broken config so that the user can fix the config manually. * Switch to using resource_retriever * Add simple mechanism to automatically convert old configs --- rviz_common/CMakeLists.txt | 7 ++ rviz_common/default.rviz | 10 +- .../icons/classes/Displays.svg | 0 {rviz => rviz_common}/icons/classes/Group.png | Bin {rviz => rviz_common}/icons/classes/Views.svg | 0 {rviz => rviz_common}/icons/crosshair.svg | 0 {rviz => rviz_common}/icons/cursor.svg | 0 .../icons/default_class_icon.png | Bin .../icons/default_package_icon.png | Bin {rviz => rviz_common}/icons/error.png | Bin .../icons/failed_display.png | Bin {rviz => rviz_common}/icons/forbidden.svg | 0 {rviz => rviz_common}/icons/left_dock.svg | 0 {rviz => rviz_common}/icons/menu.svg | 0 {rviz => rviz_common}/icons/minus.png | Bin {rviz => rviz_common}/icons/move1d.svg | 0 {rviz => rviz_common}/icons/move2d.svg | 0 {rviz => rviz_common}/icons/move_z.svg | 0 {rviz => rviz_common}/icons/moverotate.svg | 0 {rviz => rviz_common}/icons/ok.png | Bin {rviz => rviz_common}/icons/options.png | Bin {rviz => rviz_common}/icons/package.png | Bin {rviz => rviz_common}/icons/plus.png | Bin {rviz => rviz_common}/icons/right_dock.svg | 0 {rviz => rviz_common}/icons/rotate.svg | 0 {rviz => rviz_common}/icons/rotate_cam.svg | 0 {rviz => rviz_common}/icons/warning.png | Bin {rviz => rviz_common}/icons/zoom.svg | 0 .../src/rviz_common/add_display_dialog.cpp | 2 +- rviz_common/src/rviz_common/config.cpp | 23 +++- .../src/rviz_common/display_factory.cpp | 3 +- .../src/rviz_common/failed_display.cpp | 2 +- rviz_common/src/rviz_common/load_resource.cpp | 104 +++++++----------- .../src/rviz_common/new_object_dialog.cpp | 2 +- rviz_common/src/rviz_common/panel_factory.cpp | 12 +- .../src/rviz_common/pluginlib_factory.hpp | 2 +- .../properties/status_property.cpp | 6 +- rviz_common/src/rviz_common/splash_screen.cpp | 2 +- rviz_common/src/rviz_common/tool_manager.cpp | 12 +- .../src/rviz_common/view_controller.cpp | 12 +- rviz_common/src/rviz_common/view_manager.cpp | 2 +- .../src/rviz_common/visualization_frame.cpp | 11 +- .../src/rviz_common/visualization_manager.cpp | 3 +- rviz_default_plugins/CMakeLists.txt | 5 + .../icons/classes/Axes.png | Bin .../icons/classes/Camera.png | Bin .../icons/classes/DepthCloud.png | Bin .../icons/classes/Effort.png | Bin .../icons/classes/FluidPressure.png | Bin .../icons/classes/FocusCamera.svg | 0 .../icons/classes/Grid.png | Bin .../icons/classes/GridCells.png | Bin .../icons/classes/Help.svg | 0 .../icons/classes/Illuminance.png | Bin .../icons/classes/Image.png | Bin .../icons/classes/Interact.png | Bin .../icons/classes/InteractiveMarkers.png | Bin .../icons/classes/LaserScan.png | Bin .../icons/classes/Map.png | Bin .../icons/classes/Marker.png | Bin .../icons/classes/MarkerArray.png | Bin .../icons/classes/Measure.svg | 0 .../icons/classes/MoveCamera.png | Bin .../icons/classes/Odometry.png | Bin .../icons/classes/Path.png | Bin .../icons/classes/PointCloud.png | Bin .../icons/classes/PointCloud2.png | Bin .../icons/classes/PointStamped.png | Bin .../icons/classes/Polygon.png | Bin .../icons/classes/Pose.png | Bin .../icons/classes/PoseArray.png | Bin .../icons/classes/PublishPoint.svg | 0 .../icons/classes/Range.png | Bin .../icons/classes/RelativeHumidity.png | Bin .../icons/classes/RobotJoint.png | Bin .../icons/classes/RobotLink.png | Bin .../icons/classes/RobotLinkNoGeom.png | Bin .../icons/classes/RobotModel.png | Bin .../icons/classes/Select.png | Bin .../icons/classes/Selection.png | Bin .../icons/classes/SetGoal.png | Bin .../icons/classes/SetInitialPose.png | Bin .../icons/classes/TF.png | Bin .../icons/classes/Temperature.png | Bin .../icons/classes/Time.svg | 0 .../icons/classes/Tool Properties.png | Bin .../icons/classes/WrenchStamped.png | Bin .../icons/classes/src/Arrow.xcf | Bin .../icons/classes/src/Axes.xcf | Bin .../icons/classes/src/GridCells.xcf | Bin .../icons/classes/src/InteractiveMarker.xcf | Bin .../icons/classes/src/Map.xcf | Bin .../icons/classes/src/MarkerArray.xcf | Bin .../icons/classes/src/Poly.xcf | Bin .../icons/classes/src/Polygon.xcf | Bin .../icons/classes/src/PoseArray.xcf | Bin .../icons/classes/src/Range.xcf | Bin .../icons/classes/src/RobotModel.xcf | Bin .../icons/classes/src/TF.xcf | Bin .../icons/visibility.svg | 0 rviz_default_plugins/plugins_description.xml | 34 +++--- .../displays/camera/camera_display.cpp | 2 +- .../robot/robot_joint.cpp | 2 +- .../rviz_default_plugins/robot/robot_link.cpp | 4 +- .../tools/move/move_tool.cpp | 2 +- .../orbit/orbit_view_controller.cpp | 2 +- rviz_rendering/CMakeLists.txt | 2 +- 107 files changed, 141 insertions(+), 127 deletions(-) rename {rviz => rviz_common}/icons/classes/Displays.svg (100%) rename {rviz => rviz_common}/icons/classes/Group.png (100%) rename {rviz => rviz_common}/icons/classes/Views.svg (100%) rename {rviz => rviz_common}/icons/crosshair.svg (100%) rename {rviz => rviz_common}/icons/cursor.svg (100%) rename {rviz => rviz_common}/icons/default_class_icon.png (100%) rename {rviz => rviz_common}/icons/default_package_icon.png (100%) rename {rviz => rviz_common}/icons/error.png (100%) rename {rviz => rviz_common}/icons/failed_display.png (100%) rename {rviz => rviz_common}/icons/forbidden.svg (100%) rename {rviz => rviz_common}/icons/left_dock.svg (100%) rename {rviz => rviz_common}/icons/menu.svg (100%) rename {rviz => rviz_common}/icons/minus.png (100%) rename {rviz => rviz_common}/icons/move1d.svg (100%) rename {rviz => rviz_common}/icons/move2d.svg (100%) rename {rviz => rviz_common}/icons/move_z.svg (100%) rename {rviz => rviz_common}/icons/moverotate.svg (100%) rename {rviz => rviz_common}/icons/ok.png (100%) rename {rviz => rviz_common}/icons/options.png (100%) rename {rviz => rviz_common}/icons/package.png (100%) rename {rviz => rviz_common}/icons/plus.png (100%) rename {rviz => rviz_common}/icons/right_dock.svg (100%) rename {rviz => rviz_common}/icons/rotate.svg (100%) rename {rviz => rviz_common}/icons/rotate_cam.svg (100%) rename {rviz => rviz_common}/icons/warning.png (100%) rename {rviz => rviz_common}/icons/zoom.svg (100%) rename {rviz => rviz_default_plugins}/icons/classes/Axes.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/Camera.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/DepthCloud.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/Effort.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/FluidPressure.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/FocusCamera.svg (100%) rename {rviz => rviz_default_plugins}/icons/classes/Grid.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/GridCells.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/Help.svg (100%) rename {rviz => rviz_default_plugins}/icons/classes/Illuminance.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/Image.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/Interact.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/InteractiveMarkers.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/LaserScan.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/Map.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/Marker.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/MarkerArray.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/Measure.svg (100%) rename {rviz => rviz_default_plugins}/icons/classes/MoveCamera.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/Odometry.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/Path.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/PointCloud.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/PointCloud2.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/PointStamped.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/Polygon.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/Pose.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/PoseArray.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/PublishPoint.svg (100%) rename {rviz => rviz_default_plugins}/icons/classes/Range.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/RelativeHumidity.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/RobotJoint.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/RobotLink.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/RobotLinkNoGeom.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/RobotModel.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/Select.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/Selection.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/SetGoal.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/SetInitialPose.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/TF.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/Temperature.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/Time.svg (100%) rename {rviz => rviz_default_plugins}/icons/classes/Tool Properties.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/WrenchStamped.png (100%) rename {rviz => rviz_default_plugins}/icons/classes/src/Arrow.xcf (100%) rename {rviz => rviz_default_plugins}/icons/classes/src/Axes.xcf (100%) rename {rviz => rviz_default_plugins}/icons/classes/src/GridCells.xcf (100%) rename {rviz => rviz_default_plugins}/icons/classes/src/InteractiveMarker.xcf (100%) rename {rviz => rviz_default_plugins}/icons/classes/src/Map.xcf (100%) rename {rviz => rviz_default_plugins}/icons/classes/src/MarkerArray.xcf (100%) rename {rviz => rviz_default_plugins}/icons/classes/src/Poly.xcf (100%) rename {rviz => rviz_default_plugins}/icons/classes/src/Polygon.xcf (100%) rename {rviz => rviz_default_plugins}/icons/classes/src/PoseArray.xcf (100%) rename {rviz => rviz_default_plugins}/icons/classes/src/Range.xcf (100%) rename {rviz => rviz_default_plugins}/icons/classes/src/RobotModel.xcf (100%) rename {rviz => rviz_default_plugins}/icons/classes/src/TF.xcf (100%) rename {rviz => rviz_default_plugins}/icons/visibility.svg (100%) diff --git a/rviz_common/CMakeLists.txt b/rviz_common/CMakeLists.txt index dd153c035..bb8c7a3e9 100644 --- a/rviz_common/CMakeLists.txt +++ b/rviz_common/CMakeLists.txt @@ -30,6 +30,7 @@ find_package(Qt5 REQUIRED COMPONENTS Widgets) find_package(geometry_msgs REQUIRED) find_package(pluginlib REQUIRED) find_package(rclcpp REQUIRED) +find_package(resource_retriever REQUIRED) find_package(rviz_assimp_vendor REQUIRED) find_package(rviz_rendering REQUIRED) find_package(rviz_yaml_cpp_vendor REQUIRED) @@ -227,6 +228,7 @@ target_link_libraries(rviz_common ament_target_dependencies(rviz_common geometry_msgs rclcpp + resource_retriever rviz_assimp_vendor rviz_yaml_cpp_vendor sensor_msgs @@ -274,6 +276,11 @@ install(FILES default.rviz DESTINATION share/${PROJECT_NAME} ) +install( + DIRECTORY "${CMAKE_SOURCE_DIR}/icons" + DESTINATION "share/${PROJECT_NAME}" +) + # TODO(wjwwood): reenable tests for Windows after resolving building problems if(BUILD_TESTING AND NOT WIN32) # TODO(wjwwood): replace this with ament_lint_auto() and/or add the copyright linter back diff --git a/rviz_common/default.rviz b/rviz_common/default.rviz index b2638e1de..a55fc55b1 100644 --- a/rviz_common/default.rviz +++ b/rviz_common/default.rviz @@ -1,5 +1,5 @@ Panels: - - Class: rviz/Displays + - Class: rviz_common/Displays Help Height: 78 Name: Displays Property Tree Widget: @@ -18,7 +18,7 @@ Panels: # - /Publish Point1 # Name: Tool Properties # Splitter Ratio: 0.588679 - - Class: rviz/Views + - Class: rviz_common/Views Expanded: - /Current View1 Name: Views @@ -32,7 +32,7 @@ Visualization Manager: Displays: - Alpha: 0.5 Cell Size: 1 - Class: rviz/Grid + Class: rviz_default_plugins/Grid Color: 160; 160; 164 Enabled: true Line Style: @@ -57,7 +57,7 @@ Visualization Manager: # TODO(wjwwood): restore these tools when ported # - Class: rviz/Interact # Hide Inactive Objects: true - - Class: rviz/MoveCamera + - Class: rviz_default_plugins/MoveCamera # - Class: rviz/Select # - Class: rviz/FocusCamera # - Class: rviz/Measure @@ -71,7 +71,7 @@ Visualization Manager: Value: true Views: Current: - Class: rviz/Orbit + Class: rviz_default_plugins/Orbit Distance: 10 Focal Point: X: 0 diff --git a/rviz/icons/classes/Displays.svg b/rviz_common/icons/classes/Displays.svg similarity index 100% rename from rviz/icons/classes/Displays.svg rename to rviz_common/icons/classes/Displays.svg diff --git a/rviz/icons/classes/Group.png b/rviz_common/icons/classes/Group.png similarity index 100% rename from rviz/icons/classes/Group.png rename to rviz_common/icons/classes/Group.png diff --git a/rviz/icons/classes/Views.svg b/rviz_common/icons/classes/Views.svg similarity index 100% rename from rviz/icons/classes/Views.svg rename to rviz_common/icons/classes/Views.svg diff --git a/rviz/icons/crosshair.svg b/rviz_common/icons/crosshair.svg similarity index 100% rename from rviz/icons/crosshair.svg rename to rviz_common/icons/crosshair.svg diff --git a/rviz/icons/cursor.svg b/rviz_common/icons/cursor.svg similarity index 100% rename from rviz/icons/cursor.svg rename to rviz_common/icons/cursor.svg diff --git a/rviz/icons/default_class_icon.png b/rviz_common/icons/default_class_icon.png similarity index 100% rename from rviz/icons/default_class_icon.png rename to rviz_common/icons/default_class_icon.png diff --git a/rviz/icons/default_package_icon.png b/rviz_common/icons/default_package_icon.png similarity index 100% rename from rviz/icons/default_package_icon.png rename to rviz_common/icons/default_package_icon.png diff --git a/rviz/icons/error.png b/rviz_common/icons/error.png similarity index 100% rename from rviz/icons/error.png rename to rviz_common/icons/error.png diff --git a/rviz/icons/failed_display.png b/rviz_common/icons/failed_display.png similarity index 100% rename from rviz/icons/failed_display.png rename to rviz_common/icons/failed_display.png diff --git a/rviz/icons/forbidden.svg b/rviz_common/icons/forbidden.svg similarity index 100% rename from rviz/icons/forbidden.svg rename to rviz_common/icons/forbidden.svg diff --git a/rviz/icons/left_dock.svg b/rviz_common/icons/left_dock.svg similarity index 100% rename from rviz/icons/left_dock.svg rename to rviz_common/icons/left_dock.svg diff --git a/rviz/icons/menu.svg b/rviz_common/icons/menu.svg similarity index 100% rename from rviz/icons/menu.svg rename to rviz_common/icons/menu.svg diff --git a/rviz/icons/minus.png b/rviz_common/icons/minus.png similarity index 100% rename from rviz/icons/minus.png rename to rviz_common/icons/minus.png diff --git a/rviz/icons/move1d.svg b/rviz_common/icons/move1d.svg similarity index 100% rename from rviz/icons/move1d.svg rename to rviz_common/icons/move1d.svg diff --git a/rviz/icons/move2d.svg b/rviz_common/icons/move2d.svg similarity index 100% rename from rviz/icons/move2d.svg rename to rviz_common/icons/move2d.svg diff --git a/rviz/icons/move_z.svg b/rviz_common/icons/move_z.svg similarity index 100% rename from rviz/icons/move_z.svg rename to rviz_common/icons/move_z.svg diff --git a/rviz/icons/moverotate.svg b/rviz_common/icons/moverotate.svg similarity index 100% rename from rviz/icons/moverotate.svg rename to rviz_common/icons/moverotate.svg diff --git a/rviz/icons/ok.png b/rviz_common/icons/ok.png similarity index 100% rename from rviz/icons/ok.png rename to rviz_common/icons/ok.png diff --git a/rviz/icons/options.png b/rviz_common/icons/options.png similarity index 100% rename from rviz/icons/options.png rename to rviz_common/icons/options.png diff --git a/rviz/icons/package.png b/rviz_common/icons/package.png similarity index 100% rename from rviz/icons/package.png rename to rviz_common/icons/package.png diff --git a/rviz/icons/plus.png b/rviz_common/icons/plus.png similarity index 100% rename from rviz/icons/plus.png rename to rviz_common/icons/plus.png diff --git a/rviz/icons/right_dock.svg b/rviz_common/icons/right_dock.svg similarity index 100% rename from rviz/icons/right_dock.svg rename to rviz_common/icons/right_dock.svg diff --git a/rviz/icons/rotate.svg b/rviz_common/icons/rotate.svg similarity index 100% rename from rviz/icons/rotate.svg rename to rviz_common/icons/rotate.svg diff --git a/rviz/icons/rotate_cam.svg b/rviz_common/icons/rotate_cam.svg similarity index 100% rename from rviz/icons/rotate_cam.svg rename to rviz_common/icons/rotate_cam.svg diff --git a/rviz/icons/warning.png b/rviz_common/icons/warning.png similarity index 100% rename from rviz/icons/warning.png rename to rviz_common/icons/warning.png diff --git a/rviz/icons/zoom.svg b/rviz_common/icons/zoom.svg similarity index 100% rename from rviz/icons/zoom.svg rename to rviz_common/icons/zoom.svg diff --git a/rviz_common/src/rviz_common/add_display_dialog.cpp b/rviz_common/src/rviz_common/add_display_dialog.cpp index 6e5a5066c..1feab8041 100644 --- a/rviz_common/src/rviz_common/add_display_dialog.cpp +++ b/rviz_common/src/rviz_common/add_display_dialog.cpp @@ -412,7 +412,7 @@ void DisplayTypeTree::onCurrentItemChanged( void DisplayTypeTree::fillTree(Factory * factory) { - QIcon default_package_icon = loadPixmap("package://rviz/icons/default_package_icon.png"); + QIcon default_package_icon = loadPixmap("package://rviz_common/icons/default_package_icon.png"); QStringList classes = factory->getDeclaredClassIds(); classes.sort(); diff --git a/rviz_common/src/rviz_common/config.cpp b/rviz_common/src/rviz_common/config.cpp index 1a3f0845a..9fa053907 100644 --- a/rviz_common/src/rviz_common/config.cpp +++ b/rviz_common/src/rviz_common/config.cpp @@ -32,6 +32,8 @@ #include +#include "rviz_common/logging.hpp" + namespace rviz_common { @@ -285,11 +287,30 @@ bool Config::isValid() const return node_.get() != NULL; } +// TODO(Martin-Idel-SI): This is just a temporary helper to convert old rviz2 configs. +// Remove after next release. +QVariant correctClassNames(const QVariant & value) +{ + auto string_representation = value.toString(); + if (string_representation.contains(QString("rviz/"))) { + RVIZ_COMMON_LOG_WARNING("Your config contains obsolete class name " + + value.toString().toStdString() + ". Please save your config to correct it."); + if (string_representation == "rviz/Displays" || + string_representation == "rviz/Views" || + string_representation == "rviz/DisplayGroup") + { + return string_representation.replace(0, 4, "rviz_common"); + } + return string_representation.replace(0, 4, "rviz_default_plugins"); + } + return value; +} + void Config::setValue(const QVariant & value) { makeValid(); node_->setType(Value); - *node_->data_.value = value; + *node_->data_.value = correctClassNames(value); } QVariant Config::getValue() const diff --git a/rviz_common/src/rviz_common/display_factory.cpp b/rviz_common/src/rviz_common/display_factory.cpp index 68c7d80b9..ab486f0a6 100644 --- a/rviz_common/src/rviz_common/display_factory.cpp +++ b/rviz_common/src/rviz_common/display_factory.cpp @@ -49,8 +49,7 @@ static Display * newDisplayGroup() DisplayFactory::DisplayFactory() : PluginlibFactory("rviz_common", "rviz_common::Display") { - addBuiltInClass("rviz", "Group", "A container for Displays", &newDisplayGroup); - // addBuiltInClass("rviz", "RobotModel", "robot model display", &newRobotModelDisplay); + addBuiltInClass("rviz_common", "Group", "A container for Displays", &newDisplayGroup); } Display * DisplayFactory::makeRaw(const QString & class_id, QString * error_return) diff --git a/rviz_common/src/rviz_common/failed_display.cpp b/rviz_common/src/rviz_common/failed_display.cpp index 93e3dd336..04f617054 100644 --- a/rviz_common/src/rviz_common/failed_display.cpp +++ b/rviz_common/src/rviz_common/failed_display.cpp @@ -44,7 +44,7 @@ FailedDisplay::FailedDisplay(const QString & desired_class_id, const QString & e : error_message_(error_message) { setClassId(desired_class_id); - setIcon(loadPixmap("package://rviz/icons/failed_display.png")); + setIcon(loadPixmap("package://rviz_common/icons/failed_display.png")); } QVariant FailedDisplay::getViewData(int column, int role) const diff --git a/rviz_common/src/rviz_common/load_resource.cpp b/rviz_common/src/rviz_common/load_resource.cpp index 055fa78d0..b17eb3596 100644 --- a/rviz_common/src/rviz_common/load_resource.cpp +++ b/rviz_common/src/rviz_common/load_resource.cpp @@ -30,65 +30,56 @@ #include "rviz_common/load_resource.hpp" -// #include -// #include -// #include +#include -#include -#include +#include // NOLINT: cpplint cannot handle the include order here +#include // NOLINT: cpplint cannot handle the include order here +#include // NOLINT: cpplint cannot handle the include order here + +#include "ament_index_cpp/get_package_share_directory.hpp" +#include "ament_index_cpp/get_package_prefix.hpp" +#include "resource_retriever/retriever.h" #include "rviz_common/logging.hpp" namespace rviz_common { -// TODO(wjwwood): replace this with ROS 2 and boost-free version -// boost::filesystem::path getPath(QString url) -// { -// boost::filesystem::path path; - -// if (url.indexOf("package://", 0, Qt::CaseInsensitive) == 0) { -// QString package_name = url.section('/', 2, 2); -// QString file_name = url.section('/', 3); -// path = ros::package::getPath(package_name.toStdString()); -// path = path / file_name.toStdString(); -// } else if (url.indexOf("file://", 0, Qt::CaseInsensitive) == 0) { -// path = url.section('/', 2).toStdString(); -// } else { -// ROS_ERROR("Invalid or unsupported URL: '%s'", url.toStdString().c_str() ); -// } - -// return path; -// } +resource_retriever::MemoryResource getResource(const std::string & resource_path) +{ + resource_retriever::Retriever retriever; + resource_retriever::MemoryResource res; + try { + res = retriever.get(resource_path); + } catch (resource_retriever::Exception & e) { + RVIZ_COMMON_LOG_DEBUG(e.what()); + return resource_retriever::MemoryResource(); + } + return res; +} QPixmap loadPixmap(QString url, bool fill_cache) { QPixmap pixmap; - // TODO(wjwwood): reenable this, or in the meantime add a placeholder pixmap - Q_UNUSED(url); - Q_UNUSED(fill_cache); - // RVIZ_COMMON_LOG_WARNING_STREAM("did not load pixmap at " << url.toStdString()); - // // if it's in the cache, no need to locate - // if (QPixmapCache::find(url, &pixmap) ) { - // return pixmap; - // } - - // boost::filesystem::path path = getPath(url); - - // // If something goes wrong here, we go on and store the empty pixmap, - // // so the error won't appear again anytime soon. - // if (boost::filesystem::exists(path) ) { - // ROS_DEBUG_NAMED("load_resource", "Loading '%s'", path.string().c_str() ); - // if (!pixmap.load(QString::fromStdString(path.string() ) ) ) { - // ROS_ERROR("Could not load pixmap '%s'", path.string().c_str() ); - // } - // } - - // if (fill_cache) { - // QPixmapCache::insert(url, pixmap); - // } + // if it's in the cache, no need to locate + if (QPixmapCache::find(url, &pixmap)) { + return pixmap; + } + + RVIZ_COMMON_LOG_DEBUG("Load pixmap at " + url.toStdString()); + + auto image = getResource(url.toStdString()); + if (image.size != 0) { + if (!pixmap.loadFromData(image.data.get(), static_cast(image.size))) { + RVIZ_COMMON_LOG_ERROR("Could not load pixmap " + url.toStdString()); + } + } + + if (fill_cache) { + QPixmapCache::insert(url, pixmap); + } return pixmap; } @@ -101,39 +92,25 @@ QCursor getDefaultCursor(bool fill_cache) QCursor makeIconCursor(QString url, bool fill_cache) { - // TODO(wjwwood): reenable this - Q_UNUSED(url); - Q_UNUSED(fill_cache); - // RVIZ_COMMON_LOG_WARNING_STREAM("did not load icon as cursor at " << url.toStdString()); - return QCursor(Qt::ArrowCursor); -#if 0 QPixmap icon = loadPixmap(url, fill_cache); if (icon.width() == 0 || icon.height() == 0) { - ROS_ERROR("Could not load pixmap '%s' -- using default cursor instead.", - url.toStdString().c_str() ); + RVIZ_COMMON_LOG_ERROR_STREAM("Could not load pixmap " << url.toStdString() << " -- " + "using default cursor instead."); return getDefaultCursor(); } QString cache_key = url + ".cursor"; return makeIconCursor(icon, cache_key, fill_cache); -#endif } QCursor makeIconCursor(QPixmap icon, QString cache_key, bool fill_cache) { - // TODO(wjwwood): reenable this - Q_UNUSED(icon); - Q_UNUSED(cache_key); - Q_UNUSED(fill_cache); - // RVIZ_COMMON_LOG_WARNING_STREAM("did not make icon into cursor at " << cache_key.toStdString()); - return QCursor(Qt::ArrowCursor); -#if 0 // if it's in the cache, no need to locate QPixmap cursor_img; if (QPixmapCache::find(cache_key, &cursor_img) ) { return QCursor(cursor_img, 0, 0); } - QPixmap base_cursor = loadPixmap("package://rviz/icons/cursor.svg", fill_cache); + QPixmap base_cursor = loadPixmap("package://rviz_common/icons/cursor.svg", fill_cache); const int cursor_size = 32; @@ -162,7 +139,6 @@ QCursor makeIconCursor(QPixmap icon, QString cache_key, bool fill_cache) } return QCursor(cursor_img, 1, 1); -#endif } } // namespace rviz_common diff --git a/rviz_common/src/rviz_common/new_object_dialog.cpp b/rviz_common/src/rviz_common/new_object_dialog.cpp index 73964d8cd..a22598494 100644 --- a/rviz_common/src/rviz_common/new_object_dialog.cpp +++ b/rviz_common/src/rviz_common/new_object_dialog.cpp @@ -126,7 +126,7 @@ QSize NewObjectDialog::sizeHint() const void NewObjectDialog::fillTree(QTreeWidget * tree) { - QIcon default_package_icon = loadPixmap("package://rviz/icons/default_package_icon.png"); + QIcon default_package_icon = loadPixmap("package://rviz_common/icons/default_package_icon.png"); QStringList classes = factory_->getDeclaredClassIds(); classes.sort(); diff --git a/rviz_common/src/rviz_common/panel_factory.cpp b/rviz_common/src/rviz_common/panel_factory.cpp index e722d407c..e76c97404 100644 --- a/rviz_common/src/rviz_common/panel_factory.cpp +++ b/rviz_common/src/rviz_common/panel_factory.cpp @@ -52,20 +52,20 @@ static Panel * newViewsPanel() {return new ViewsPanel();} PanelFactory::PanelFactory(const std::string & node_name) : PluginlibFactory("rviz_common", "rviz_common::Panel") { - addBuiltInClass("rviz", "Displays", + addBuiltInClass("rviz_common", "Displays", "Show and edit the list of Displays", [&node_name]() -> Panel * { return new DisplaysPanel(node_name, nullptr); }); - // addBuiltInClass("rviz", "Help", + // addBuiltInClass("rviz_common", "Help", // "Show the key and mouse bindings", &newHelpPanel); - // addBuiltInClass("rviz", "Selection", + // addBuiltInClass("rviz_common", "Selection", // "Show properties of selected objects", &newSelectionPanel); - // addBuiltInClass("rviz", "Time", + // addBuiltInClass("rviz_common", "Time", // "Show the current time", &newTimePanel); - // addBuiltInClass("rviz", "Tool Properties", + // addBuiltInClass("rviz_common", "Tool Properties", // "Show and edit properties of tools", &newToolPropertiesPanel); - addBuiltInClass("rviz", "Views", + addBuiltInClass("rviz_common", "Views", "Show and edit viewpoints", &newViewsPanel); } diff --git a/rviz_common/src/rviz_common/pluginlib_factory.hpp b/rviz_common/src/rviz_common/pluginlib_factory.hpp index cda5e954a..b98e7b0e0 100644 --- a/rviz_common/src/rviz_common/pluginlib_factory.hpp +++ b/rviz_common/src/rviz_common/pluginlib_factory.hpp @@ -132,7 +132,7 @@ class PluginlibFactory : public ClassIdRecordingFactory if (icon.isNull()) { icon = loadPixmap("package://" + package + "/icons/classes/" + class_name + ".png"); if (icon.isNull()) { - icon = loadPixmap("package://rviz/icons/default_class_icon.png"); + icon = loadPixmap("package://rviz_common/icons/default_class_icon.png"); } } return icon; diff --git a/rviz_common/src/rviz_common/properties/status_property.cpp b/rviz_common/src/rviz_common/properties/status_property.cpp index 3d4bb07bc..39da9dbc1 100644 --- a/rviz_common/src/rviz_common/properties/status_property.cpp +++ b/rviz_common/src/rviz_common/properties/status_property.cpp @@ -51,9 +51,9 @@ StatusProperty::StatusProperty( level_(level) { setShouldBeSaved(false); - status_icons_[0] = loadPixmap("package://rviz/icons/ok.png"); - status_icons_[1] = loadPixmap("package://rviz/icons/warning.png"); - status_icons_[2] = loadPixmap("package://rviz/icons/error.png"); + status_icons_[0] = loadPixmap("package://rviz_common/icons/ok.png"); + status_icons_[1] = loadPixmap("package://rviz_common/icons/warning.png"); + status_icons_[2] = loadPixmap("package://rviz_common/icons/error.png"); } bool StatusProperty::setValue(const QVariant & new_value) diff --git a/rviz_common/src/rviz_common/splash_screen.cpp b/rviz_common/src/rviz_common/splash_screen.cpp index c6b3c472b..e825b41f8 100644 --- a/rviz_common/src/rviz_common/splash_screen.cpp +++ b/rviz_common/src/rviz_common/splash_screen.cpp @@ -52,7 +52,7 @@ SplashScreen::SplashScreen(const QPixmap & pixmap) painter.drawPixmap(QPoint(0, 0), pixmap); - QPixmap overlay = loadPixmap("package://rviz/images/splash_overlay.png"); + QPixmap overlay = loadPixmap("package://rviz_common/images/splash_overlay.png"); painter.drawTiledPixmap(QRect(0, pixmap.height() - overlay.height(), pixmap.width(), pixmap.height() ), overlay); diff --git a/rviz_common/src/rviz_common/tool_manager.cpp b/rviz_common/src/rviz_common/tool_manager.cpp index 63982e537..a1be98e64 100644 --- a/rviz_common/src/rviz_common/tool_manager.cpp +++ b/rviz_common/src/rviz_common/tool_manager.cpp @@ -78,11 +78,11 @@ void ToolManager::initialize() QStringList class_ids = factory_->getDeclaredClassIds(); // define a list of preferred tool names (they will be listed first in the toolbar) std::vector preferred_tool_names = { - "rviz/MoveCamera", - "rviz/Interact", - "rviz/Select", - "rviz/SetInitialPose", - "rviz/SetGoal", + "rviz_default_plugins/MoveCamera", + "rviz_default_plugins/Interact", + "rviz_default_plugins/Select", + "rviz_default_plugins/SetInitialPose", + "rviz_default_plugins/SetGoal", }; // attempt to load each preferred tool in order for (const auto & preferred_tool_name : preferred_tool_names) { @@ -272,7 +272,7 @@ Tool * ToolManager::addTool(const QString & class_id) return tool; #else - if (class_id == "rviz/MoveCamera") { + if (class_id == "rviz_default_plugins/MoveCamera") { Tool * tool = new rviz_common::MoveTool(); tools_.append(tool); tool->setName(addSpaceToCamelCase("MoveTool")); diff --git a/rviz_common/src/rviz_common/view_controller.cpp b/rviz_common/src/rviz_common/view_controller.cpp index c0a64a915..818832200 100644 --- a/rviz_common/src/rviz_common/view_controller.cpp +++ b/rviz_common/src/rviz_common/view_controller.cpp @@ -116,12 +116,12 @@ void ViewController::initialize(DisplayContext * context) cursor_ = getDefaultCursor(); standard_cursors_[Default] = getDefaultCursor(); - standard_cursors_[Rotate2D] = makeIconCursor("package://rviz/icons/rotate.svg"); - standard_cursors_[Rotate3D] = makeIconCursor("package://rviz/icons/rotate_cam.svg"); - standard_cursors_[MoveXY] = makeIconCursor("package://rviz/icons/move2d.svg"); - standard_cursors_[MoveZ] = makeIconCursor("package://rviz/icons/move_z.svg"); - standard_cursors_[Zoom] = makeIconCursor("package://rviz/icons/zoom.svg"); - standard_cursors_[Crosshair] = makeIconCursor("package://rviz/icons/crosshair.svg"); + standard_cursors_[Rotate2D] = makeIconCursor("package://rviz_common/icons/rotate.svg"); + standard_cursors_[Rotate3D] = makeIconCursor("package://rviz_common/icons/rotate_cam.svg"); + standard_cursors_[MoveXY] = makeIconCursor("package://rviz_common/icons/move2d.svg"); + standard_cursors_[MoveZ] = makeIconCursor("package://rviz_common/icons/move_z.svg"); + standard_cursors_[Zoom] = makeIconCursor("package://rviz_common/icons/zoom.svg"); + standard_cursors_[Crosshair] = makeIconCursor("package://rviz_common/icons/crosshair.svg"); updateNearClipDistance(); updateStereoProperties(); diff --git a/rviz_common/src/rviz_common/view_manager.cpp b/rviz_common/src/rviz_common/view_manager.cpp index b00f8eb4a..9dfd46f8c 100644 --- a/rviz_common/src/rviz_common/view_manager.cpp +++ b/rviz_common/src/rviz_common/view_manager.cpp @@ -81,7 +81,7 @@ ViewManager::~ViewManager() void ViewManager::initialize() { - setCurrent(create("rviz/Orbit"), false); + setCurrent(create("rviz_default_plugins/Orbit"), false); } void ViewManager::update(float wall_dt, float ros_dt) diff --git a/rviz_common/src/rviz_common/visualization_frame.cpp b/rviz_common/src/rviz_common/visualization_frame.cpp index 3d43400a8..21dfaa3bd 100644 --- a/rviz_common/src/rviz_common/visualization_frame.cpp +++ b/rviz_common/src/rviz_common/visualization_frame.cpp @@ -30,6 +30,7 @@ #include "visualization_frame.hpp" +#include #include #include #include @@ -519,7 +520,7 @@ void VisualizationFrame::initToolbars() add_tool_action_ = new QAction("", toolbar_actions_); add_tool_action_->setToolTip("Add a new tool"); - add_tool_action_->setIcon(loadPixmap("package://rviz/icons/plus.png")); + add_tool_action_->setIcon(loadPixmap("package://rviz_common/icons/plus.png")); toolbar_->addAction(add_tool_action_); connect(add_tool_action_, SIGNAL(triggered()), this, SLOT(openNewToolDialog())); @@ -528,7 +529,7 @@ void VisualizationFrame::initToolbars() remove_tool_button->setMenu(remove_tool_menu_); remove_tool_button->setPopupMode(QToolButton::InstantPopup); remove_tool_button->setToolTip("Remove a tool from the toolbar"); - remove_tool_button->setIcon(loadPixmap("package://rviz/icons/minus.png")); + remove_tool_button->setIcon(loadPixmap("package://rviz_common/icons/minus.png")); toolbar_->addWidget(remove_tool_button); connect(remove_tool_menu_, SIGNAL(triggered(QAction *)), this, SLOT(onToolbarRemoveTool( QAction *))); @@ -707,7 +708,11 @@ void VisualizationFrame::loadDisplayConfig(const QString & qpath) Config config; reader.readFile(config, QString::fromStdString(actual_load_path)); if (!reader.error()) { - load(config); + try { + load(config); + } catch (const std::exception & e) { + RVIZ_COMMON_LOG_ERROR_STREAM("Could not load display config: " << e.what()); + } } markRecentConfig(path); diff --git a/rviz_common/src/rviz_common/visualization_manager.cpp b/rviz_common/src/rviz_common/visualization_manager.cpp index 5d9ead465..9d40fead0 100644 --- a/rviz_common/src/rviz_common/visualization_manager.cpp +++ b/rviz_common/src/rviz_common/visualization_manager.cpp @@ -195,7 +195,7 @@ VisualizationManager::VisualizationManager( IconizedProperty * ip = new IconizedProperty("Global Options", QVariant(), "", root_display_group_); - ip->setIcon(loadPixmap("package://rviz/icons/options.png")); + ip->setIcon(loadPixmap("package://rviz_common/icons/options.png")); global_options_ = ip; fixed_frame_property_ = new TfFrameProperty("Fixed Frame", "base_link", @@ -628,6 +628,7 @@ void VisualizationManager::handleMouseEvent(const ViewportMouseEvent & vme) #endif flags = current_tool->processMouseEvent(_vme); vme.panel->setCursor(current_tool->getCursor()); + vme.panel->getRenderWindow()->setCursor(current_tool->getCursor()); } else { vme.panel->setCursor(QCursor(Qt::ArrowCursor)); } diff --git a/rviz_default_plugins/CMakeLists.txt b/rviz_default_plugins/CMakeLists.txt index ba0ab9ab6..cb88cc53c 100644 --- a/rviz_default_plugins/CMakeLists.txt +++ b/rviz_default_plugins/CMakeLists.txt @@ -158,6 +158,11 @@ install( INCLUDES DESTINATION include ) +install( + DIRECTORY "${CMAKE_SOURCE_DIR}/icons" + DESTINATION "share/${PROJECT_NAME}" +) + if(BUILD_TESTING) # TODO(wjwwood): replace this with ament_lint_auto() and/or add the copyright linter back find_package(ament_cmake_cppcheck REQUIRED) diff --git a/rviz/icons/classes/Axes.png b/rviz_default_plugins/icons/classes/Axes.png similarity index 100% rename from rviz/icons/classes/Axes.png rename to rviz_default_plugins/icons/classes/Axes.png diff --git a/rviz/icons/classes/Camera.png b/rviz_default_plugins/icons/classes/Camera.png similarity index 100% rename from rviz/icons/classes/Camera.png rename to rviz_default_plugins/icons/classes/Camera.png diff --git a/rviz/icons/classes/DepthCloud.png b/rviz_default_plugins/icons/classes/DepthCloud.png similarity index 100% rename from rviz/icons/classes/DepthCloud.png rename to rviz_default_plugins/icons/classes/DepthCloud.png diff --git a/rviz/icons/classes/Effort.png b/rviz_default_plugins/icons/classes/Effort.png similarity index 100% rename from rviz/icons/classes/Effort.png rename to rviz_default_plugins/icons/classes/Effort.png diff --git a/rviz/icons/classes/FluidPressure.png b/rviz_default_plugins/icons/classes/FluidPressure.png similarity index 100% rename from rviz/icons/classes/FluidPressure.png rename to rviz_default_plugins/icons/classes/FluidPressure.png diff --git a/rviz/icons/classes/FocusCamera.svg b/rviz_default_plugins/icons/classes/FocusCamera.svg similarity index 100% rename from rviz/icons/classes/FocusCamera.svg rename to rviz_default_plugins/icons/classes/FocusCamera.svg diff --git a/rviz/icons/classes/Grid.png b/rviz_default_plugins/icons/classes/Grid.png similarity index 100% rename from rviz/icons/classes/Grid.png rename to rviz_default_plugins/icons/classes/Grid.png diff --git a/rviz/icons/classes/GridCells.png b/rviz_default_plugins/icons/classes/GridCells.png similarity index 100% rename from rviz/icons/classes/GridCells.png rename to rviz_default_plugins/icons/classes/GridCells.png diff --git a/rviz/icons/classes/Help.svg b/rviz_default_plugins/icons/classes/Help.svg similarity index 100% rename from rviz/icons/classes/Help.svg rename to rviz_default_plugins/icons/classes/Help.svg diff --git a/rviz/icons/classes/Illuminance.png b/rviz_default_plugins/icons/classes/Illuminance.png similarity index 100% rename from rviz/icons/classes/Illuminance.png rename to rviz_default_plugins/icons/classes/Illuminance.png diff --git a/rviz/icons/classes/Image.png b/rviz_default_plugins/icons/classes/Image.png similarity index 100% rename from rviz/icons/classes/Image.png rename to rviz_default_plugins/icons/classes/Image.png diff --git a/rviz/icons/classes/Interact.png b/rviz_default_plugins/icons/classes/Interact.png similarity index 100% rename from rviz/icons/classes/Interact.png rename to rviz_default_plugins/icons/classes/Interact.png diff --git a/rviz/icons/classes/InteractiveMarkers.png b/rviz_default_plugins/icons/classes/InteractiveMarkers.png similarity index 100% rename from rviz/icons/classes/InteractiveMarkers.png rename to rviz_default_plugins/icons/classes/InteractiveMarkers.png diff --git a/rviz/icons/classes/LaserScan.png b/rviz_default_plugins/icons/classes/LaserScan.png similarity index 100% rename from rviz/icons/classes/LaserScan.png rename to rviz_default_plugins/icons/classes/LaserScan.png diff --git a/rviz/icons/classes/Map.png b/rviz_default_plugins/icons/classes/Map.png similarity index 100% rename from rviz/icons/classes/Map.png rename to rviz_default_plugins/icons/classes/Map.png diff --git a/rviz/icons/classes/Marker.png b/rviz_default_plugins/icons/classes/Marker.png similarity index 100% rename from rviz/icons/classes/Marker.png rename to rviz_default_plugins/icons/classes/Marker.png diff --git a/rviz/icons/classes/MarkerArray.png b/rviz_default_plugins/icons/classes/MarkerArray.png similarity index 100% rename from rviz/icons/classes/MarkerArray.png rename to rviz_default_plugins/icons/classes/MarkerArray.png diff --git a/rviz/icons/classes/Measure.svg b/rviz_default_plugins/icons/classes/Measure.svg similarity index 100% rename from rviz/icons/classes/Measure.svg rename to rviz_default_plugins/icons/classes/Measure.svg diff --git a/rviz/icons/classes/MoveCamera.png b/rviz_default_plugins/icons/classes/MoveCamera.png similarity index 100% rename from rviz/icons/classes/MoveCamera.png rename to rviz_default_plugins/icons/classes/MoveCamera.png diff --git a/rviz/icons/classes/Odometry.png b/rviz_default_plugins/icons/classes/Odometry.png similarity index 100% rename from rviz/icons/classes/Odometry.png rename to rviz_default_plugins/icons/classes/Odometry.png diff --git a/rviz/icons/classes/Path.png b/rviz_default_plugins/icons/classes/Path.png similarity index 100% rename from rviz/icons/classes/Path.png rename to rviz_default_plugins/icons/classes/Path.png diff --git a/rviz/icons/classes/PointCloud.png b/rviz_default_plugins/icons/classes/PointCloud.png similarity index 100% rename from rviz/icons/classes/PointCloud.png rename to rviz_default_plugins/icons/classes/PointCloud.png diff --git a/rviz/icons/classes/PointCloud2.png b/rviz_default_plugins/icons/classes/PointCloud2.png similarity index 100% rename from rviz/icons/classes/PointCloud2.png rename to rviz_default_plugins/icons/classes/PointCloud2.png diff --git a/rviz/icons/classes/PointStamped.png b/rviz_default_plugins/icons/classes/PointStamped.png similarity index 100% rename from rviz/icons/classes/PointStamped.png rename to rviz_default_plugins/icons/classes/PointStamped.png diff --git a/rviz/icons/classes/Polygon.png b/rviz_default_plugins/icons/classes/Polygon.png similarity index 100% rename from rviz/icons/classes/Polygon.png rename to rviz_default_plugins/icons/classes/Polygon.png diff --git a/rviz/icons/classes/Pose.png b/rviz_default_plugins/icons/classes/Pose.png similarity index 100% rename from rviz/icons/classes/Pose.png rename to rviz_default_plugins/icons/classes/Pose.png diff --git a/rviz/icons/classes/PoseArray.png b/rviz_default_plugins/icons/classes/PoseArray.png similarity index 100% rename from rviz/icons/classes/PoseArray.png rename to rviz_default_plugins/icons/classes/PoseArray.png diff --git a/rviz/icons/classes/PublishPoint.svg b/rviz_default_plugins/icons/classes/PublishPoint.svg similarity index 100% rename from rviz/icons/classes/PublishPoint.svg rename to rviz_default_plugins/icons/classes/PublishPoint.svg diff --git a/rviz/icons/classes/Range.png b/rviz_default_plugins/icons/classes/Range.png similarity index 100% rename from rviz/icons/classes/Range.png rename to rviz_default_plugins/icons/classes/Range.png diff --git a/rviz/icons/classes/RelativeHumidity.png b/rviz_default_plugins/icons/classes/RelativeHumidity.png similarity index 100% rename from rviz/icons/classes/RelativeHumidity.png rename to rviz_default_plugins/icons/classes/RelativeHumidity.png diff --git a/rviz/icons/classes/RobotJoint.png b/rviz_default_plugins/icons/classes/RobotJoint.png similarity index 100% rename from rviz/icons/classes/RobotJoint.png rename to rviz_default_plugins/icons/classes/RobotJoint.png diff --git a/rviz/icons/classes/RobotLink.png b/rviz_default_plugins/icons/classes/RobotLink.png similarity index 100% rename from rviz/icons/classes/RobotLink.png rename to rviz_default_plugins/icons/classes/RobotLink.png diff --git a/rviz/icons/classes/RobotLinkNoGeom.png b/rviz_default_plugins/icons/classes/RobotLinkNoGeom.png similarity index 100% rename from rviz/icons/classes/RobotLinkNoGeom.png rename to rviz_default_plugins/icons/classes/RobotLinkNoGeom.png diff --git a/rviz/icons/classes/RobotModel.png b/rviz_default_plugins/icons/classes/RobotModel.png similarity index 100% rename from rviz/icons/classes/RobotModel.png rename to rviz_default_plugins/icons/classes/RobotModel.png diff --git a/rviz/icons/classes/Select.png b/rviz_default_plugins/icons/classes/Select.png similarity index 100% rename from rviz/icons/classes/Select.png rename to rviz_default_plugins/icons/classes/Select.png diff --git a/rviz/icons/classes/Selection.png b/rviz_default_plugins/icons/classes/Selection.png similarity index 100% rename from rviz/icons/classes/Selection.png rename to rviz_default_plugins/icons/classes/Selection.png diff --git a/rviz/icons/classes/SetGoal.png b/rviz_default_plugins/icons/classes/SetGoal.png similarity index 100% rename from rviz/icons/classes/SetGoal.png rename to rviz_default_plugins/icons/classes/SetGoal.png diff --git a/rviz/icons/classes/SetInitialPose.png b/rviz_default_plugins/icons/classes/SetInitialPose.png similarity index 100% rename from rviz/icons/classes/SetInitialPose.png rename to rviz_default_plugins/icons/classes/SetInitialPose.png diff --git a/rviz/icons/classes/TF.png b/rviz_default_plugins/icons/classes/TF.png similarity index 100% rename from rviz/icons/classes/TF.png rename to rviz_default_plugins/icons/classes/TF.png diff --git a/rviz/icons/classes/Temperature.png b/rviz_default_plugins/icons/classes/Temperature.png similarity index 100% rename from rviz/icons/classes/Temperature.png rename to rviz_default_plugins/icons/classes/Temperature.png diff --git a/rviz/icons/classes/Time.svg b/rviz_default_plugins/icons/classes/Time.svg similarity index 100% rename from rviz/icons/classes/Time.svg rename to rviz_default_plugins/icons/classes/Time.svg diff --git a/rviz/icons/classes/Tool Properties.png b/rviz_default_plugins/icons/classes/Tool Properties.png similarity index 100% rename from rviz/icons/classes/Tool Properties.png rename to rviz_default_plugins/icons/classes/Tool Properties.png diff --git a/rviz/icons/classes/WrenchStamped.png b/rviz_default_plugins/icons/classes/WrenchStamped.png similarity index 100% rename from rviz/icons/classes/WrenchStamped.png rename to rviz_default_plugins/icons/classes/WrenchStamped.png diff --git a/rviz/icons/classes/src/Arrow.xcf b/rviz_default_plugins/icons/classes/src/Arrow.xcf similarity index 100% rename from rviz/icons/classes/src/Arrow.xcf rename to rviz_default_plugins/icons/classes/src/Arrow.xcf diff --git a/rviz/icons/classes/src/Axes.xcf b/rviz_default_plugins/icons/classes/src/Axes.xcf similarity index 100% rename from rviz/icons/classes/src/Axes.xcf rename to rviz_default_plugins/icons/classes/src/Axes.xcf diff --git a/rviz/icons/classes/src/GridCells.xcf b/rviz_default_plugins/icons/classes/src/GridCells.xcf similarity index 100% rename from rviz/icons/classes/src/GridCells.xcf rename to rviz_default_plugins/icons/classes/src/GridCells.xcf diff --git a/rviz/icons/classes/src/InteractiveMarker.xcf b/rviz_default_plugins/icons/classes/src/InteractiveMarker.xcf similarity index 100% rename from rviz/icons/classes/src/InteractiveMarker.xcf rename to rviz_default_plugins/icons/classes/src/InteractiveMarker.xcf diff --git a/rviz/icons/classes/src/Map.xcf b/rviz_default_plugins/icons/classes/src/Map.xcf similarity index 100% rename from rviz/icons/classes/src/Map.xcf rename to rviz_default_plugins/icons/classes/src/Map.xcf diff --git a/rviz/icons/classes/src/MarkerArray.xcf b/rviz_default_plugins/icons/classes/src/MarkerArray.xcf similarity index 100% rename from rviz/icons/classes/src/MarkerArray.xcf rename to rviz_default_plugins/icons/classes/src/MarkerArray.xcf diff --git a/rviz/icons/classes/src/Poly.xcf b/rviz_default_plugins/icons/classes/src/Poly.xcf similarity index 100% rename from rviz/icons/classes/src/Poly.xcf rename to rviz_default_plugins/icons/classes/src/Poly.xcf diff --git a/rviz/icons/classes/src/Polygon.xcf b/rviz_default_plugins/icons/classes/src/Polygon.xcf similarity index 100% rename from rviz/icons/classes/src/Polygon.xcf rename to rviz_default_plugins/icons/classes/src/Polygon.xcf diff --git a/rviz/icons/classes/src/PoseArray.xcf b/rviz_default_plugins/icons/classes/src/PoseArray.xcf similarity index 100% rename from rviz/icons/classes/src/PoseArray.xcf rename to rviz_default_plugins/icons/classes/src/PoseArray.xcf diff --git a/rviz/icons/classes/src/Range.xcf b/rviz_default_plugins/icons/classes/src/Range.xcf similarity index 100% rename from rviz/icons/classes/src/Range.xcf rename to rviz_default_plugins/icons/classes/src/Range.xcf diff --git a/rviz/icons/classes/src/RobotModel.xcf b/rviz_default_plugins/icons/classes/src/RobotModel.xcf similarity index 100% rename from rviz/icons/classes/src/RobotModel.xcf rename to rviz_default_plugins/icons/classes/src/RobotModel.xcf diff --git a/rviz/icons/classes/src/TF.xcf b/rviz_default_plugins/icons/classes/src/TF.xcf similarity index 100% rename from rviz/icons/classes/src/TF.xcf rename to rviz_default_plugins/icons/classes/src/TF.xcf diff --git a/rviz/icons/visibility.svg b/rviz_default_plugins/icons/visibility.svg similarity index 100% rename from rviz/icons/visibility.svg rename to rviz_default_plugins/icons/visibility.svg diff --git a/rviz_default_plugins/plugins_description.xml b/rviz_default_plugins/plugins_description.xml index b499d6e60..3199a95ce 100644 --- a/rviz_default_plugins/plugins_description.xml +++ b/rviz_default_plugins/plugins_description.xml @@ -3,7 +3,7 @@ @@ -15,7 +15,7 @@ @@ -25,7 +25,7 @@ @@ -36,7 +36,7 @@ @@ -47,7 +47,7 @@ @@ -58,7 +58,7 @@ @@ -69,7 +69,7 @@ @@ -80,7 +80,7 @@ @@ -90,7 +90,7 @@ @@ -101,9 +101,9 @@ Displays visualization_msgs::Marker messages. <a href="http://www.ros.org/wiki/rviz/DisplayTypes/Marker">More Information</a>. @@ -111,9 +111,9 @@ 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>. @@ -135,7 +135,7 @@ @@ -147,7 +147,7 @@ diff --git a/rviz_default_plugins/src/rviz_default_plugins/displays/camera/camera_display.cpp b/rviz_default_plugins/src/rviz_default_plugins/displays/camera/camera_display.cpp index 124705759..1c3e7388d 100644 --- a/rviz_default_plugins/src/rviz_default_plugins/displays/camera/camera_display.cpp +++ b/rviz_default_plugins/src/rviz_default_plugins/displays/camera/camera_display.cpp @@ -145,7 +145,7 @@ void CameraDisplay::onInitialize() "Changes the visibility of other Displays in the camera view."); visibility_property_->setIcon( - rviz_common::loadPixmap("package://rviz/icons/visibility.svg", true)); + rviz_common::loadPixmap("package://rviz_default_plugins/icons/visibility.svg", true)); this->addChild(visibility_property_, 0); } diff --git a/rviz_default_plugins/src/rviz_default_plugins/robot/robot_joint.cpp b/rviz_default_plugins/src/rviz_default_plugins/robot/robot_joint.cpp index 71bdaac0a..8cf1953ef 100644 --- a/rviz_default_plugins/src/rviz_default_plugins/robot/robot_joint.cpp +++ b/rviz_default_plugins/src/rviz_default_plugins/robot/robot_joint.cpp @@ -86,7 +86,7 @@ RobotJoint::RobotJoint(Robot * robot, const urdf::JointConstSharedPtr & joint) SLOT(updateChildVisibility()), this); robot_element_property_->setIcon(rviz_common::loadPixmap( - "package://rviz/icons/classes/RobotJoint.png")); + "package://rviz_default_plugins/icons/classes/RobotJoint.png")); details_ = new Property("Details", QVariant(), "", nullptr); diff --git a/rviz_default_plugins/src/rviz_default_plugins/robot/robot_link.cpp b/rviz_default_plugins/src/rviz_default_plugins/robot/robot_link.cpp index a48ea455f..a778eb9a3 100644 --- a/rviz_default_plugins/src/rviz_default_plugins/robot/robot_link.cpp +++ b/rviz_default_plugins/src/rviz_default_plugins/robot/robot_link.cpp @@ -230,7 +230,7 @@ RobotLink::RobotLink( if (!hasGeometry()) { robot_element_property_->setIcon(rviz_common::loadPixmap( - "package://rviz/icons/classes/RobotLinkNoGeom.png")); + "package://rviz_default_plugins/icons/classes/RobotLinkNoGeom.png")); alpha_property_->hide(); robot_element_property_->setValue(QVariant()); } @@ -241,7 +241,7 @@ void RobotLink::setProperties(const urdf::LinkConstSharedPtr & link) robot_element_property_ = new Property( link->name.c_str(), true, "", nullptr, SLOT(updateVisibility()), this); robot_element_property_->setIcon(rviz_common::loadPixmap( - "package://rviz/icons/classes/RobotLink.png")); + "package://rviz_default_plugins/icons/classes/RobotLink.png")); details_ = new Property("Details", QVariant(), "", nullptr); diff --git a/rviz_default_plugins/src/rviz_default_plugins/tools/move/move_tool.cpp b/rviz_default_plugins/src/rviz_default_plugins/tools/move/move_tool.cpp index e7e2d630f..d69e965e2 100644 --- a/rviz_default_plugins/src/rviz_default_plugins/tools/move/move_tool.cpp +++ b/rviz_default_plugins/src/rviz_default_plugins/tools/move/move_tool.cpp @@ -47,7 +47,7 @@ MoveTool::MoveTool() { shortcut_key_ = 'm'; // this is needed as the move tool is instantiated by other tools - setIcon(rviz_common::loadPixmap("package://rviz/icons/classes/MoveCamera.png")); + setIcon(rviz_common::loadPixmap("package://rviz_default_plugins/icons/classes/MoveCamera.png")); } MoveTool::~MoveTool() diff --git a/rviz_default_plugins/src/rviz_default_plugins/view_controllers/orbit/orbit_view_controller.cpp b/rviz_default_plugins/src/rviz_default_plugins/view_controllers/orbit/orbit_view_controller.cpp index 0ee14026e..607d8bbd3 100644 --- a/rviz_default_plugins/src/rviz_default_plugins/view_controllers/orbit/orbit_view_controller.cpp +++ b/rviz_default_plugins/src/rviz_default_plugins/view_controllers/orbit/orbit_view_controller.cpp @@ -224,7 +224,7 @@ void OrbitViewController::mimic(rviz_common::ViewController * source_view) Ogre::Vector3 position = camera_parent->getPosition(); Ogre::Quaternion orientation = camera_parent->getOrientation(); - if (source_view->getClassId() == "rviz/Orbit") { + if (source_view->getClassId() == "rviz_default_plugin/Orbit") { // If I'm initializing from another instance of this same class, get the distance exactly. distance_property_->setFloat(source_view->subProp("Distance")->getValue().toFloat()); updateFocalShapeSize(); diff --git a/rviz_rendering/CMakeLists.txt b/rviz_rendering/CMakeLists.txt index 75f4d492a..29c8ef7a7 100644 --- a/rviz_rendering/CMakeLists.txt +++ b/rviz_rendering/CMakeLists.txt @@ -159,7 +159,7 @@ install(DIRECTORY src/cmake # install(TARGETS rendering_example DESTINATION bin) install(DIRECTORY "${CMAKE_SOURCE_DIR}/ogre_media" - DESTINATION "share/rviz_rendering" + DESTINATION "share/${PROJECT_NAME}" USE_SOURCE_PERMISSIONS) if(BUILD_TESTING)