Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning Robotics using Python

You're reading from  Learning Robotics using Python

Product type Book
Published in May 2015
Publisher Packt
ISBN-13 9781783287536
Pages 330 pages
Edition 1st Edition
Languages
Concepts

Table of Contents (19) Chapters

Learning Robotics Using Python
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Introduction to Robotics Mechanical Design of a Service Robot Working with Robot Simulation Using ROS and Gazebo Designing ChefBot Hardware Working with Robotic Actuators and Wheel Encoders Working with Robotic Sensors Programming Vision Sensors Using Python and ROS Working with Speech Recognition and Synthesis Using Python and ROS Applying Artificial Intelligence to ChefBot Using Python Integration of ChefBot Hardware and Interfacing it into ROS, Using Python Designing a GUI for a Robot Using Qt and Python The Calibration and Testing of ChefBot Index

Working with AIML and Python


To check whether the module is properly installed on your machine, open a Python IDLE and import the aiml module:

>>> import aiml

If the module is imported correctly, it will not show any error and comes to the next line. Then, we can confirm that the installation is correct.

The most important class we are handling in the aiml module is Kernel(). We are mainly using this class to learn from AIML files and get a response from the AIML dataset to user input. The following line will create an object of the aiml.Kernel() class:

>>> mybot = aiml.Kernel()

After creating the Kernel() object, we can assign the robot name using the following command. We will assign Chefbot as the name for this robot:

>>> mybot.setBotPredicate("name","Chefbot")

The next step is to learn AIML files. We can load either a single AIML file or a group of AIML files. To load a single AIML file, we can use the following command. Note that the sample.aiml file must be...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}