Vehicle control apparatus and method, and storage medium
Example vehicle control apparatus and methods are described. In one example, the vehicle control apparatus includes a brake pedal and an accelerator pedal. The brake pedal is connected to a vehicle chassis by using a kinematic pair, and at least a part of the accelerator pedal is projected on the brake pedal. Based on the apparatus provided in this application, a driver can complete switching between vehicle braking and vehicle acceleration without moving a same foot.
1 . A method for controlling a vehicle, wherein the method comprises:
obtaining a first horizontal displacement value detected by using a first displacement sensor on a brake pedal and a first pressure value detected by using a first pressure sensor; and
controlling, based on the first horizontal displacement value and the first pressure value, the vehicle to brake or accelerate.
2 . The method according to claim 1 , wherein controlling, based on the first horizontal displacement value and the first pressure value, the vehicle to brake or accelerate comprises:
determining whether the first pressure value is greater than a first preset pressure value; and
in response to determining that the first pressure value is greater than the first preset pressure value, determining a braking force based on the first horizontal displacement value, and generating and outputting a first braking signal that comprises the braking force; or
in response to determining that the first pressure value is not greater than the first preset pressure value, maintaining a current state of the vehicle.
3 . The method according to claim 1 , wherein the method further comprises:
obtaining a second pressure value detected by using a second pressure sensor on an accelerator pedal and a second displacement value detected by using a second displacement sensor on the accelerator pedal; and
when the second pressure value is within a specified range, and when the second displacement value is greater than a preset threshold, generating and outputting an acceleration signal.
4 . The method according to claim 3 , wherein after the generating and outputting an acceleration signal, the method further comprises:
detecting whether a pressure value currently detected by the first pressure sensor on the brake pedal is less than a second preset pressure value; and
in response to determining that the pressure value currently detected by the first pressure sensor on the brake pedal is less than the second preset pressure value, determining that the acceleration signal is invalid; or
in response to determining that the pressure value currently detected by the first pressure sensor on the brake pedal is not less than the second preset pressure value, determining that the acceleration signal is valid.
5 . The method according to claim 3 , wherein after the generating and outputting an acceleration signal, the method further comprises:
when it is detected that a vehicle speed of the vehicle is greater than a specified speed, detecting whether a second braking signal exists; and
in response to determining that the second braking signal exists, controlling, based on the second braking signal, the vehicle to brake; or
in response to determining that the second braking signal does not exist, controlling, based on the acceleration signal, the vehicle to accelerate.
6 . A vehicle, comprising a controller, an accelerator pedal, and a brake pedal, wherein:
the controller comprises at least one processor and one or more memories coupled to the at least one processor, wherein the one or more memories store programming instructions for execution by the at least one processor to:
obtain a first horizontal displacement value detected by using a first displacement sensor on the brake pedal and a first pressure value detected by using a first pressure sensor; and
control, based on the first horizontal displacement value and the first pressure value, the vehicle to brake or accelerate.
7 . The vehicle according to claim 6 , wherein controlling, based on the first horizontal displacement value and the first pressure value, the vehicle to brake or accelerate comprises:
determining whether the first pressure value is greater than a first preset pressure value; and
in response to determining that the first pressure value is greater than the first preset pressure value, determining a braking force based on the first horizontal displacement value, and generating and outputting a first braking signal that comprises the braking force; or
in response to determining that the first pressure value is not greater than the first preset pressure value, maintaining a current state of the vehicle.
8 . The vehicle according to claim 6 , wherein the one or more memories store programing instructions for execution by the at least one processor to:
obtain a second pressure value detected by using a second pressure sensor on the accelerator pedal and a second displacement value detected by using a second displacement sensor on the accelerator pedal; and
when the second pressure value is within a specified range, and when the second displacement value is greater than a preset threshold, generate and output an acceleration signal.
9 . The vehicle according to claim 8 , wherein after generating and outputting the acceleration signal, the one or more memories store programing instructions for execution by the at least one processor to:
detect whether a pressure value currently detected by the first pressure sensor on the brake pedal is less than a second preset pressure value; and
in response to determining that the pressure value currently detected by the first pressure sensor on the brake pedal is less than the second preset pressure value, determine that the acceleration signal is invalid; or
in response to determining that the pressure value currently detected by the first pressure sensor on the brake pedal is not less than the second preset pressure value, determine that the acceleration signal is valid.
10 . The vehicle according to claim 8 , wherein after generating and outputting the acceleration signal, the one or more memories store programing instructions for execution by the at least one processor to:
when it is detected that a vehicle speed of the vehicle is greater than a specified speed, detect whether a second braking signal exists; and
in response to determining that the second braking signal exists, control, based on the second braking signal, the vehicle to brake; or
in response to determining that the second braking signal does not exist, control, based on the acceleration signal, the vehicle to accelerate.