Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Tony Najjar <[email protected]>
  • Loading branch information
tonynajjar committed Sep 16, 2024
1 parent 2260a7b commit ec88241
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ void RemoveInCollisionGoals::on_tick()
BT::NodeStatus RemoveInCollisionGoals::on_completion(
std::shared_ptr<nav2_msgs::srv::GetCosts::Response> response)
{
for (size_t i = 0; i < input_goals_.size(); ++i) {
double yaw = tf2::getYaw(input_goals_[i].pose.orientation);
RCLCPP_INFO(
node_->get_logger(),
"Goal %ld: x: %f, y: %f, yaw: %f, costs: %f", i,
input_goals_[i].pose.position.x, input_goals_[i].pose.position.y, yaw, response->costs[i]);
}

Goals valid_goal_poses;
for (size_t i = 0; i < response->costs.size(); ++i) {
if ((response->costs[i] == 255 && !consider_unknown_as_obstacle_) ||
Expand All @@ -71,9 +63,9 @@ BT::NodeStatus RemoveInCollisionGoals::on_completion(
valid_goal_poses.push_back(input_goals_[i]);
}
}
// Warn if all goals have been removed
// Inform if all goals have been removed
if (valid_goal_poses.empty()) {
RCLCPP_WARN(
RCLCPP_INFO(

Check warning on line 68 in nav2_behavior_tree/plugins/action/remove_in_collision_goals_action.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_behavior_tree/plugins/action/remove_in_collision_goals_action.cpp#L68

Added line #L68 was not covered by tests
node_->get_logger(),
"All goals are in collision and have been removed from the list");
}
Expand Down
2 changes: 1 addition & 1 deletion nav2_costmap_2d/src/costmap_2d_ros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ void Costmap2DROS::getCostsCallback(
pose_transformed.pose.position.y, mx, my);

if (!in_bounds) {
response->costs.push_back(costmap->getDefaultValue());
response->costs.push_back(NO_INFORMATION);

Check warning on line 846 in nav2_costmap_2d/src/costmap_2d_ros.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_costmap_2d/src/costmap_2d_ros.cpp#L846

Added line #L846 was not covered by tests
continue;
}
double yaw = tf2::getYaw(pose_transformed.pose.orientation);
Expand Down
8 changes: 4 additions & 4 deletions nav2_costmap_2d/src/layered_costmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ LayeredCostmap::LayeredCostmap(std::string global_frame, bool rolling_window, bo
footprint_(std::make_shared<std::vector<geometry_msgs::msg::Point>>())
{
if (track_unknown) {
primary_costmap_.setDefaultValue(255);
combined_costmap_.setDefaultValue(255);
primary_costmap_.setDefaultValue(NO_INFORMATION);
combined_costmap_.setDefaultValue(NO_INFORMATION);
} else {
primary_costmap_.setDefaultValue(0);
combined_costmap_.setDefaultValue(0);
primary_costmap_.setDefaultValue(FREE_SPACE);
combined_costmap_.setDefaultValue(FREE_SPACE);
}
}

Expand Down

0 comments on commit ec88241

Please sign in to comment.