Autoparking

 Autoparking

Autonomous Parking

We are tasked with enabling our car for autonomous parking. Key considerations include:

1) The utilization of only three Lidar sensors, each providing information over 180 degrees. These sensors are strategically placed at the front, right side, and rear of the car.
2) A compass is available for determining the robot's orientation.
3) The initial position of the robot may not align with the correct lane for parking.
4) The initial orientation of the car may not be parallel to the street.


Fig.1 Car sensors

Having established the rules, we can now proceed to tackle the exercise. To address this challenge, I've chosen to break it down into manageable subproblems. Each subproblem represents a state for the robot, transitioning to the next upon resolution. The overarching goal is to construct a state machine, providing a comprehensive solution to the autoparking problem.

Initial development phase

In the initial development phase, I chose to experiment with a holonomic car and assumed that it would always be initially positioned parallel to the street and in the correct lane for parking. Although this initial decision seemed to significantly simplify the problem, successfully addressing this phase allowed me to solve almost half of the complete problem. Two crucial aspects needed to be accomplished:
  • Detection of a parking space: The vehicle had to be capable of identifying an empty space for parking.
  • Execution of the parking maneuver: The vehicle needed to perform the parking maneuver effectively.
As a result, I transitioned from dealing with a complex problem to a simplified one consisting of two subproblems: space detection and parking. These two subproblems translated into two states in my state machine. For the "Searching for space" state, I utilized the car's rear laser sensor. I converted its measurements into Cartesian coordinates relative to the robot, creating a collection of points representing obstacles on the street, essentially other cars.

Regarding space detection, I defined a rectangle slightly larger than the car, positioned in coordinates relative to my robot just behind it. I included a safety distance behind and beside it. Continuously, I checked that none of the points obtained in robot-relative coordinates from the laser were inside that rectangle. This indicated finding an open space for parking. If any point was within the rectangle, it meant the car needed to keep moving forward.


fig.2 space detection.

Regarding the parking maneuver, once the robot detects the open space, a reactive loop is executed. This loop causes the robot to move backward and turn until it reaches a rotation of 70 degrees relative to its original orientation. Then, it straightens itself until it returns to its initial orientation, thus completing the parking maneuver.



fig.3 holonomic robot behavior diagram.


vid.1 holonomic car demo.

*In this initial approach, I didn't consider whether the space was a bit narrow, which might require several maneuvers to avoid colliding with the car behind before completing the parking. However, I achieved an optimal solution that didn't depend on any other cars, whether in front, behind, or to the sides, to execute the maneuver correctly.

Ackermann Car

Once it was proven that the parking maneuver worked for the holonomic car, it was time to carry it out with the Ackermann-steered car. Due to movement restrictions, I had to tweak the algorithm that would execute the parking maneuver. I also decided to implement obstacle detection both in front and behind during the maneuver. This way, if the space was narrow, when straightening up, instead of continuing and colliding, it would correct in the opposite direction, resulting in a more robust parking maneuver.

I also implemented 2 additional states to detect if the car was parallel to the street and another one to go to the correct lane or correct the distance at which the car should be to perform the parking maneuver correctly.

  • Parallel to the street: To determine if the car was parallel to the street, I converted all laser measurements to robot-relative Cartesian coordinates, resulting in a series of nearly perfectly aligned points. Since these points were in relative coordinates, the difference in Y of the points would be non-zero if the car was not initially parallel to the street. Therefore, I only needed to turn the car until this difference became 0 or sufficiently close, following the sign indicated by this difference.

fig.4 ackermann robot parallel to the street.

  • In my lane: Due to the car's movement constraints, it could end up in another lane once it finished aligning. It could also initiate the maneuver from a different initial lane or end up too close to other cars. That's why I decided to implement this new state. If the car wasn't at the indicated average distance (necessary for proper parking), it would turn until reaching 25 degrees or getting closer to the lane, continue approaching if necessary, and then return to the street orientation.


fig.5 ackermann robot behavior diagram.


vid.2 ackermann car demo.

Conclusions

Although the robot parks in most instances, it relies on many constant values determined through experimentation (e.g., aligning to the street based on the difference in Y of measured obstacles, determining the car's lane position when it is at a certain distance from other cars or when there are no obstacles, etc.). Coupled with a programming paradigm based on reactive loops, it cannot be guaranteed to work in the vast majority of cases. Therefore, it is recommended to explore other control options such as end-to-end neural networks.


Comentarios

Entradas populares de este blog

Autonomous drone for search and rescue mission

Localized Vacuum Cleaner

OMPL Amazon warehouse