Skip to content

Commit 7942c07

Browse files
ajtudelaSteveMacenski
authored andcommitted
Fix logo in nav2 panel (#4505)
* Fix logo in nav2 panel Signed-off-by: Alberto Tudela <ajtudela@gmail.com> * Move icon Signed-off-by: Alberto Tudela <ajtudela@gmail.com> --------- Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
1 parent 06709bc commit 7942c07

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed
File renamed without changes.

nav2_rviz_plugins/include/nav2_rviz_plugins/nav2_panel.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ private Q_SLOTS:
178178
QState * paused_wp_{nullptr};
179179
QState * resumed_wp_{nullptr};
180180

181-
QImage * image_{nullptr};
182181
QLabel * imgDisplayLabel_{nullptr};
183182

184183
// The following states are added to allow for the state of the button to only expose reset

nav2_rviz_plugins/src/nav2_panel.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "nav2_rviz_plugins/goal_common.hpp"
3131
#include "nav2_rviz_plugins/utils.hpp"
3232
#include "rviz_common/display_context.hpp"
33+
#include "rviz_common/load_resource.hpp"
3334
#include "ament_index_cpp/get_package_share_directory.hpp"
3435
#include "yaml-cpp/yaml.h"
3536
#include "geometry_msgs/msg/pose2_d.hpp"
@@ -523,9 +524,9 @@ Nav2Panel::Nav2Panel(QWidget * parent)
523524
QVBoxLayout * group_box_layout = new QVBoxLayout;
524525

525526
QGroupBox * groupBox = new QGroupBox(tr("Tools for WP-Following"));
526-
image_ = new QImage("src/navigation2/doc/nav2_logo_small.png");
527527
imgDisplayLabel_ = new QLabel("");
528-
imgDisplayLabel_->setPixmap(QPixmap::fromImage(*image_));
528+
imgDisplayLabel_->setPixmap(
529+
rviz_common::loadPixmap("package://nav2_rviz_plugins/icons/classes/nav2_logo_small.png"));
529530

530531
status_layout->addWidget(navigation_status_indicator_);
531532
status_layout->addWidget(localization_status_indicator_);

0 commit comments

Comments
 (0)