From 8073c410586fc474daa76daaffd6b5a7aec32783 Mon Sep 17 00:00:00 2001
From: Martin Idel
Date: Mon, 4 Jun 2018 04:57:12 +0200
Subject: [PATCH 1/8] move splash images and make work again
---
rviz_common/CMakeLists.txt | 5 +++++
{rviz => rviz_common}/images/splash.png | Bin
{rviz => rviz_common}/images/splash_overlay.png | Bin
rviz_common/src/rviz_common/visualization_frame.cpp | 4 ++--
4 files changed, 7 insertions(+), 2 deletions(-)
rename {rviz => rviz_common}/images/splash.png (100%)
rename {rviz => rviz_common}/images/splash_overlay.png (100%)
diff --git a/rviz_common/CMakeLists.txt b/rviz_common/CMakeLists.txt
index 9e5c5e385..2e3c91c26 100644
--- a/rviz_common/CMakeLists.txt
+++ b/rviz_common/CMakeLists.txt
@@ -288,6 +288,11 @@ install(
DESTINATION "share/${PROJECT_NAME}"
)
+install(
+ DIRECTORY "${CMAKE_SOURCE_DIR}/images"
+ 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/images/splash.png b/rviz_common/images/splash.png
similarity index 100%
rename from rviz/images/splash.png
rename to rviz_common/images/splash.png
diff --git a/rviz/images/splash_overlay.png b/rviz_common/images/splash_overlay.png
similarity index 100%
rename from rviz/images/splash_overlay.png
rename to rviz_common/images/splash_overlay.png
diff --git a/rviz_common/src/rviz_common/visualization_frame.cpp b/rviz_common/src/rviz_common/visualization_frame.cpp
index 68544da28..e5fe9dc4a 100644
--- a/rviz_common/src/rviz_common/visualization_frame.cpp
+++ b/rviz_common/src/rviz_common/visualization_frame.cpp
@@ -131,7 +131,7 @@ VisualizationFrame::VisualizationFrame(
package_path_ = ament_index_cpp::get_package_share_directory("rviz_common");
QDir help_path(QString::fromStdString(package_path_) + "/help/help.html");
help_path_ = help_path.absolutePath();
- QDir splash_path(QString::fromStdString(package_path_) + "images/splash.png");
+ QDir splash_path(QString::fromStdString(package_path_) + "/images/splash.png");
splash_path_ = splash_path.absolutePath();
auto * reset_button = new QToolButton();
@@ -365,7 +365,7 @@ void VisualizationFrame::initialize(
if (app_) {app_->processEvents();}
delete splash_;
- splash_ = 0;
+ splash_ = nullptr;
manager_->startUpdate();
initialized_ = true;
From 07736c58e2e9720a1eb860e0e3de431eb7a30694 Mon Sep 17 00:00:00 2001
From: Martin Idel
Date: Mon, 4 Jun 2018 05:02:41 +0200
Subject: [PATCH 2/8] Reenable splash screen option
---
.../src/rviz_common/visualizer_app.cpp | 24 ++++++++-----------
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/rviz_common/src/rviz_common/visualizer_app.cpp b/rviz_common/src/rviz_common/visualizer_app.cpp
index b375d27e4..532132f02 100644
--- a/rviz_common/src/rviz_common/visualizer_app.cpp
+++ b/rviz_common/src/rviz_common/visualizer_app.cpp
@@ -171,13 +171,12 @@ bool VisualizerApp::init(int argc, char ** argv)
"Enable the Ogre.log file (output in cwd) and console output.");
parser.addOption(ogre_log_option);
- // TODO(botteroa-si): enable when possible
-// QCommandLineOption splash_screen_option(
-// QStringList() << "s" << "splash-screen",
-// "A custom splash-screen image to display",
-// "splash_path");
-// parser.addOption(splash_screen_option);
-//
+ QCommandLineOption splash_screen_option(
+ QStringList() << "s" << "splash-screen",
+ "A custom splash-screen image to display", "splash_path");
+ parser.addOption(splash_screen_option);
+
+// TODO(botteroa-si): enable when possible
// QCommandLineOption help_file_option(
// "help-file", "A custom html file to show as the help screen", "help_path");
// parser.addOption(help_file_option);
@@ -222,16 +221,13 @@ bool VisualizerApp::init(int argc, char ** argv)
fixed_frame = parser.value(fixed_frame_option);
}
- // TODO(botteroa-si): enable when possible
-// if (parser.isSet(splash_screen_option)) {
-// splash_path = parser.value(splash_screen_option);
-// }
+ if (parser.isSet(splash_screen_option)) {
+ splash_path = parser.value(splash_screen_option);
+ }
+// TODO(botteroa-si): enable when possible
// if (parser.isSet(help_file_option)) {
// help_path = parser.value(help_file_option);
// }
-// if (parser.isSet(splash_screen_option)) {
-// splash_path = parser.value(splash_screen_option);
-// }
// if (parser.isSet(open_gl_option)) {
// force_gl_version = parser.value(open_gl_option).toInt();
// }
From f104f54ed41c82ae3cccad10ea17c627d1bb1144 Mon Sep 17 00:00:00 2001
From: Martin Idel
Date: Mon, 4 Jun 2018 05:13:54 +0200
Subject: [PATCH 3/8] Make Help Panel work again
---
rviz_common/CMakeLists.txt | 10 +++++---
rviz_common/default.rviz | 10 ++++----
{rviz => rviz_common}/help/help.html | 0
.../icons/classes/Help.svg | 0
rviz_common/src/rviz_common/help_panel.cpp | 23 ++++++++-----------
rviz_common/src/rviz_common/help_panel.hpp | 6 ++---
rviz_common/src/rviz_common/panel_factory.cpp | 8 +++----
.../src/rviz_common/selection_panel.hpp | 2 --
.../src/rviz_common/visualization_frame.cpp | 7 ++----
9 files changed, 30 insertions(+), 36 deletions(-)
rename {rviz => rviz_common}/help/help.html (100%)
rename {rviz_default_plugins => rviz_common}/icons/classes/Help.svg (100%)
diff --git a/rviz_common/CMakeLists.txt b/rviz_common/CMakeLists.txt
index 2e3c91c26..e014953d2 100644
--- a/rviz_common/CMakeLists.txt
+++ b/rviz_common/CMakeLists.txt
@@ -63,11 +63,10 @@ configure_file(src/rviz_common/env_config.cpp.in ${ENV_CONFIG_CPP} @ONLY)
set(rviz_common_headers_to_moc
${ENV_CONFIG_HPP}
src/rviz_common/add_display_dialog.hpp
- # src/rviz_common/help_panel.hpp
+ src/rviz_common/help_panel.hpp
include/rviz_common/properties/enum_property.hpp
include/rviz_common/properties/property_tree_widget.hpp
include/rviz_common/properties/splitter_handle.hpp
- # src/rviz_common/selection_panel.hpp
include/rviz_common/display_group.hpp
include/rviz_common/frame_position_tracking_view_controller.hpp
include/rviz_common/properties/quaternion_property.hpp
@@ -142,7 +141,7 @@ set(rviz_common_source_files
src/rviz_common/failed_view_controller.cpp
src/rviz_common/frame_manager.cpp
src/rviz_common/frame_position_tracking_view_controller.cpp
- # src/rviz_common/help_panel.cpp
+ src/rviz_common/help_panel.cpp
src/rviz_common/load_resource.cpp
src/rviz_common/loading_dialog.cpp
src/rviz_common/logging.cpp
@@ -293,6 +292,11 @@ install(
DESTINATION "share/${PROJECT_NAME}"
)
+install(
+ DIRECTORY "${CMAKE_SOURCE_DIR}/help"
+ 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_common/default.rviz b/rviz_common/default.rviz
index a3574808a..1a80c1229 100644
--- a/rviz_common/default.rviz
+++ b/rviz_common/default.rviz
@@ -15,7 +15,7 @@ Panels:
Expanded:
# - /2D Pose Estimate1
# - /2D Nav Goal1
- # - /Publish Point1
+ - /Publish Point1
Name: Tool Properties
Splitter Ratio: 0.588679
- Class: rviz_common/Views
@@ -60,14 +60,14 @@ Visualization Manager:
- Class: rviz_default_plugins/MoveCamera
- Class: rviz_default_plugins/Select
# - Class: rviz/FocusCamera
- # - Class: rviz/Measure
+ - Class: rviz_default_plugins/Measure
# - Class: rviz/SetInitialPose
# Topic: /initialpose
# - Class: rviz/SetGoal
# Topic: /move_base_simple/goal
- # - Class: rviz/PublishPoint
- # Single click: true
- # Topic: /clicked_point
+ - Class: rviz_default_plugins/PublishPoint
+ Single click: true
+ Topic: /clicked_point
Value: true
Views:
Current:
diff --git a/rviz/help/help.html b/rviz_common/help/help.html
similarity index 100%
rename from rviz/help/help.html
rename to rviz_common/help/help.html
diff --git a/rviz_default_plugins/icons/classes/Help.svg b/rviz_common/icons/classes/Help.svg
similarity index 100%
rename from rviz_default_plugins/icons/classes/Help.svg
rename to rviz_common/icons/classes/Help.svg
diff --git a/rviz_common/src/rviz_common/help_panel.cpp b/rviz_common/src/rviz_common/help_panel.cpp
index 224832f5b..9e9cc56ca 100644
--- a/rviz_common/src/rviz_common/help_panel.cpp
+++ b/rviz_common/src/rviz_common/help_panel.cpp
@@ -27,21 +27,18 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "rviz_common/help_panel.hpp"
+#include "./help_panel.hpp"
#include
+#include
#include // NOLINT: cpplint is unable to handle the include order here
#include // NOLINT: cpplint is unable to handle the include order here
#include // NOLINT: cpplint is unable to handle the include order here
-#include // NOLINT: cpplint is unable to handle the include order here
+#include "./visualization_manager.hpp"
-#include "rviz_common/visualization_manager.hpp"
-
-namespace fs = boost::filesystem;
-
-namespace rviz
+namespace rviz_common
{
HelpPanel::HelpPanel(QWidget * parent)
@@ -53,9 +50,7 @@ HelpPanel::HelpPanel(QWidget * parent)
layout->addWidget(browser_);
}
-HelpPanel::~HelpPanel()
-{
-}
+HelpPanel::~HelpPanel() = default;
void HelpPanel::onInitialize()
{
@@ -64,11 +59,11 @@ void HelpPanel::onInitialize()
void HelpPanel::setHelpFile(const QString & qfile_path)
{
- std::string file_path = qfile_path.toStdString();
+ QFileInfo path_info(qfile_path);
- if (!fs::exists(file_path)) {
+ if (!path_info.exists()) {
browser_->setText("Help file '" + qfile_path + "' does not exist.");
- } else if (fs::is_directory(file_path)) {
+ } else if (path_info.isDir()) {
browser_->setText("Help file '" + qfile_path + "' is a directory, not a file.");
} else {
QUrl url = QUrl::fromLocalFile(qfile_path);
@@ -80,4 +75,4 @@ void HelpPanel::setHelpFile(const QString & qfile_path)
}
}
-} // end namespace rviz
+} // namespace rviz_common
diff --git a/rviz_common/src/rviz_common/help_panel.hpp b/rviz_common/src/rviz_common/help_panel.hpp
index 3f2d70881..2d4202340 100644
--- a/rviz_common/src/rviz_common/help_panel.hpp
+++ b/rviz_common/src/rviz_common/help_panel.hpp
@@ -31,11 +31,11 @@
#include
-#include "rviz_common/panel.hpp"
+#include "./panel.hpp"
class QTextBrowser;
-namespace rviz
+namespace rviz_common
{
class HelpPanel : public Panel
@@ -55,6 +55,6 @@ class HelpPanel : public Panel
QTextBrowser * browser_;
};
-} // end namespace rviz
+} // namespace rviz_common
#endif // RVIZ_COMMON__HELP_PANEL_HPP_
diff --git a/rviz_common/src/rviz_common/panel_factory.cpp b/rviz_common/src/rviz_common/panel_factory.cpp
index f31e8a8f5..508d120f5 100644
--- a/rviz_common/src/rviz_common/panel_factory.cpp
+++ b/rviz_common/src/rviz_common/panel_factory.cpp
@@ -35,7 +35,7 @@
// TODO(wjwwood): reenable the remaining panels
#include "./displays_panel.hpp"
-// #include "./help_panel.hpp"
+#include "./help_panel.hpp"
#include "./selection_panel.hpp"
// #include "./time_panel.hpp"
#include "./tool_properties_panel.hpp"
@@ -46,7 +46,7 @@
namespace rviz_common
{
-// static Panel * newHelpPanel() {return new HelpPanel();}
+static Panel * newHelpPanel() {return new HelpPanel();}
static Panel * newSelectionPanel() {return new SelectionPanel();}
// static Panel * newTimePanel() {return new TimePanel();}
static Panel * newToolPropertiesPanel() {return new ToolPropertiesPanel();}
@@ -62,8 +62,8 @@ PanelFactory::PanelFactory(
[rviz_ros_node, manager]() -> Panel * {
return new DisplaysPanel(rviz_ros_node, manager, nullptr);
});
- // addBuiltInClass("rviz_common", "Help",
- // "Show the key and mouse bindings", &newHelpPanel);
+ addBuiltInClass("rviz_common", "Help",
+ "Show the key and mouse bindings", &newHelpPanel);
addBuiltInClass("rviz_common", "Selection",
"Show properties of selected objects", &newSelectionPanel);
// addBuiltInClass("rviz", "Time",
diff --git a/rviz_common/src/rviz_common/selection_panel.hpp b/rviz_common/src/rviz_common/selection_panel.hpp
index 283b10624..07ca55b43 100644
--- a/rviz_common/src/rviz_common/selection_panel.hpp
+++ b/rviz_common/src/rviz_common/selection_panel.hpp
@@ -41,8 +41,6 @@ class PropertyTreeWidget;
class SelectionPanel : public Panel
{
- Q_OBJECT
-
public:
explicit SelectionPanel(QWidget * parent = nullptr);
diff --git a/rviz_common/src/rviz_common/visualization_frame.cpp b/rviz_common/src/rviz_common/visualization_frame.cpp
index e5fe9dc4a..bf1a71be9 100644
--- a/rviz_common/src/rviz_common/visualization_frame.cpp
+++ b/rviz_common/src/rviz_common/visualization_frame.cpp
@@ -85,7 +85,7 @@
#include "./yaml_config_writer.hpp"
// #include "./displays_panel.hpp"
-// #include "./help_panel.hpp"
+#include "./help_panel.hpp"
// #include "./interaction/selection_manager.hpp"
// #include "./selection_panel.hpp"
// #include "./time_panel.hpp"
@@ -1123,12 +1123,9 @@ void VisualizationFrame::indicateToolIsCurrent(Tool * tool)
void VisualizationFrame::showHelpPanel()
{
if (!show_help_action_) {
- // TODO(wjwwood): reenable this when plugin loading is fixed.
-#if 0
- QDockWidget * dock = addPanelByName("Help", "rviz/Help");
+ QDockWidget * dock = addPanelByName("Help", "rviz_common/Help");
show_help_action_ = dock->toggleViewAction();
connect(dock, SIGNAL(destroyed(QObject *)), this, SLOT(onHelpDestroyed()));
-#endif
} else {
// TODO(wjwwood): figure out if this is needed
// show_help_action_ is a toggle action, so trigger() changes its
From 7995ab0c3f1f799fb848a076ae8559225bef8678 Mon Sep 17 00:00:00 2001
From: Martin Idel
Date: Mon, 4 Jun 2018 10:28:54 +0200
Subject: [PATCH 4/8] Cleanup
---
rviz_common/src/rviz_common/help_panel.cpp | 11 +++++------
rviz_common/src/rviz_common/visualization_frame.cpp | 10 +++-------
2 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/rviz_common/src/rviz_common/help_panel.cpp b/rviz_common/src/rviz_common/help_panel.cpp
index 9e9cc56ca..34837ef1f 100644
--- a/rviz_common/src/rviz_common/help_panel.cpp
+++ b/rviz_common/src/rviz_common/help_panel.cpp
@@ -31,10 +31,9 @@
#include
-#include
-#include // NOLINT: cpplint is unable to handle the include order here
+#include // NOLINT: cpplint is unable to handle the include order here
#include // NOLINT: cpplint is unable to handle the include order here
-#include // NOLINT: cpplint is unable to handle the include order here
+#include // NOLINT: cpplint is unable to handle the include order here
#include "./visualization_manager.hpp"
@@ -43,9 +42,9 @@ namespace rviz_common
HelpPanel::HelpPanel(QWidget * parent)
: Panel(parent),
- browser_(NULL)
+ browser_(nullptr)
{
- QVBoxLayout * layout = new QVBoxLayout(this);
+ const auto layout = new QVBoxLayout(this);
browser_ = new QTextBrowser();
layout->addWidget(browser_);
}
@@ -54,7 +53,7 @@ HelpPanel::~HelpPanel() = default;
void HelpPanel::onInitialize()
{
- setHelpFile(vis_manager_->getHelpPath() );
+ setHelpFile(vis_manager_->getHelpPath());
}
void HelpPanel::setHelpFile(const QString & qfile_path)
diff --git a/rviz_common/src/rviz_common/visualization_frame.cpp b/rviz_common/src/rviz_common/visualization_frame.cpp
index bf1a71be9..8c09cafc3 100644
--- a/rviz_common/src/rviz_common/visualization_frame.cpp
+++ b/rviz_common/src/rviz_common/visualization_frame.cpp
@@ -112,6 +112,7 @@ VisualizationFrame::VisualizationFrame(
splash_(nullptr),
toolbar_actions_(nullptr),
show_choose_new_master_option_(false),
+ panel_factory_(nullptr),
add_tool_action_(nullptr),
remove_tool_menu_(nullptr),
initialized_(false),
@@ -700,7 +701,7 @@ void VisualizationFrame::loadDisplayConfig(const QString & qpath)
setWindowModified(false);
loading_ = true;
- LoadingDialog * dialog = NULL;
+ LoadingDialog * dialog = nullptr;
if (initialized_) {
dialog = new LoadingDialog(this);
dialog->show();
@@ -1127,18 +1128,13 @@ void VisualizationFrame::showHelpPanel()
show_help_action_ = dock->toggleViewAction();
connect(dock, SIGNAL(destroyed(QObject *)), this, SLOT(onHelpDestroyed()));
} else {
- // TODO(wjwwood): figure out if this is needed
- // show_help_action_ is a toggle action, so trigger() changes its
- // state. Therefore we must force it to the opposite state from
- // what we want before we call trigger(). (I think.)
- show_help_action_->setChecked(false);
show_help_action_->trigger();
}
}
void VisualizationFrame::onHelpDestroyed()
{
- show_help_action_ = NULL;
+ show_help_action_ = nullptr;
}
void VisualizationFrame::onHelpWiki()
From a39ee8078bfe296e0ab242a092002ea77cf377f4 Mon Sep 17 00:00:00 2001
From: Martin Idel
Date: Tue, 5 Jun 2018 17:07:57 +0200
Subject: [PATCH 5/8] Fix documentation for current situation
- fix changed shortcuts
- explain that switching from Select tool is not possible
---
rviz_common/help/help.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rviz_common/help/help.html b/rviz_common/help/help.html
index 73cf9f0f3..3d72f671f 100644
--- a/rviz_common/help/help.html
+++ b/rviz_common/help/help.html
@@ -20,7 +20,7 @@ Key controls
Switching between tools
-These controls work in all modes.
+These controls work in all modes, except for tools capturing all keys (Select tool).
M |
@@ -73,7 +73,7 @@ Modifying Displays list
- Ctrl-A |
+ Ctrl-N |
Add a display |
From 17b13effb31b27b06c013f907015d659bb23c123 Mon Sep 17 00:00:00 2001
From: Martin Idel
Date: Tue, 5 Jun 2018 17:00:33 +0200
Subject: [PATCH 6/8] Comment out non-ported help
---
rviz_common/help/help.html | 170 ++++++++++++++++++-------------------
1 file changed, 85 insertions(+), 85 deletions(-)
diff --git a/rviz_common/help/help.html b/rviz_common/help/help.html
index 3d72f671f..6034bd24b 100644
--- a/rviz_common/help/help.html
+++ b/rviz_common/help/help.html
@@ -27,21 +27,21 @@ Switching between tools
Switch to the Move-Camera tool. |
- I |
- Switch to the Interact tool. |
-
-
+
+
+
+
S |
Switch to the Select tool. |
-
- G |
- Switch to the 2D Nav Goal tool. |
-
-
- P |
- Switch to the 2D Pose Estimate tool. |
-
+
+
+
+
+
+
+
+
@@ -138,81 +138,81 @@ Orbit view controller
-XYOrbit view controller
-
-
- Similar to the Orbit view controller, but the focal point is kept
- on the Z=0 (ground) plane.
-
-
-
- Left |
- Drag to rotate around the focal point. |
-
-
- Middle orShift-Left |
- Drag to move the focal point in the ground plane. |
-
-
- Scroll Wheel |
- Roll up or down to zoom towards or away from the focal point. |
-
-
- Right |
- Drag up or down to zoom towards or away from the focal point. |
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-FPS view controller
-
-
- Inspired by first-person shooter games. Drag to point your head.
-
-
-
- Left |
- Dragging rotates the viewpoint in the direction of the drag. |
-
-
- Middle orShift-Left |
- Drag to strafe (translate) left/right and up/down. |
-
-
- Scroll Wheel |
- Roll up or down to move the viewpoint forwards or back. |
-
-
- Right |
- Drag up or down to move the viewport forwards or back. |
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-TopDownOrtho view controller
-
-
- Top-down orthographic view.
-
-
-
- Left |
- Dragging left/right rotates the view. |
-
-
- Middle orShift-Left |
- Drag to move the viewpoint in the XY plane. |
-
-
- Scroll Wheel |
- Roll up or down to zoom in or out. |
-
-
- Right |
- Drag up or down to zoom in or out. |
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+