Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
raw pointer
Signed-off-by: Guillaume Doisy <guillaume@dexory.com>
  • Loading branch information
Guillaume Doisy committed Apr 11, 2025
commit dd936571025709fea13f84b17a900dce252b457b
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class CostmapTopicCollisionChecker
// Name used for logging
std::string name_;
CostmapSubscriber & costmap_sub_;
std::shared_ptr<FootprintSubscriber> footprint_sub_;
FootprintSubscriber * footprint_sub_ = nullptr;
FootprintCollisionChecker<std::shared_ptr<Costmap2D>> collision_checker_;
rclcpp::Clock::SharedPtr clock_;
Footprint footprint_;
Expand Down
2 changes: 1 addition & 1 deletion nav2_costmap_2d/src/costmap_topic_collision_checker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@
collision_checker_(nullptr)
{}

CostmapTopicCollisionChecker::CostmapTopicCollisionChecker(

Check warning on line 45 in nav2_costmap_2d/src/costmap_topic_collision_checker.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_costmap_2d/src/costmap_topic_collision_checker.cpp#L45

Added line #L45 was not covered by tests
CostmapSubscriber & costmap_sub,
std::string footprint_string,
std::string name)
: name_(name),
costmap_sub_(costmap_sub),
collision_checker_(nullptr)

Check warning on line 51 in nav2_costmap_2d/src/costmap_topic_collision_checker.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_costmap_2d/src/costmap_topic_collision_checker.cpp#L48-L51

Added lines #L48 - L51 were not covered by tests
{
makeFootprintFromString(footprint_string, footprint_);

Check warning on line 53 in nav2_costmap_2d/src/costmap_topic_collision_checker.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_costmap_2d/src/costmap_topic_collision_checker.cpp#L53

Added line #L53 was not covered by tests
}

bool CostmapTopicCollisionChecker::isCollisionFree(
Expand Down Expand Up @@ -104,9 +104,9 @@

// if footprint_sub_ was not initialized (alternative constructor), we are using the
// footprint built from the footprint_string alternative constructor argument.
if (footprint_sub_) {
if (footprint_sub_ != nullptr) {
if (!footprint_sub_->getFootprintInRobotFrame(footprint_, header)) {
throw CollisionCheckerException("Current footprint not available.");

Check warning on line 109 in nav2_costmap_2d/src/costmap_topic_collision_checker.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_costmap_2d/src/costmap_topic_collision_checker.cpp#L109

Added line #L109 was not covered by tests
}
}
}
Expand Down
Loading