Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nav2_common/cmake/nav2_package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ macro(nav2_package)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic -Werror -Wdeprecated -fPIC -Wshadow)
add_compile_options(-Wall -Wextra -Wpedantic -Werror -Wdeprecated -fPIC -Wshadow -Wnull-dereference)
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-Wnon-virtual-dtor>")
endif()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,10 @@ class GroupsRemover
// The group of pixels labeled 0 corresponds to empty map cells.
// Zero bin of the histogram is equal to the number of pixels in this group.
// Because the values of empty map cells should not be changed, we will reset this bin
groups_sizes.front() = 0; // don't change image background value
if (!groups_sizes.empty()) {
groups_sizes.front() = 0; // don't change image background value
}


// noise_labels_table[i] = true if group with label i is noise
std::vector<bool> noise_labels_table(groups_sizes.size());
Expand Down
14 changes: 12 additions & 2 deletions nav2_mppi_controller/test/critic_manager_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,22 @@ class CriticManagerWrapper : public CriticManager

bool getDummyCriticInitialized()
{
return dynamic_cast<DummyCritic *>(critics_[0].get())->initialized_;
const auto critic = critics_[0].get();
if (critic == nullptr) {
return false;
}
const auto dummy_critic = dynamic_cast<DummyCritic *>(critic);
return dummy_critic == nullptr ? false : dummy_critic->initialized_;
}

bool getDummyCriticScored()
{
return dynamic_cast<DummyCritic *>(critics_[0].get())->scored_;
const auto critic = critics_[0].get();
if (critic == nullptr) {
return false;
}
const auto dummy_critic = dynamic_cast<DummyCritic *>(critic);
return dummy_critic == nullptr ? false : dummy_critic->scored_;
}
};

Expand Down