Skip to content

Commit

Permalink
[perception] Fix link error in thread sanitizer build (RobotLocomotio…
Browse files Browse the repository at this point in the history
…n#17925)

- Test case: bazel test --config=clang --compilation_mode=dbg --config=tsan \
             //tools/install/libdrake:drake_shared_library_test
- The link error was introduced by absl/container:flat_hash_map.
- Use std::unordered_map instead.
  • Loading branch information
DamrongGuoy authored Sep 15, 2022
1 parent c0d1343 commit a7cf238
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion perception/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ drake_cc_library(
],
deps = [
"//common:unused",
"@abseil_cpp_internal//absl/container:flat_hash_map",
],
)

Expand Down
4 changes: 2 additions & 2 deletions perception/point_cloud.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

#include <algorithm>
#include <functional>
#include <unordered_map>
#include <utility>
#include <vector>

#include "absl/container/flat_hash_map.h"
#include <fmt/format.h>
#include <fmt/ostream.h>

Expand Down Expand Up @@ -419,7 +419,7 @@ PointCloud PointCloud::VoxelizedDownSample(double voxel_size) const {
}

// Create a map from voxel coordinate to a set of points.
absl::flat_hash_map<Eigen::Vector3i, std::vector<int>, Vector3iHash>
std::unordered_map<Eigen::Vector3i, std::vector<int>, Vector3iHash>
voxel_map;
for (int i = 0; i < size_; ++i) {
if (xyz(i).array().isFinite().all()) {
Expand Down

0 comments on commit a7cf238

Please sign in to comment.