README.md 7.77 KB
Newer Older
1
# Choregraphe Tutorial
2
This project contains all code and installation instructions neccessary to follow the Choregraphe Tutorial in which we get Pepper moving!
Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
3

Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
4
In order to participate in this tutorial you will need Choregraphe installed to run code on Pepper. Choregraphe is a graphical programming interface with which you can quickly get access to very high level functions of Pepper such as speech recognition. There are also optional instructions to install NAOqi already which is the Python 2.7 interface with which you can program Pepper. So if you want to use Pepper for any of the sprints this installation guide for NAOqi helps you install the neccessary software. The instructions to installing both of these are below:
Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
5

Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
6

7
# Installing Choregraphe
8

9
1. Start by downloading the `Choregraphe Setup version 2.5.10, Win 32` from the [Choregraphe download page](https://developer.softbankrobotics.com/pepper-2-5/downloads/pepper-naoqi-25-downloads-windows).
10
11
12

> Note: If you are not using Windows you can click on Downloads and select either Linux or Mac to download the right installer. I will continue using the Windows version but your installation procedure should be similar.

Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
13
2. Execute the downloaded `choregraphe-suite-2.5.10.7-win32-setup.exe`.
14

Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
15
3. Click "next", then accept the licence agreement and click "next" again.
16
17
18

4. Choose for a the Quick installation mode, again click "next" and Choregraphe should start installing.

19
5. At the end of the installation leave the checkmark to launch Choregraphe and click "finish".
20

21
6. Once Choregraphe runs for the first time it will ask for a license key here enter the key: `654e-4564-153c-6518-2f44-7562-206e-4c60-5f47-5f45`
22

Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
23
24
25
26
27
28
29
# Tutorial Preparation
Now you've got all the software above installed you are almost fully prepared for the Choregraphe Robot interaction tutorial. As a last step we will configure Choregraphe to use the built in virtual robot. This is a simulator that renders Pepper executing your code so you can see the movements you program. To initialize and connect to your virtual robot, follow these steps:

* `Edit > Preferences > Virtual robot` - Change the robot to Pepper Y20 (V16).
* `Connect > Connect to virtual robot`

This virtual robot has limited capabilities compared to the real robot: any visual, auditory or sensory functions do not work. This virtual robot is really only meant for checking if you are not producing any dangerous movement. The qiBullet simulator, for which there's a tutorial [here](https://gitlab.tue.nl/ha800-hri/tutorials/intelligent-robots-co-rdinate-transformations/sprint-2/-/tree/master/qibullet), allows you to simulate other behaviors as well. 
Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
30
As a last step please watch the [`Introduction to Choregrape.mp4`](https://gitlab.tue.nl/ha800-hri/tutorials/intelligent-robots-co-rdinate-transformations/choreography-tutorial/-/blob/main/Introduction%20to%20Choregraphe.mp4) video. In this video the interface of Choregraphe is briefly explained so you can quickly get started during the tutorial.
Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
31

Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
32
Now that the virtual robot has been connected and you've watched the introductory video you are fully prepared for the tutorial. However, to get started more quickly and get your virtual robot to move for the first time you could already check out the examples in this Gitlab repository in the folder [`Choregraphe Old Examples`](https://gitlab.tue.nl/ha800-hri/tutorials/intelligent-robots-co-rdinate-transformations/choreography-tutorial/-/tree/main/Choregraphe%20old%20Examples). This folder contains three very nice examples made by Thomas Wagenaar and a good introductory README.md. See if you can already run the movement example on the virtual robot and see Pepper come to life and maybe even let it move yourself in just a few minutes of work. There's also an introductory video to Choregraphe called `Introduction to Choregraphe.mp4` which is there for the people who cannot attend the tutorial and it is also a good summary to refresh your knowledge on Choregraphe if you use it in a later sprint. 
Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
33

Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
34
35
36
37
# Documentation
This repository is mainly focused on supplying all of the information for the 2021/2022 tutorial on Robots and environments using Choregraphe. In 2020/2021 Thomas Wagenaar made a set of tutorials for Choregraphe, NAOqi and qiBullet for which the documented code can still be found in the [`Choregraphe NAOqi qiBullet -20-21-`](https://gitlab.tue.nl/ha800-hri/tutorials/intelligent-robots-co-rdinate-transformations/sprint-2) repository. Here you will find installation instructions, examples and documentation for these three robot programming/simulating environments which you could use as a good starting point for this sprint or future sprints. 

# (Optional) Installing NAOqi
38

Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
39
In order to install NAOqi we need Python version `2.7.18`, version `3` will not work. Specifically we need the 32-bit version of Python `2.7.18` as the 64-bit version will not work either. Therefore install Python **`2.7.18` 32-bit** as follows:
40

Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
41
### Installing Python 2.7.18 32-bit
42

Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
43
1. Download the installer [here](https://www.python.org/downloads/release/python-2718/), for Windows choose the `Windows x86 MSI installer` **not the 64-bit version**.
44
45
46

> Note: If you already had the 64-bit version of Python 2.7 installed remove this version and replace it with the 32-bit version.

Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
47
2. Run the installer you just downloaded.
48
49
50

3. (Optional) Test if you installed Python 2.7 correctly by writing a small python file and running it using `py -2 myfile.py`. For more detailed instructions on this look at the last step of installing NAOqi.

Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
51
### Installing the NAOqi Python SDK
52

Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
53
After Python 2.7 has been successfully installed we can now install NAOqi itself using the following steps:
54

Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
55
1. Download the Python SDK from its [download page](https://developer.softbankrobotics.com/pepper-2-5/downloads/pepper-naoqi-25-downloads-windows).
56

Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
57
2. Go to `C:\Program Files (x86)` and create a new folder with the name `softbank`
58

Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
59
3. Unzip the downloaded zipfile, and place the `bin`, `lib` and `share` folders inside this `softbank` folder
60

Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
61
4. We will now need to make sure that Python knows where to find this SDK by adding its location to the "PYTHONPATH" environment variable. This can be done as follows:
62
63
64
65
66
67
68
69
70

- Press the Windows key, type "environment" and click on "Edit the system environment variables".

- Below on the right press "Environment Variables..."

- Press the first "New..."

- Enter "PYTHONPATH" as the variable name and enter `C:\Program Files (x86)\softbank\lib`as the variable value.

Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
71
5. Now NAOqi should have been succesfully installed which we will check by importing the library in an exemplary file. This can be done using the following steps:
72
73
74
75
76
77
78
79
80
81
82
83
84

- Make a python file in a directory of choice called `naoqi_test.py`. You can do this using your text editor of choice like Notepad (already installed in Windows), Atom or Pycharm (the editor used during the tutorials).

- In this python file add the single line `import naoqi`, now save and close the file.

- Now open the Windows command prompt by pressing the Windows key and typing `cmd`.
- Navigate to the folder where you put your `naoqi_test.py` file.

> Note: If you don't know how to move through your directories [here](https://www.howtogeek.com/659411/how-to-change-directories-in-command-prompt-on-windows-10/) is a quick tutorial. Note that you can see the contents of your current directory with the command `dir`.

- Now you're in the folder of `naoqi_test.py` and you can see the file using the `dir` command execute: `py -2 naoqi_test.py`. If this gives no errors (so it outputs nothing) NAOqi has been installed successfully!


Boksebeld, N.H.J.'s avatar
Boksebeld, N.H.J. committed
85
86
87

> These instructions were made using the [NAOqi installation guide](https://developer.softbankrobotics.com/pepper-naoqi-25/naoqi-developer-guide/sdks/python-sdk/python-sdk-installation-guide). Documentation of NAOqi can be found in the [Developer guide](https://developer.softbankrobotics.com/pepper-naoqi-25/naoqi-developer-guide).