While the Trump administration works to reduce the number of immigrants entering the United States, the U.S. economy is dealing with the worst labor shortage it’s seen in decades. This labor shortage is hitting nearly every industry, but among the worst is the agricultural industry.

A recent survey found over half of California’s farmers have started using machines in place of humans to meet their needs in the past five years. One of those machines could be a robot.

New Zealand’s farms have become a prime testing ground for this, as the country tries to tackle labor shortages in its agricultural industry.

The answer to this problem, according to an American startup called Abundant Robotics, which has teamed up with major food producer T&G Global, is to deploy apple-picking robots.

“We are steadily getting closer to making these robots commercially successful,” Manoj Karkee, an associate professor of biological systems engineering at the Washington State University, told The Daily Beast. “Not having enough labor in the field and feeling that gap is a big challenge right now—where farmers are already facing a tough time getting enough people to harvest their crop.”

Karkee argued that robots picking our produce beyond apples will likely be commonplace in the not-too-distant future. Compared to other fruits, picking apples isn’t the greatest challenge for those who are designing agricultural robots, considering their simple shape and the fact they don’t bruise easily. According to Karkee, developing robotic hands that can properly handle more complex and more delicate fruits is still quite difficult.

“We do a lot of research to understand how much pressure we can exert with these fruits before we bruise them,” Karkee said. “That’s part of the design process.”

Some fruit might also require more than a robotic hand to pull them off the tree. With certain fruit—bananas, for example—designers may have to include a scissor-like instrument to remove the fruit from the tree.

Designing a robot to locate the fruit in the tree’s foliage is another significant obstacle, according to Karkee. But no worries there: Researchers have actually figured out how trees can be grown to bear fruit near the outside of their canopy so robots can more easily harvest them.

“ When things are uncertain and variable, it becomes difficult to develop a robot that will always perform with the desired accuracy and robustness. ” — Manoj Karkee, Washington State University

“Trees and any biological systems we work with are by nature uncertain and variable,” Karkee said. “When things are uncertain and variable, it becomes difficult to develop a robot that will always perform with the desired accuracy and robustness.”

Karkee, for one, is not worried about how automation will reduce the number of jobs available. In fact, he thinks automating farming will increase the quality of available jobs. Instead of hard labor, workers could manage robots, putting less stress on their own bodies.

“Philosophically, we want to reduce hard labor jobs and have machines do them while creating better year-round jobs for people in supervising these machines and maintaining these machines,” Karkee said.

But there’s a long way to go still before there will be fully automated farms. While fruit picking is well on its way to being automated, jobs that require qualitative reasoning, like pruning, will be more of a challenge.

And there’s also cost. Karkee said that while large farms may be able to afford the switch to robots, smaller and medium-sized farms may not have that kind of capital. It’ll be a while before smaller, cheaper robots that are similarly efficient can be produced.

Even if robots are able to perform these more complicated tasks, farmers will be hesitant to adopt this technology until they’ve seen that it’s reliable and produces the same results that a human can.

“People take time to adopt new technologies,” Karkee said.