Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(vehicle_cmd_gate)!: delete rate limit skipping function for vehicle departure #7720

Merged
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
4 changes: 4 additions & 0 deletions control/autoware_vehicle_cmd_gate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ The limitation values are calculated based on the 1D interpolation of the limita

Notation: this filter is not designed to enhance ride comfort. Its main purpose is to detect and remove abnormal values in the control outputs during the final stages of Autoware. If this filter is frequently active, it implies the control module may need tuning. If you're aiming to smoothen the signal via a low-pass filter or similar techniques, that should be handled in the control module. When the filter is activated, the topic `~/is_filter_activated` is published.

Notation 2: If you use vehicles in which the driving force is controlled by the accelerator/brake pedal, the jerk limit, denoting the pedal rate limit, must be sufficiently relaxed at low speeds.
Otherwise, quick pedal changes at start/stop will not be possible, resulting in slow starts and creep down on hills.
This functionality for starting/stopping was embedded in the source code but was removed because it was complex and could be achieved by parameters.

## Assumptions / Known limits

The parameter `check_external_emergency_heartbeat` (true by default) enables an emergency stop request from external modules.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
stop_check_duration: 1.0
nominal:
vel_lim: 25.0
reference_speed_points: [20.0, 30.0]
steer_lim: [1.0, 0.8]
steer_rate_lim: [1.0, 0.8]
lon_acc_lim: [5.0, 4.0]
lon_jerk_lim: [5.0, 4.0]
lat_acc_lim: [5.0, 4.0]
lat_jerk_lim: [7.0, 6.0]
actual_steer_diff_lim: [1.0, 0.8]
reference_speed_points: [0.1, 0.3, 20.0, 30.0]
steer_lim: [1.0, 1.0, 1.0, 0.8]
steer_rate_lim: [1.0, 1.0, 1.0, 0.8]
lon_acc_lim: [5.0, 5.0, 5.0, 4.0]
lon_jerk_lim: [80.0, 5.0, 5.0, 4.0] # The first element is required for quick pedal changes when stopping and starting.
lat_acc_lim: [5.0, 5.0, 5.0, 4.0]
lat_jerk_lim: [7.0, 7.0, 7.0, 6.0]
actual_steer_diff_lim: [1.0, 1.0, 1.0, 0.8]
on_transition:
vel_lim: 50.0
reference_speed_points: [20.0, 30.0]
Expand Down
18 changes: 0 additions & 18 deletions control/autoware_vehicle_cmd_gate/src/vehicle_cmd_gate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,6 @@ Control VehicleCmdGate::filterControlCommand(const Control & in)
const auto mode = current_operation_mode_;
const auto current_status_cmd = getActualStatusAsCommand();
const auto ego_is_stopped = vehicle_stop_checker_->isVehicleStopped(stop_check_duration_);
const auto input_cmd_is_stopping = in.longitudinal.acceleration < 0.0;

filter_.setCurrentSpeed(current_kinematics_.twist.twist.linear.x);
filter_on_transition_.setCurrentSpeed(current_kinematics_.twist.twist.linear.x);
Expand All @@ -618,23 +617,6 @@ Control VehicleCmdGate::filterControlCommand(const Control & in)
if (mode.is_in_transition) {
filter_on_transition_.filterAll(dt, current_steer_, out, is_filter_activated);
} else {
// When ego is stopped and the input command is not stopping,
// use the higher of actual vehicle longitudinal state
// and previous longitudinal command for the filtering
// this is to prevent the jerk limits being applied and causing
// a delay when restarting the vehicle.

if (ego_is_stopped && !input_cmd_is_stopping) {
auto prev_cmd = filter_.getPrevCmd();
prev_cmd.longitudinal.acceleration =
std::max(prev_cmd.longitudinal.acceleration, current_status_cmd.longitudinal.acceleration);
// consider reverse driving
prev_cmd.longitudinal.velocity = std::fabs(prev_cmd.longitudinal.velocity) >
std::fabs(current_status_cmd.longitudinal.velocity)
? prev_cmd.longitudinal.velocity
: current_status_cmd.longitudinal.velocity;
filter_.setPrevCmd(prev_cmd);
}
filter_.filterAll(dt, current_steer_, out, is_filter_activated);
}

Expand Down
Loading