File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -397,11 +397,6 @@ float NodeHybrid::getTraversalCost(const NodePtr & child)
397397 " cost without a known SE2 collision cost!" );
398398 }
399399
400- // this is the first node
401- if (getMotionPrimitiveIndex () == std::numeric_limits<unsigned int >::max ()) {
402- return NodeHybrid::travel_distance_cost;
403- }
404-
405400 const TurnDirection & child_turn_dir = child->getTurnDirection ();
406401 float travel_cost_raw = motion_table.travel_costs [child->getMotionPrimitiveIndex ()];
407402 float travel_cost = 0.0 ;
@@ -419,7 +414,9 @@ float NodeHybrid::getTraversalCost(const NodePtr & child)
419414 // New motion is a straight motion, no additional costs to be applied
420415 travel_cost = travel_cost_raw;
421416 } else {
422- if (getTurnDirection () == child_turn_dir) {
417+ if (getTurnDirection () == child_turn_dir ||
418+ getMotionPrimitiveIndex () == std::numeric_limits<unsigned int >::max ())
419+ {
423420 // Turning motion but keeps in same direction: encourages to commit to turning if starting it
424421 travel_cost = travel_cost_raw * motion_table.non_straight_penalty ;
425422 } else {
You can’t perform that action at this time.
0 commit comments