Skip to content

Commit 1d8389b

Browse files
author
M. Fatih Cırıt
committed
update the todo comments to be helpful for future changes
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
1 parent 1fcb7c3 commit 1d8389b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

control/vehicle_cmd_gate/test/src/test_filter_in_vehicle_cmd_gate_node.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ class PubSubNode : public rclcpp::Node
235235
double lon_vel = 0.0;
236236
double prev_lon_acc = 0.0;
237237
double prev_lat_acc = 0.0;
238+
// TODO(Horibe): Remove this variable when the filtering logic is fixed.
238239
double prev_tire_angle = 0.0;
239240

240241
auto calculate_lateral_acceleration =
@@ -248,10 +249,10 @@ class PubSubNode : public rclcpp::Node
248249
prev_lon_acc = cmd_start->longitudinal.acceleration;
249250
// TODO(Horibe): prev_lat_acc should use the previous velocity, but use the current velocity
250251
// since the current filtering logic uses the current velocity.
252+
// when it's fixed, should be like this:
253+
// prev_lat_acc = calculate_lateral_acceleration(cmd_start->longitudinal.speed,
254+
// cmd_start->lateral.steering_tire_angle, wheelbase);
251255
prev_tire_angle = cmd_start->lateral.steering_tire_angle;
252-
lon_vel = cmd_start->longitudinal.speed;
253-
prev_lat_acc =
254-
calculate_lateral_acceleration(lon_vel, cmd_start->lateral.steering_tire_angle, wheelbase);
255256
}
256257

257258
for (size_t i = ind_start; i < history_size; ++i) {
@@ -269,6 +270,7 @@ class PubSubNode : public rclcpp::Node
269270
calculate_lateral_acceleration(lon_vel, cmd->lateral.steering_tire_angle, wheelbase);
270271
// TODO(Horibe): prev_lat_acc should use the previous velocity, but use the current velocity
271272
// since the current filtering logic uses the current velocity.
273+
// when it's fixed, it should be moved to the bottom of this loop.
272274
prev_lat_acc = calculate_lateral_acceleration(lon_vel, prev_tire_angle, wheelbase);
273275
const auto lat_jerk = (lat_acc - prev_lat_acc) / dt;
274276

@@ -278,8 +280,7 @@ class PubSubNode : public rclcpp::Node
278280
avg_lat_jerk += lat_jerk;
279281

280282
prev_lon_acc = lon_acc;
281-
// TODO(Horibe): prev_lat_acc should use the previous velocity, but use the current velocity
282-
// since the current filtering logic uses the current velocity.
283+
// TODO(Horibe): when the filtering logic is fixed, this line should be removed.
283284
prev_tire_angle = cmd->lateral.steering_tire_angle;
284285
}
285286

0 commit comments

Comments
 (0)