From 005d4fc1ef7304742e669afda3c30e696f1fd910 Mon Sep 17 00:00:00 2001 From: Jatin Patil Date: Sun, 21 Jul 2024 10:25:14 +0530 Subject: [PATCH] Fixed Styles and Linting Signed-off-by: Jatin Patil --- nav2_costmap_2d/src/costmap_2d_ros.cpp | 2 +- .../include/nav2_rviz_plugins/costmap_cost_tool.hpp | 12 +++++++----- nav2_rviz_plugins/src/costmap_cost_tool.cpp | 8 ++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/nav2_costmap_2d/src/costmap_2d_ros.cpp b/nav2_costmap_2d/src/costmap_2d_ros.cpp index ac53d762db9..f5dc486a087 100644 --- a/nav2_costmap_2d/src/costmap_2d_ros.cpp +++ b/nav2_costmap_2d/src/costmap_2d_ros.cpp @@ -830,7 +830,7 @@ void Costmap2DROS::getCostCallback( { RCLCPP_INFO( get_logger(), "Received request to get cost at point (%f, %f)", request->x, request->y); - + auto costmap = layered_costmap_->getCostmap(); unsigned int mx, my; diff --git a/nav2_rviz_plugins/include/nav2_rviz_plugins/costmap_cost_tool.hpp b/nav2_rviz_plugins/include/nav2_rviz_plugins/costmap_cost_tool.hpp index c4c29e19af5..852446840a0 100644 --- a/nav2_rviz_plugins/include/nav2_rviz_plugins/costmap_cost_tool.hpp +++ b/nav2_rviz_plugins/include/nav2_rviz_plugins/costmap_cost_tool.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef COSTMAP_COST_TOOL_HPP_ -#define COSTMAP_COST_TOOL_HPP_ +#ifndef NAV2_RVIZ_PLUGINS__COSTMAP_COST_TOOL_HPP_ +#define NAV2_RVIZ_PLUGINS__COSTMAP_COST_TOOL_HPP_ #include #include @@ -25,6 +25,7 @@ namespace nav2_rviz_plugins class CostmapCostTool : public rviz_common::Tool { Q_OBJECT + public: CostmapCostTool(); virtual ~CostmapCostTool(); @@ -33,7 +34,7 @@ class CostmapCostTool : public rviz_common::Tool void activate() override; void deactivate() override; - int processMouseEvent(rviz_common::ViewportMouseEvent& event) override; + int processMouseEvent(rviz_common::ViewportMouseEvent & event) override; void callCostService(float x, float y); @@ -55,6 +56,7 @@ private Q_SLOTS: rclcpp::QoS qos_profile_; }; -} -#endif +} // namespace nav2_rviz_plugins + +#endif // NAV2_RVIZ_PLUGINS__COSTMAP_COST_TOOL_HPP_ \ No newline at end of file diff --git a/nav2_rviz_plugins/src/costmap_cost_tool.cpp b/nav2_rviz_plugins/src/costmap_cost_tool.cpp index b02f1e13d27..f492181c025 100644 --- a/nav2_rviz_plugins/src/costmap_cost_tool.cpp +++ b/nav2_rviz_plugins/src/costmap_cost_tool.cpp @@ -44,9 +44,9 @@ void CostmapCostTool::onInitialize() setIcon(rviz_common::loadPixmap("package://rviz_default_plugins/icons/classes/PointStamped.png")); node_ = context_->getRosNodeAbstraction().lock()->get_raw_node(); - local_cost_client_ = + local_cost_client_ = node_->create_client("/local_costmap/get_cost_local_costmap"); - global_cost_client_ = + global_cost_client_ = node_->create_client("/global_costmap/get_cost_global_costmap"); } @@ -82,7 +82,7 @@ int CostmapCostTool::processMouseEvent(rviz_common::ViewportMouseEvent & event) setStatus("Move over an object to select the target point."); } return flags; -} +} void CostmapCostTool::callCostService(float x, float y) { @@ -131,7 +131,7 @@ void CostmapCostTool::handleGlobalCostResponse( RCLCPP_ERROR(node_->get_logger(), "Failed to get global costmap cost"); } } -} // namespace nav2_rviz_plugins +} // namespace nav2_rviz_plugins #include PLUGINLIB_EXPORT_CLASS(nav2_rviz_plugins::CostmapCostTool, rviz_common::Tool)