NECKARSULM, GERMANY—Audi is preparing for the future with its Smart Factory, designed to optimize automobile production lines. First mentioned last year, the company envisions a factory where humans and robots will work together, and separate workstations allow a highly flexible working routine.