Skip to content

Commit

Permalink
Fix calculation of vertex IDs for relays
Browse files Browse the repository at this point in the history
  • Loading branch information
azeey committed Mar 31, 2020
1 parent 60dceb0 commit e09d5cf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion subt_ign/src/VisibilityTable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,16 @@ void VisibilityTable::PopulateVisibilityInfo(
// Convert poses to vertices.
std::set<ignition::math::graph::VertexId> relays;
for (const auto pose : _relayPoses)
relays.insert(this->Index(pose));
{
int32_t x = std::round(pose.X());
int32_t y = std::round(pose.Y());
int32_t z = std::round(pose.Z());
auto vertexId = std::make_tuple(x, y, z);

auto it = this->vertices.find(vertexId);
if (it != this->vertices.end())
relays.insert(it->second);
}

// Compute the cost of all routes without considering relays.
this->PopulateVisibilityInfo();
Expand Down

0 comments on commit e09d5cf

Please sign in to comment.