Skip to content
Open
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
9 changes: 4 additions & 5 deletions nav2_smac_planner/src/node_hybrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,18 +390,17 @@ bool NodeHybrid::isNodeValid(

float NodeHybrid::getTraversalCost(const NodePtr & child)
{
if (child == nullptr) {
return 0.0f;
}

const float normalized_cost = child->getCost() / 252.0f;
if (std::isnan(normalized_cost)) {
throw std::runtime_error(
"Node attempted to get traversal "
"cost without a known SE2 collision cost!");
}

// this is the first node
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See Mat's comment in the ticket please! He has a good point about another necessary change

if (getMotionPrimitiveIndex() == std::numeric_limits<unsigned int>::max()) {
return NodeHybrid::travel_distance_cost;
}

const TurnDirection & child_turn_dir = child->getTurnDirection();
float travel_cost_raw = motion_table.travel_costs[child->getMotionPrimitiveIndex()];
float travel_cost = 0.0;
Expand Down
Loading