Method and apparatus for controlling vehicle
Provided are a method and apparatus for controlling a vehicle, the method including receiving traffic signal information, determining whether or not a vehicle passes through a crosswalk, on the basis of the traffic signal information and driving information of the vehicle, in response to determining that the vehicle does not pass through the crosswalk, generating a virtual stop line, and controlling the vehicle not to cross the virtual stop line.
1 . A method of controlling a vehicle, the method comprising:
by controlling communicator, requesting transmission of traffic signal information and receiving the traffic signal information at every certain periods;
determining whether or not a vehicle passes through a crosswalk, on the basis of the traffic signal information and driving information of the vehicle;
in response to determining that the vehicle does not pass through the crosswalk, generating a virtual stop line which is a reference line for controlling the vehicle to reduce speed and stop without crossing; and
by controlling body control module, controlling the vehicle not to cross the virtual stop line, and
wherein the traffic signal information includes a remaining time of a red light for a pedestrian, and
the determining whether or not the vehicle passes through the crosswalk includes:
predicting a future location of the vehicle when the remaining time elapses; determining that the vehicle passes through the crosswalk when the future location of the vehicle is a point after passing through the crosswalk according to a result of the prediction; and determining that the vehicle does not pass through the crosswalk when the future location of the vehicle is not the point after passing through the crosswalk, and
wherein the predicting the future location of the vehicle includes:
in response to a current velocity of the vehicle being less than a target velocity, predicting the future location of the vehicle by assuming that the vehicle travels while maintaining the target velocity to a point in time when the remaining time elapses when the current velocity increases according to a target acceleration and reaches the target velocity; and
in response to the current velocity of the vehicle being greater than the target velocity, predicting the future location of the vehicle by assuming that the vehicle travels while maintaining the target velocity from a current point in time to the point in time when the remaining time elapses.
2 . The method of claim 1 , wherein the traffic signal information is transmitted from at least one of another vehicle, an infrastructure, and a pedestrian by using a vehicle-to-everything (V2X) technology.
3 . The method of claim 1 , wherein, when another vehicle travels at a lower velocity than the current velocity of the vehicle between the vehicle and the crosswalk, the target velocity of the vehicle is the same as the velocity of the other vehicle.
4 . The method of claim 1 , wherein the generating the virtual stop line includes, when a stop line is marked between the crosswalk and the vehicle, generating the virtual stop line to be the same as the marked stop line.
5 . The method of claim 4 , wherein the generating the virtual stop line includes, when the stop line is not marked between the crosswalk and the vehicle, generating the virtual stop line parallel to the crosswalk by separating the virtual stop line from the crosswalk by a certain distance.
6 . The method of claim 1 , wherein, when the vehicle travels along a right-turning path including two crosswalks at an intersection, the crosswalk includes a first crosswalk through which the vehicle passes before turning right and a second crosswalk through which the vehicle passes after turning right, and the determining whether or not the vehicle passes the crosswalk includes: determining whether or not the vehicle passes through the first crosswalk; and determining whether or not the vehicle passes through the second crosswalk.
7 . The method of claim 6 , wherein the generating the virtual stop line includes:
in response to determining that the vehicle does not pass through the first crosswalk, generating a first virtual stop line corresponding to the first crosswalk; and
in response to determining that the vehicle passes through the first crosswalk but does not pass through the second crosswalk, generating a second virtual stop line corresponding to the second crosswalk.
8 . The method of claim 7 , wherein the generating the first virtual stop line includes generating the first virtual stop line to be the same as the stop line marked between the first crosswalk and the vehicle.
9 . The method of claim 7 , wherein the generating the second virtual stop line includes generating the second virtual stop line parallel to the second crosswalk by separating the second virtual stop line from the second crosswalk by a certain distance.
10 . An apparatus for controlling a vehicle, the apparatus comprising:
a memory configured to store at least one program; and
a processor configured to operate by executing the at least one program, wherein the processor is configured to:
by controlling communicator, request transmission of traffic signal information and receive the traffic signal information at every certain periods;
determine whether or not a vehicle passes through a crosswalk, on the basis of the traffic signal information and driving information of the vehicle;
in response to determining that the vehicle does not pass through the crosswalk, generate a virtual stop line which is a reference line for controlling the vehicle to reduce speed and stop without crossing; and
by controlling body control module, control the vehicle not to cross the virtual stop line, and
wherein the traffic signal information includes a remaining time of a red light for a pedestrian, and
the determining whether or not the vehicle passes through the crosswalk includes:
predicting a future location of the vehicle when the remaining time elapses; determining that the vehicle passes through the crosswalk when the future location of the vehicle is a point after passing through the crosswalk according to a result of the prediction; and determining that the vehicle does not pass through the crosswalk when the future location of the vehicle is not the point after passing through the crosswalk
wherein the predicting the future location of the vehicle includes:
in response to a current velocity of the vehicle being less than a target velocity, predicting the future location of the vehicle by assuming that the vehicle travels while maintaining the target velocity to a point in time when the remaining time elapses when the current velocity increases according to a target acceleration and reaches the target velocity; and
in response to the current velocity of the vehicle being greater than the target velocity, predicting the future location of the vehicle by assuming that the vehicle travels while maintaining the target velocity from a current point in time to the point in time when the remaining time elapses.
11 . A non-transitory computer-readable recording medium recording thereon a program for executing the method of claim 1 on a computer.