HENNIKER, N.H. — When Hector Xu was learning to fly a helicopter in college, he recalled having a few “nasty experiences” while trying to navigate at night.

The heart-stopping flights led to his research of unmanned aircraft systems while getting his doctorate in aerospace engineering at Massachusetts Institute of Technology. Then, he formed Rotor Technologies in 2021 to develop unmanned helicopters.

Rotor has built two autonomous Sprayhawks and aims to have as many as 20 ready for market next year. The company also is developing helicopters that would carry cargo in disaster zones and to offshore oil rigs. The helicopter could also be used to fight wildfires.

For now, Rotor is focused on the agriculture sector, which has embraced automation with drones but sees unmanned helicopters as a better way to spray larger areas with pesticides and fertilizers.

“People would call us up and say ‘Hey, I want to use this for crop dusting, can I?’ We’d say ‘OK maybe,’ ” Xu said, adding that they got enough calls to realize it was a huge untapped market.

Associated Press reporters were the first outside the company to witness a test flight of the Sprayhawk. It hovered, flew forward and sprayed before landing.

Rotor’s nearly $1 million Sprayhawk helicopter is a Robinson R44, but the four seats have been replaced with flight computers and communications systems, allowing it be operated remotely.

It has five cameras, laser-sensing technology and a radar altimeter that make terrain reading more accurate, along with GPS and motion sensors.

At the company’s hangar in Nashua, New Hampshire, Xu said this technology means there is better visibility of terrain at night.

One of the big draws of automation in agriculture aviation is safety.

Because crop dusters fly at 150 mph and only about 10 feet off the ground, there are dozens of accidents each year when planes crash into power lines, cell towers and other planes. Older, poorly maintained planes and pilot fatigue contribute to accidents.

A 2014 report from the National Transportation Safety Board found more than 800 agriculture operation accidents between 2001 and 2010, including 81 fatal. A separate report from the National Agriculture Aviation Association found nearly 640 accidents from 2014 until this month, with 109 fatalities.

“It is a very, very dangerous profession, and there are multiple fatalities every year,” said Dan Martin, a research engineer with the U.S. Department of Agriculture’s Agricultural Research Service. “They make all their money in those short few months, so sometimes it may mean that they fly 10 to 12 hours a day or more.”

In recent years, safety concerns and the cheaper cost has led to a proliferation of drones flying above farmers’ fields, Martin said, adding that 10,000 will likely be sold this year.

“It’s growing exponentially as a market, super fast,” he said.

But the size of the drones and their limited battery power means they only can cover a fraction of the area of a plane and helicopters. That is providing an opening for companies like Rotor and another, Pyka, building bigger unmanned aircraft.

California-based Pyka announced in August that it had sold its first autonomous electric aircraft for crop protection to a customer in the United States. Pyka’s Pelican Spray, a fixed-wing aircraft, received FAA approval last year to fly commercially for crop protection. The company also sold its Pelican Spray to Dole for use in Honduras and to the Brazilian company SLC Agrícola.

Lukas Koch, chief technology officer at Heinen Brothers Agra Services, the company that bought the Pelican Spray in August, has called unmanned aircraft part of a coming “revolution” that will save farmers money and improve safety.

The Kansas-based company operates out of airports from Texas to Illinois. Koch doesn’t envision the unmanned aircraft replacing all the company’s pilots but rather taking over the riskiest jobs.