Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ double LateralDistanceCost::cost(
trajectory_cost += std::abs(frenet_state[3]);
}

return K_lateral_distance_ * trajectory_cost;
return K_lateral_distance_ * trajectory_cost / frenet_trajectory.size();
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ double LongtitutalVelocityCost::cost(
trajectory_cost += std::abs(frenet_state[1] - desired_velocity_);
}

return K_longtitutal_velocity_ * trajectory_cost;
return K_longtitutal_velocity_ * trajectory_cost / frenet_trajectory.size();
}

}
Expand Down
2 changes: 1 addition & 1 deletion nav2_frenet_ilqr_controller/src/costs/obstacle_cost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ double ObstacleCost::cost(
trajectory_cost += point_cost;
}

return K_obstacle_ * trajectory_cost;
return K_obstacle_ * trajectory_cost / cartesian_trajectory.size();
}

}
Expand Down