Tesla reported a quarterly profit of $787 million, a 43% decline from $1.37 billion in the same period a year earlier. The drop came as spending on robots and self-driving cars soared.

According to the company, its Optimus robot is in production. Tesla also aims to get Cybercabs, its driverless cabs, to customers by year-end.