Skip to content

Commit

Permalink
Merge pull request #1239 from tier4/feature/speed_up_set_other_status
Browse files Browse the repository at this point in the history
Feature/speed up set other status
  • Loading branch information
HansRobo authored May 9, 2024
2 parents aead6c7 + 3a01dc1 commit dd66419
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions simulation/traffic_simulator/src/entity/entity_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,25 +685,8 @@ void EntityBase::setEntityTypeList(
void EntityBase::setOtherStatus(
const std::unordered_map<std::string, CanonicalizedEntityStatus> & status)
{
other_status_.clear();
for (const auto & [other_name, other_status] : status) {
if (other_name != name) {
/*
The following filtering is the code written for the purpose of
reducing the calculation load, but it is commented out experimentally
because it adversely affects "processing that needs to identify other
entities regardless of distance" such as RelativeTargetSpeed of
requestSpeedChange.
*/
// const auto p0 = other_status.pose.position;
// const auto p1 = status_.pose.position;
// if (const auto distance = std::hypot(p0.x - p1.x, p0.y - p1.y, p0.z - p1.z); distance <
// 30)
// {
other_status_.emplace(other_name, other_status);
// }
}
}
other_status_ = status;
other_status_.erase(name);
}

auto EntityBase::setStatus(const CanonicalizedEntityStatus & status) -> void
Expand Down

0 comments on commit dd66419

Please sign in to comment.