Smithfield Foods Inc. thought it was doing great. In the first quarter of this year, the pork giant’s earnings were up 190 percent over the same period in 2019. Then the pandemic hit, and the close quarters of meatpacking plants made them ideal places for the coronavirus to spread.

Employee infection rates spiked, forcing temporary closures and sudden shortages in supermarket meat aisles. After its revenue plummeted in the second quarter, Smithfield and other meat processors started looking around for strategies to make sure the same thing didn’t happen again.

While the industry has in some cases installed plastic shields between workstations and made other coronavirus-related changes, some executives contend social distancing isn’t feasible in such a labor-intensive environment. Smithfield, the largest pork company in the world with 42,000 employees in 40 U.S. locations, decided to invest in some relatively new technology to deal with the threat of contagion.