Zeljko Popovic, a leader within Tesla's Autopilot team, is leaving for Embark, the autonomous trucking start-up in San Francisco, according to a person familiar with the move. Embark confirmed the hire.

The departure comes at a critical time, as Tesla is promising its electric vehicles will be capable of operating as "robotaxis" by the end of next year — which is to say, they'd be fully self-driving in normal conditions, without human intervention. Tesla also says it plans to start production of its long-awaited electric semi trucks by the end of 2020.

Popovic, whose background is in robotics, built and ran the perception team for Tesla's Autopilot division.

According to people familiar with his accomplishments there, Popovic managed the development of highly accurate maps of U.S. highways for Tesla, and created a "sensor fusion system" which combines data from the many cameras, radars and ultrasonic sensors that Tesla vehicles employ. The sensor fusion system enables Autopilot to "see" other cars on the road.

At Tesla's annual shareholder meeting this week, CEO Elon Musk acknowledged that some Tesla self-driving features still need improvements. "Summon," which allows a driver to automatically call their car over from wherever it is parked, was supposed to be widely available by now. But at the meeting, Musk said it is still being tweaked.

Founded in 2015, Embark integrates its self-driving systems into Peterbilt semis rather than building its own trucks completely from scratch, and the trucks are generally operated with human supervisors behind the wheel. It now has more than a dozen trucks and 60 employees. Amazon is using self-driving trucks developed by Embark to haul some cargo on the I-10 interstate highway in California, both companies previously acknowledged.

Attrition has been a big issue for Tesla in the last two years as the company has missed some of its production goals and its stock price has swung wildly. Among others, self-driving VP Jim Keller left for Intel, and head engineer Doug Field rejoined Apple to work on that company's secretive self-driving technology.

Popovic and Tesla did not immediately respond to requests for comment.

WATCH: Self-driving trucks are here -- here's how they'll transform the trucking industry