Advanced driver assistance systems such as autonomous emergency braking systems and lane departure warning systems have been legally required on European trucks since 2016.
They receive data from sensors such as radar and cameras, automatically scan them for danger signals, and then alert the driver accordingly.
Exactly how they do that is the summary of quite a sophisticated suite of software, hardware and computer technology.
The video, from component developer NVidia, explains some of the development issues of ADAS technologies in more detail.