Chapter 3. Building a Siri-Like Chatbot in ROS
Artificial intelligence, machine learning, and deep learning are getting very popular nowadays. All these technologies are linked, and the common goal is to mimic human intelligence. There are numerous applications for these fields; some of the relevant ones are as follows:
Logical reasoning: This will generate logical conclusions from existing data. Reasoning using AI techniques is widely used in areas such as robotics, computer vision, and analytics.
Knowledge representation: This is the study of how a computer could store knowledge fragments like our brains do. This is possible using AI techniques.
Planning: This concept is heavily used in robotics; there are AI algorithms such as A* (star) and Dijkstra for planning a robot's path from its current position to a goal position. It is also heavily used in swarm robotics for robot planning.
Learning: Humans can learn, right? What about machines? Using machine learning techniques, we can train...
In simple words, social robots are personal companions or assistive robots that can interact with human beings using speech, vision, and gestures. These robots behave like pets that can express emotions like us and can communicate their emotions using speech or gestures.
Nowadays, most social robots have an LCD display on their heads, actuators for movement, speakers and microphone for communication, and cameras for perception.
Here are some images of popular social robots:
Figure 1: Famous social robots
Let's learn about them:
Kismet
(a): This is a social robot from MIT by Dr. Cynthia Breazeal and team, made in the 1990s. Kismet can identify people and objects and simulate different emotions. Kismet was just a research robot, not a commercial product.
Jibo
(b): Jibo was conceived by Dr. Cynthia and team in 2014. Jibo has a rotating head with a screen, and it can communicate with people using speech recognition and can recognize them using perception techniques.
Pepper
(c): Pepper...
A service or social robot may have capabilities to perceive the world using inbuilt cameras, interact with humans using speech and make decisions using artificial intelligence algorithms. These kinds of robots are a bit complicated in design, we can see a typical building block diagram of a social robot in the following figure.
Figure 2: Block diagram of a typical social robot
The robot has sensors such as tactile sensor, camera, microphone, and touch screen and will have some actuators for its movement. The actuators will help the robot to move its head or body. There may be mobile service robots which has extra motors for navigation.
Inside the software block, you may can find modules for perception which handle camera data and finding necessary objects from the scene, speech recognition/synthesis, artificial intelligence modules, robot controller modules for controlling the actuators, decision-making node which combine all data from sensors and makes the final decision...
Here are the prerequisites for doing this project:
Let's get start with AIML.
Getting started with AIML
AIML (Artificial Intelligence Markup Language) is an XML-based language to store segments of knowledge inside XML tags. AIML files help us store knowledge in a structured way so that we can easily access it whenever required.
AIML was developed by Richard Wallace and the free software community worldwide between 1995 and 2002. You may have heard about chatter bots such as Artificial Linguistic Internet Computer Entity (A.L.I.C.E.) and ELIZA. AIML is the base of these chatter bots. The dataset of the A.L.I.C.E. chatter bot is available under the GNU GPL license, and there are open source AIML interpreters available in C++, Python, Java, and Ruby. We can use these interpreters to feed our input to the knowledge base and retrieve the best possible reply from it.
There is a set of AIML tags to represent knowledge inside files. The following are some of the important tags and their uses:
In this chapter, we discussed building a ROS package to make a robot interactive using artificial intelligence. Using this package, we can talk to a robot and the robot can answer your queries, like human-to-human interaction. The entire chapter was about building this communication system using AIML, which is the main component of this project. We discussed AIML tags, how to work with AIML files using Python, and ultimately, how to build a ROS package based on AIML for an interactive robot. In the next chapter, we will discuss interfacing boards with the ROS.