The attacker carefully lined up the shot, but fired wide of the goal. A second kick was on target, the ball buried just inside the right post.

Then came the bane of any soccer player's existence: injury. Limbs flailing, the forward fell sprawling onto the field at the University of Pennsylvania, suffering from . . .

A stripped gear.

The World Cup gets under way Friday, but the injured player was practicing for another international tournament this month: RoboCup. Soccer played by robots. No water breaks required.

The annual event, in Singapore this year, is billed as "the world's largest robotics and artificial-intelligence event," with more than 400 teams from dozens of countries. Penn is fielding teams in two of the five divisions, as is Carnegie Mellon University in Pittsburgh - a Brazil of robot soccer.

Why?

Why not? Machines have licked humans everywhere from the chessboard to the assembly line, so they may as well have a go at the world's most popular sport. The stated goal of RoboCup organizers is for a team of two-legged, humanoid robots to beat a team of humans by 2050.

"That should be 100 percent possible," predicted Aylin Caliskan, one of the humans behind Penn's team, the UPennalizers.

At the moment, the robot is not quite there - especially the kind that walks on two legs. Soccer with humanoid robots is a sluggish affair. These electronic athletes could not keep pace with a team of kindergartners, much less the likes of the U.S. national team's Landon Donovan.

Two of RoboCup's five divisions, however, involve boxy robots on wheels, which are both fast and able to change direction in the blink of a computer processor. Aside from the fun and games, wheeled robots are being developed for use in emergency situations that might be unsafe for humans, such as entering a burning building or detecting a chemical threat.

Yet the human form retains a certain appeal for some, said Carnegie Mellon professor Manuela Veloso, the leader of that school's two teams and also president of the International RoboCup Federation.

"There are some psychology studies that show humans react better to machines that . . . look like them," said Veloso, though she doesn't profess to know why. "I am not really a psychologist. I am an engineer."

Dan Lee, an associate professor of engineering at Penn who advises the UPennalizers, said the concept of humanoid robots had been more popular in Asian countries, where they are seen as the ideal solution - someday - for common household chores.

At RoboCup, which starts June 19, Penn and Carnegie Mellon are both entered in the "standard platform" league - meaning all teams get the same type of factory-made, 22-inch-tall robots, but must write their own computer programs to guide them.

In collaboration with Virginia Tech, Penn also has entered a division that requires engineers to build their own humanoid robots in addition to writing the computer code. And Carnegie Mellon has entered one of the two divisions that feature wheeled robots - a competition the school won in 2006 and 2007, followed by a second-place finish in 2008. In 2009, CMU lost in the quarterfinals when a software bug took out the machines' ability to see.

For the standard-platform division, the field measures about 20 by 13 feet - the size of a spacious living room - and there are three robots on each team. Each has its own camera, located roughly where the mouth would be. Each machine costs more than $17,000 on one retailer's website, though the RoboCup teams get them at a steep discount. As in real soccer, there are penalties for pushing other players.

Penn has four of the robots, including a spare, all of them playfully named after cleaning products: Febreze, Lysol, Clorox, and Mr. Clean. But three of them currently need repairs, including Lysol, the one that stripped a gear Wednesday.

"It's like pulling your muscle," said Lee. "Instead of going to a doctor, you go to an engineer."

Lysol has broken four gears in the last week, said team leader Jordan Brindza, who just earned his undergraduate degree in engineering. The problem may be that the software directs the robot to walk and change direction at the same time, putting undue stress on its plastic parts, Brindza said.

Another challenge is getting the robots to adjust to variable light. They are trained to recognize objects by their color. The ball is orange, for example, and the goalposts are blue and yellow. But if the system is calibrated on a sunny day, cloudy skies can throw it for a loop, even though the practice room at Penn has the shades drawn.

The team is pinning its hopes on a strategy that involves lots of dribbling instead of big kicks.

In the wheeled division that Carnegie Mellon has entered, the school's engineers say they have a new approach that can anticipate the ball's location.

Most teams have their robots "see" the ball and react to it, operating on the basis of fixed instructions for various scenarios. The wheeled CMDragons, on the other hand, take into account the principles of physics, such as the friction between the ball and carpet.

Every 60th of a second, each robot "builds an entire search tree" of possible moves, and picks the best one, said Stefan Zickler, who developed the algorithm for his doctoral thesis.

Some of the Penn engineers are fans of real soccer, and Brindza has played midfielder on a recreational league back home in Maryland.

At CMU, however, the athletics are strictly between the ears.

"Nobody in the lab can actually play soccer," Zickler said. "We let the robots do the work."

Contact staff writer Tom Avril
at 215-854-2430 or tavril@phillynews.com.