From 0ed7f18841564ad597d10b349e61b293c9952e2d Mon Sep 17 00:00:00 2001 From: Alberto Tudela Date: Fri, 21 Jun 2024 20:09:24 +0200 Subject: [PATCH] Fix size of text Signed-off-by: Alberto Tudela --- nav2_rviz_plugins/src/docking_panel.cpp | 7 ++++--- nav2_rviz_plugins/src/nav2_panel.cpp | 12 ++++++------ nav2_rviz_plugins/src/utils.cpp | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/nav2_rviz_plugins/src/docking_panel.cpp b/nav2_rviz_plugins/src/docking_panel.cpp index 07ec0a4f9a3..909e9a74fd5 100644 --- a/nav2_rviz_plugins/src/docking_panel.cpp +++ b/nav2_rviz_plugins/src/docking_panel.cpp @@ -69,7 +69,7 @@ DockingPanel::DockingPanel(QWidget * parent) docking_feedback_indicator_->setText(getDockFeedbackLabel()); docking_goal_status_indicator_->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); docking_feedback_indicator_->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - nav_to_staging_checkbox_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + nav_to_staging_checkbox_->setFixedWidth(150); info_layout_->addWidget(docking_goal_status_indicator_); info_layout_->addWidget(docking_result_indicator_); @@ -241,8 +241,9 @@ void DockingPanel::startDocking() goal_msg.dock_type = combo_box->currentText().toStdString(); RCLCPP_INFO( - client_node_->get_logger(), "DockRobot will be called using dock pose: (%f, %f)", - goal_msg.dock_pose.pose.position.x, goal_msg.dock_pose.pose.position.y); + client_node_->get_logger(), "DockRobot will be called using dock pose: (%f, %f) and type: %s", + goal_msg.dock_pose.pose.position.x, goal_msg.dock_pose.pose.position.y, + goal_msg.dock_type.c_str()); } // Enable result awareness by providing an empty lambda function diff --git a/nav2_rviz_plugins/src/nav2_panel.cpp b/nav2_rviz_plugins/src/nav2_panel.cpp index d416ee13bf9..64ba0a329b6 100644 --- a/nav2_rviz_plugins/src/nav2_panel.cpp +++ b/nav2_rviz_plugins/src/nav2_panel.cpp @@ -76,17 +76,17 @@ Nav2Panel::Nav2Panel(QWidget * parent) const char * nft_goal_msg = "Start navigating through poses"; const char * cancel_waypoint_msg = "Cancel waypoint / viapoint accumulation mode"; - const QString navigation_active("" + const QString navigation_active("
Navigation:
" "
Navigation:active
"); - const QString navigation_inactive("" + const QString navigation_inactive("
Navigation:
" "
Navigation:inactive
"); - const QString navigation_unknown("" + const QString navigation_unknown("
Navigation:
" "
Navigation:unknown
"); - const QString localization_active("" + const QString localization_active("
Localization:
" "
Localization:active
"); - const QString localization_inactive("" + const QString localization_inactive("
Localization:
" "
Localization:inactive
"); - const QString localization_unknown("" + const QString localization_unknown("
Localization:
" "
Localization:unknown
"); navigation_status_indicator_->setText(navigation_unknown); diff --git a/nav2_rviz_plugins/src/utils.cpp b/nav2_rviz_plugins/src/utils.cpp index 3d7dc4449b5..6c7fcbbad03 100644 --- a/nav2_rviz_plugins/src/utils.cpp +++ b/nav2_rviz_plugins/src/utils.cpp @@ -90,7 +90,7 @@ QString getGoalStatusLabel(std::string title, int8_t status) } return QString( std::string( - "
" + title + ":" + + "
" + title + ":" + status_str + "
").c_str()); }