In this video, you'll see a Tesla Model S sound a side collision warning alert as a semi truck drifts into the lane occupied by the Tesla.

It's likely that the truck driver is close to dozing off after having been on the road for too long.

However, the Model S quickly recognizes the threat posed by the truck and alerts the driver while moving slightly out of harms way.

Video description:

Tesla Model S Side Collision Warning and Side Collision Avoidance.

I was in the left lane of Interstate 40 west bound through New Mexico with Autopilot engaged (TACC + Autosteer), passing an 18-wheeler in the right lane. The 18-wheeler driver apparently got distracted, and began drifting out of his lane to the right. You can hear his tires run over the rumble strips on the right. He overcorrected back into his lane and partly into mine. The Tesla sounded the Side Collision Warning alert, and I believe also did a slight Side Collision Avoidance maneuver by nudging the car to the left side of the left lane. I then sped up (you can hear the speed limit warning chime) to avoid being next to him.