If a pedestrian is about to step into the street, how does a self-driving car know to begin braking? If a semi-autonomous car gets into a dangerous situation while the driver is checking his email, how should the car alert the driver to pay attention?

These are some of the questions that Massachusetts companies and researchers are currently working to answer. While the technology behind self-driving cars is still being developed, the industry is progressing at a rapid pace -- and some of the nation's biggest car companies and technology companies are pouring money into research and development, including a $1 billion research effort being led by a former professor at Olin College of Engineering in Needham.

Massachusetts, as a state that prides itself on innovation and academia, could find itself in a strong position to benefit from the burgeoning industry. But state officials are still figuring out what opportunities there are, and what regulations must be implemented to keep the streets safe.

"What's happening in self-driving cars right now, and the speed and amount of money that's going into it and the importance of it, is sort of the equivalent of what was happening in the 1960s with the race to the moon," said Roger Matus, vice president of products and markets at Boston-based Neurala. The company is developing software for the auto industry to allow cars to anticipate hazards.

"The interest of industry right now is trying to encourage Massachusetts as a place where a lot of this development is taking place," he said.

Nationally, much of the technology related to self-driving cars is coming out of Silicon Valley in California -- a traditional technology hub -- and Detroit, the center of the automotive industry. But there are other pockets of activity. For example, the ride-sharing service Uber just hired a number of researchers from Carnegie Mellon's robotics center in Pittsburgh.

Massachusetts could be ripe for development into one of these centers. Toyota recently announced a five-year, $1 billion investment in researching artificial intelligence and robots, with the goal of building a self-driving car. The money is split between Palo Alto, Calif. and Cambridge, and the project is being led by Gill Pratt, a former Olin College professor, with a team that includes MIT and Olin College professors.

The Cambridge start-up nuTonomy, which was founded by MIT professors, recently announced that it secured $3.6 million in venture capital funding to develop decision-making software for automated cars.

Other companies working on autonomous vehicle-related technology in Massachusetts include Autoliv Electronics in Lowell, Amazon Robotics in North Reading and NextDroid Labs.

Companies are also funding research at Massachusetts universities. Shlomo Zilberstein, professor of computer science at UMass Amherst, and Donald Fisher, a professor in the UMass Amherst mechanical and industrial engineering department, are collaborating on a project funded by the National Science Foundation and General Motors. They are developing ways to transfer control from an automated driving system to a human driver in a semi-autonomous car.

There is little consensus about how many years it will take for fully automated cars to hit the roads nationwide, although some are already being tested. But researchers like Zilberstein point out that some automated features are already commercially available -- such as cars that can park themselves, or cars that automatically brake when they come too close to another car.

Experts predict that there will be continued progress over the next decade, with more automated features and semi-autonomous cars coming online.

"There is a lot going on. There is a lot of progress, and there is a tremendous amount of resources dedicated to research in this area right now," Zilberstein said. "No car company wants to be caught unprepared for this."

The federal government is also putting money into the field.

The Volpe National Transportation Systems Center, a Cambridge-based research center run by the U.S. Department of Transportation, is one place where the work is being done. Fisher, who works for the Volpe Center while continuing to do research at UMass Amherst, is editing a handbook at the Volpe Center on how human factors will interact with intelligent cars. Fisher said the center has divisions focused on using autonomous vehicles to reduce crashes, reduce congestion and reduce carbon emissions. The center is also working to coordinate private and public efforts on self-driving cars nationally and internationally.

"The Volpe Center's the major force for advancing research and for coordinating both federal and private efforts to develop automated vehicles that reduce crashes, congestion and carbon emissions," Fisher said.

The growing industry has led Massachusetts officials to grapple with two questions: Should Massachusetts take steps to encourage industry growth here, and what does the state need to do to regulate the technology?

The Massachusetts Technology Collaborative, a public economic development agency aimed at advancing the technology industry, has commissioned a study of the state's robotics industry, which includes self-driving cars, to look at what the economic development opportunities are. A draft of the study is due in April.

"If we are going to make an investment... we want to make sure we're making the smartest investment for Massachusetts based on our strengths," said Katie Stebbins, assistant secretary of innovation, technology, and entrepreneurship for Massachusetts' Executive Office of Housing and Economic Development.

Massachusetts officials are also considering a proposal to use part of a former U.S. Army base in Devens as a test facility for self-driving cars.

The Massachusetts departments of Housing and Economic Development and Transportation are organizing a meeting with industry representatives, researchers, planners and others about what Massachusetts needs to do to regulate the industry. A February meeting was cancelled due to snow, and state officials are trying to reschedule it for the spring.

"We have to look at Massachusetts state policies and find out how well the policies that we have on the books align with the testing for self-driving cars," Stebbins said. "The law states currently, a human has to be driving a car."

Obviously, this is not only a Massachusetts issue. Congress recently held hearings on self-driving cars, and the U.S. Department of Transportation is planning meetings in Washington, D.C. and California to develop guidelines for the safe use of self-driving technology.

Stebbins said part of what state officials are doing is keeping on top of what is happening nationally and in other states. "We want to make sure we're tuned in so we're not thinking about Massachusetts policies in a vacuum," Stebbins said.

Industry experts say as the technology progresses, there are both short-term and long-term policy implications.

"The real question that a lot of people are asking is in 50 years," Matus said, "will you be allowed to drive your own car?"