Desperate to overcome the nation's growing shortage of labor, midsized companies are planning to buy robots and other equipment to automate a wide range of tasks, including manufacturing, earthmoving and hotel room service.