Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
ament_cpplint
ament_uncrustify --reformat

Signed-off-by: finani <[email protected]>
  • Loading branch information
finani committed Aug 5, 2024
1 parent 9e9cfab commit d261fdf
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
9 changes: 6 additions & 3 deletions nav2_amcl/src/amcl_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1581,17 +1581,20 @@ AmclNode::initServices()
{
global_loc_srv_ = create_service<std_srvs::srv::Empty>(
"reinitialize_global_localization",
std::bind(&AmclNode::globalLocalizationCallback, this, std::placeholders::_1,
std::bind(
&AmclNode::globalLocalizationCallback, this, std::placeholders::_1,
std::placeholders::_2, std::placeholders::_3));

initial_guess_srv_ = create_service<nav2_msgs::srv::SetInitialPose>(
"set_initial_pose",
std::bind(&AmclNode::initialPoseReceivedSrv, this, std::placeholders::_1, std::placeholders::_2,
std::bind(
&AmclNode::initialPoseReceivedSrv, this, std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3));

nomotion_update_srv_ = create_service<std_srvs::srv::Empty>(
"request_nomotion_update",
std::bind(&AmclNode::nomotionUpdateCallback, this, std::placeholders::_1, std::placeholders::_2,
std::bind(
&AmclNode::nomotionUpdateCallback, this, std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ inline BT::NodeStatus GetPoseFromPath::tick()
}

// Account for negative indices
if(pose_index < 0) {
if (pose_index < 0) {
pose_index = input_path.poses.size() + pose_index;
}

// out of bounds index
if(pose_index < 0 || static_cast<unsigned>(pose_index) >= input_path.poses.size()) {
if (pose_index < 0 || static_cast<unsigned>(pose_index) >= input_path.poses.size()) {
return BT::NodeStatus::FAILURE;
}

Expand All @@ -60,7 +60,7 @@ inline BT::NodeStatus GetPoseFromPath::tick()
output_pose = input_path.poses[pose_index];

// populate pose frame from path if necessary
if(output_pose.header.frame_id.empty()) {
if (output_pose.header.frame_id.empty()) {
output_pose.header.frame_id = input_path.header.frame_id;
}

Expand Down
5 changes: 3 additions & 2 deletions nav2_costmap_2d/src/costmap_2d_ros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ Costmap2DROS::on_configure(const rclcpp_lifecycle::State & /*state*/)
// Service to get the cost at a point
get_cost_service_ = create_service<nav2_msgs::srv::GetCost>(
"get_cost_" + getName(),
std::bind(&Costmap2DROS::getCostCallback, this, std::placeholders::_1, std::placeholders::_2,
std::bind(
&Costmap2DROS::getCostCallback, this, std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3));

// Add cleaning service
Expand Down Expand Up @@ -423,7 +424,7 @@ Costmap2DROS::getParameters()
std::size_t first_slash = raw_namespace.find('/', 1);
std::string robot_namespace = "";
if (first_slash != std::string::npos) {
robot_namespace = raw_namespace.substr(1, first_slash - 1) + "/";
robot_namespace = raw_namespace.substr(1, first_slash - 1) + "/";
}

global_frame_ = robot_namespace + nav2_util::strip_leading_slash(global_frame_);
Expand Down
6 changes: 4 additions & 2 deletions nav2_rviz_plugins/src/costmap_cost_tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,15 @@ void CostmapCostTool::callCostService(float x, float y)

// Call local costmap service
if (local_cost_client_->wait_for_service(std::chrono::seconds(1))) {
local_cost_client_->async_send_request(request,
local_cost_client_->async_send_request(
request,
std::bind(&CostmapCostTool::handleLocalCostResponse, this, std::placeholders::_1));
}

// Call global costmap service
if (global_cost_client_->wait_for_service(std::chrono::seconds(1))) {
global_cost_client_->async_send_request(request,
global_cost_client_->async_send_request(
request,
std::bind(&CostmapCostTool::handleGlobalCostResponse, this, std::placeholders::_1));
}
}
Expand Down

0 comments on commit d261fdf

Please sign in to comment.