After testing human-robot cooperation in space with its Kirobo robot, Toyota is working on a smaller version – actually a cup-holder sized robot – that can keep people company while they drive.

Dubbed the Kirobo Mini, the nearly 4-in. tall robot is designed to detect and respond to the driver's emotions, speech and gestures.

The robot, which could be installed in future Toyota vehicles, would not only be aimed at keeping drivers alert and calm but could collect information about driving habits that engineers could potentially use to build better features for future cars.

"With people spending an average of 4.3 years of our lives in our cars, which equates to traveling to the moon and back three times, Toyota believes that much can be learned about our behavior and emotion while driving," Toyota said on its website. "Imagine how driving would change if Kirobo Mini's technology was integrated into Toyota vehicles: We could assimilate hours of data to better the everyday lives of drivers all over the world, informing future innovations and developing transport that's in tune with the driver's mood, suggesting places to visit, routes to travel and music to listen to."

Toyota demonstrated the technology at the Tokyo Motor Show 2015 this week.

Toyota built the original Kirobo, a small, humanoid robot that was launched to the International Space Station in the summer of 2013 to take part in what was the first experiment on conversation between a human and a robot in space.

That version of Kirobo, which was a 13.4-in. tall, 2.2-pound humanoid, black-and-white robot, worked with Japanese astronaut Koichi Wakata. The robot was designed to remember Wakata's face so it could recognize and have conversations with the astronaut and even relay information to him from Earth.

With its conversational abilities, researchers hoped to determine if the robot could keep Wakata company. Scientists also were hoping that the experiment in space could speed their work on creating robotic companions that would be small enough to fit in someone's pocket.

Researchers around the world are working on building robots that can act as human companions and care givers.

The machines need to not only be able to communicate with people but also be able to interpret their facial expressions, body language and moods. The robots also need to be agile enough to safely move around a home or office and not make people fearful of them.

In June, SoftBank Robotics Corp., based in Japan, sold all of its 1,000 personal robots within the first minute they were put on sale. The robot, called Pepper, sold for $1,600 and requires a $200 monthly fee. The machines are designed to read human emotions and to display their own emotions as well.

And guests at the Aloft hotel in Cupertino, Calif., have been able to interact with a robotic butler that delivers snacks or toiletries to their room.

That robot, called Butlr can call for an elevator and navigate the hotel's lobby and hallways to get to guests' rooms.

The robotic butler is working out so well for the hotel chain that it is adding the robot to other properties.