Skip to main content
. 2023 Jan 11;23(2):844. doi: 10.3390/s23020844
Algorithm 2. Obstacle input representation algorithm
Initialize the sectorial and rectangular areas according to the maximum slip angle of the front wheel, the size of the ego vehicle frame, and the speed of the ego vehicle.
Obtain the number Nsector  and Nrec  of the sectors and rectangles, and determine the angular interval of the sector β and the distance interval of the rectangle  ω.
Combine multiple obstacle vehicles and lane boundaries into one obstacle set.
Initialize the sector area representation Ssector=[[β1,r],,[β2,r]], and the rectangle area representation within the extended area Srectangle=[[ω1,l],,[ωj,l]], in which r represents the radius of the sector and l represents the length of the rectangle.
# Calculate sector representation.
For Nsector in cycles do:
if The current line segment intersects the set of obstacles:
  Confirm the intersection of the current line segment and the obstacle, and calculate the distance from the intersection to the origin, and update the corresponding Ssector
else:
  The current Ssector corresponding section is not updated
end for
for Nrectangle in cycles do:
if The current line segment intersects the set of obstacles:
  Confirm the intersection of the current line segment and the obstacle, and calculate the distance from the intersection to the corresponding horizontal reference line of the vehicle, and update the corresponding Srectangle.
else:
  The current Srectangle corresponding section is not updated.
end for
 Normalize the updated Ssector and Srectangle.