Detection and Tracking of a Towed Trailer

by - created


      Towing a trailer and traveling high speeds can be very dangerous if the driver is unaware of the trailer’s condition. This project implements a detection and tracking algorithm in the point cloud to monitor the angles of a towed trailer using Cepton’s LiDAR sensors. Trailer detection is used to alert the driver of the jackknifing or trailer detachment risks, and angle tracking is used to alert the driver of the trailer’s sway. These features would help decrease the risk of an accident.

      For our setup, we mounted a Vista-X90 sensor on the truck’s bed using a tripod and collected video footage with the same placement.

Recognizing the Trailer

       The first task was to recognize the trailer face. We cropped the point cloud to a certain distance range where the trailer was sure to be located: in this case, from 0.5 to 10 meters. Uniform gridding was also applied across all data points. This particular dataset had the following point cloud:

      Then, background points were removed from the data and the DBSCAN algorithm was performed, which returned multiple clusters of points that are close to each other based on the Euclidean distance. Since the trailer face has significantly more points clustered together than the background, the cluster with the most points was labeled as the trailer face. Based on the trailer face data subset and the angle at which the trailer was positioned, we could calculate and display the width of the trailer.

      To determine the starting angle of the trailer face relative to the LiDAR position, we performed a linear regression operation on the trailer face points. We are assuming that the LiDAR sensor is always capturing data at an angle that is directly perpendicular to the back of the truck. Using the equation generated by the linear regression operation, we drew the following bounding box around the trailer face:

Tracking the Trailer

      To track the angle from each frame, the ICP (Iterative Closest Point) algorithm was applied on the current frame with respect to the starting frame of the data. This returned the rotation and translation as a 4x4 transformation matrix from which we could extract the angle. The figure below demonstrates the effectiveness of the algorithm on the data. The pink points are the source, the blue points are the target, and the orange points are the source with the transformation matrix applied. The orange points were found to be 98% accurate with the blue points.

      An alternative method that was attempted was iterating through each frame, calculating the transformation matrix between each cumulative frame, and adding the resulting angles together to determine the final angle that is with respect to the starting frame. However, the accuracy of the calculated frames vs. the actual frames dropped to 60%, as the propagation of error for each ICP iteration likely increased significantly. Therefore, it was modified so that one ICP iteration would have to be performed for each frame.


      This is the final visualization that was generated using the Cepton Viewer.

      The angle changes with each frame based on the current frame’s angle position and Low, Medium, and High Sway levels; Jackknifing Warning and Trailer Detachment Warning will also be highlighted as necessary. Medium Sway is defined as the trailer swinging between 5-10 degrees for at least 4 counts, High Sway occurs if the trailer swings for more than 10 degrees for at least 4 counts, otherwise the system is considered Low Sway. Jackknifing Warning occurs if the trailer is at more than a 70 degree angle to the truck, and the Trailer Detachment Warning occurs if the trailer is calculated to be at a difference of more than 1 meter from the initial trailer distance.