NAO Robot Instructions

Document created by gjsissons on Sep 23, 2016Last modified by dourada on Oct 7, 2016
Version 7Show Document
  • View in full screen mode

 

Overview

 

Information is provided here about the NAO robot for those that are going to accept the Vantiv API challenge at Money20/20. There will be some interesting challenges with the robot, but we believe without challenge there is no reward. The instructions below will help you get started.

 

Using Choregraphe

 

One of many cool things about the NAO environment is that you don't actually need to have a Robot to program a Robot. For Money2020 we will only have one shared robot, but this need not slow you down. You can get started immediately using the Choregraphe environment to build and test applications for your robot.

 

Before you can obtain the Choregraphe software and the other software described below, you will need to create a free customer account at the URL below.

 

https://store.aldebaran.com/default/customer/account/create/

 

You don't need to actually purchase a robot to create a customer account, but you will need an account before you can download the software. You can use Choregraphe on a trial-basis for 90 days which should be long enough for the Money 20/20 challenge.

 

Downloading the software

 

Once you've obtained your account, you can visit the URL to download the software.

https://community.ald.softbankrobotics.com/en/resources/software/language/en-gb

 

At a minimum you will want to download the following packages:

  • The Choregraphe suite for your operating system (Windows, MaxOS or Linux)
  • The Python NAOqi SDK (many of the tutorials and examples are in Python)
  • Simulators will be useful as you begin to write code so you can simulate how the robot interacts with a simulated physical environment

 

Other components including Document and SDKs for Java and C++ are available as well if you prefer to program in those environments.

 

The installation process is straightforward, but varies by operating environment. Unless you actually own a Robot, you will want to select Evaluation mode as shown below to obtain a license that is valid for 90 days.

 

installing_choregraphe.png

 

Once you install Choregraphe a Getting started screen will direct you to useful tutorials and code examples.

 

choregraphe_welcome_screen.png

 

A great to place to start is to look at the Python code example that gets the Robot to say "Hello World" under control of a simple Python script. This will illustrate how commands are sent to the Robot and this example can be easily extended to use other modules and capabilities on the robot.

 

How the Robot is Controlled

 

The NAO robot is equipped with many sensors and actuators. It runs a Linux operating environment on-board the Robot and the software environment on Linux that controls the robot is referred to as NAOqi. NAOqi is controlled by writing applications in your language of choice that connect via TCP/IP (via a WiFi connection) to the robot via a proxy called ALProxy()

 

Software developers write applications that control the robot in different ways:

  • They can write applications that run on an external computer and connect to the robot via the ALProxy() to get it to do things and retrieve information from the robot - speak, listen, walk, recognize faces etc.
  • Developers can also write their own modules that run on-board the robot providing a lot of flexibility. For example, you could build a payment module that performs payment transactions whenever the Robot successfully completes particular tasks thereby turning your Robot into a source of revenue. Nobody wants their Robot to be a freeloader after all!

 

NAOqi_architecture.png

 

An excellent tutorial is provided below by Jonas Lerebours of Aldebaran Europe that explains how to build software to control the Robot.  It describes how to build both applications that control the robot and modules that run on the Robot itself. The tutorial is focused on Python. It is 30 minutes long but is worth listening to. It can save a lot of reading by providing a birds eye view of the development process. The YouTube link is here.

 

webinar_thumbnail.PNG

 

Writing Code

 

You can write simple code inside Choregraphe or using your SDK of choice.

 

The easiest way to get started is to use the demo application built into ChoreGraphe. Select "Using Python in Choregraphe" to open HTML document that explains step by step how to connect to your physical or virtual Robot. The Sample Hello World application illustrates how to connect to the Robot via ALProxy() and make the Robot do something.

 

 

choregraphe_welcome_screen.png

 

The steps are self-explanatory, but we can create a new "Python Box" on the Choregraphe canvas and give it a name. In the example below we call the Python module "My Hello World".

 

choregraphe_main_screen.PNG

 

Double clicking on the Python object above opens the script editor below.  We define self.tts as a connection to the Robot's ALTextToSpeech module. We can use this module to make the Robot talk.

 

sample_python_script.PNG

 

We then add a statement to the module's onInput_onStart() method that will cause the Robot to say "Welcome to the Money 2020 Vantiv Hackathon" when the Start icon is pressed on the input to the module.

 

Using Vantiv's eComm services

 

At some point, if you accept this challenge, you'll need to make the Nao Robot interact with Vantiv's eCommerce payment APIs. You can connect to Vantiv's cloud resident endpoints from any device that can POST and GET XML via an SSL protected TCP/IP connection. This will probably be easier to do from an external service or cloud service than from the Robot itself, but we will leave these design decisions to you!

 

Similar to the Choreographe Python example above, there is another simple tutorial that explains how to control the Nao Robot by writing a Python script on a Windows / Linux or MacOS host and controlling the robot by opening a TCP/IP connect. The example and instructions for obtaining Python are here: http://doc.aldebaran.com/2-1/getting_started/helloworld_python.html. You can extend your Python script that controls the Nao Robot to also interact with Vantiv's eCommerce endpoints and process payments.

 

We'll provide some Python eCommerce connection examples in our  https://github.com/VantivLabs/eCommExamples.cURL repository to get you started! If you want to show off your skills, there are C++ or Java SDKs that can be used as well instead of Python.

 

  • A quick tutorial showing how to interact with Vantiv's XML-based HTTPS POST API is provided here here. You can find the simple cURL scripts in the same GitHub repository.
  • More resources including complete documentation for Vantiv's eCommerce platform are available here: eCommerce - There is an awful lot here, but you only need to master a few simple payment verbs to process payments.

 

 

 

 

Privacy Policy, Copyright Notices, and Terms of Use

NAO, NAOqi and Choreographe are registered or unregistered marks belonging to their respective owners who are unaffiliated with and do not endorse or sponsor Vantiv, and Vantiv likewise does not endorse or sponsor Softbank Robotics or Aldeberban.

Attachments

    Outcomes