File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed
frenet_trajectory_planner/include/frenet_trajectory_planner/costs
nav2_frenet_ilqr_controller/src/costs Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -32,10 +32,10 @@ double LateralDistanceCost::cost(
3232 double trajectory_cost = 0 ;
3333
3434 for (auto frenet_state : frenet_trajectory) {
35- trajectory_cost += std::abs (frenet_state[3 ] * K_distance_ );
35+ trajectory_cost += std::abs (frenet_state[3 ]);
3636 }
3737
38- return trajectory_cost;
38+ return K_distance_ * trajectory_cost;
3939}
4040
4141}
Original file line number Diff line number Diff line change @@ -35,10 +35,10 @@ double LongtitutalVelocityCost::cost(
3535 double trajectory_cost = 0 ;
3636
3737 for (auto frenet_state : frenet_trajectory) {
38- trajectory_cost += std::abs (frenet_state[1 ] - desired_velocity_) * K_longtitutal_velocity_ ;
38+ trajectory_cost += std::abs (frenet_state[1 ] - desired_velocity_);
3939 }
4040
41- return trajectory_cost;
41+ return K_longtitutal_velocity_ * trajectory_cost;
4242}
4343
4444}
Original file line number Diff line number Diff line change @@ -34,10 +34,10 @@ double LateralDistanceCost::cost(
3434 double trajectory_cost = 0 ;
3535
3636 for (auto frenet_state : frenet_trajectory) {
37- trajectory_cost += std::abs (frenet_state[3 ] * K_lateral_distance_ );
37+ trajectory_cost += std::abs (frenet_state[3 ]);
3838 }
3939
40- return trajectory_cost;
40+ return K_lateral_distance_ * trajectory_cost;
4141}
4242
4343}
Original file line number Diff line number Diff line change @@ -40,10 +40,10 @@ double LongtitutalVelocityCost::cost(
4040 double trajectory_cost = 0 ;
4141
4242 for (auto frenet_state : frenet_trajectory) {
43- trajectory_cost += std::abs (frenet_state[1 ] - desired_velocity_) * K_longtitutal_velocity_ ;
43+ trajectory_cost += std::abs (frenet_state[1 ] - desired_velocity_);
4444 }
4545
46- return trajectory_cost;
46+ return K_longtitutal_velocity_ * trajectory_cost;
4747}
4848
4949}
You can’t perform that action at this time.
0 commit comments