We have released four Choregraphe boxes that may be useful for hackathons using Pepper. We look forward to helping you.
The box is available at https://github.com/takujikawata/webapiboxlibrary.
(2017/4/30 Some box libraries have been changed to work with NAOqi2.5.5)
Here, the sample box is published in the form of a box library. Please refer to the following for how to load the box library.
http://qiita.com/Atelier-Akihabara/items/db907ed319b8af0984db#%E3%83%9C%E3%83%83%E3%82%AF%E3%82%B9%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA%E3%81%AE%E8%AA%AD%E3%81%BF%E8%BE%BC%E3%81%BF
I will give an overview of the four sample boxes
A box that issues an HTTP request. The result is output in the box output onStopped. Request URL set in properties
Connection example: Access http://mysrv.com/ and Pepper speaks the contents
A box that issues an HTTP request and sends the file specified in the properties to the request URL. The response from the server is output to the output output of the box.
Connection example: Send the file image.jpg in the project to http: // srv / image. Pepper speaks response from server
A box that issues an HTTP request and saves the response from the server in the file specified in the properties. The path of the saved file is printed in the box's onStopped output.
Connection example: Access http: // mysrv / voice. Save the result in a file called voice.wav. Play in the Play Sound File box
A box for making WebSocket connections. Set the property Server URI to the URI to connect to in the format ws: //. The onStart input call establishes a connection with the server. Send a message to the server by sending a string to the sendMessage input, the onMessage output will output the message from the server.
Connection example: WebSocket connection to ws: // wssev / ws. The Speech Reco box sends the voice-recognized content to the server and utters a message from the server.
The Simple HTTP request, Upload file, and Download File boxes each use the requests module. The requests module is installed on Pepper itself, but not on the virtual robot. To make these boxes available to virtual robots, go to the directory of your Choregraphe project under development and run the following recommendations:
virtualenv env
./env/bin/pip install requests --target lib --no-compile
The WebSocket box uses the websocket-client module. The app that handles the WebSocket box will go to the Choregraphe project directory, run the following recommendations, and load the required modules into the project.
virtualenv env
./env/bin/pip install websocket-client --target lib --no-compile
** After completing the above work, you should have created a folder called env and a folder called lib. Of these, the env folder is a file that is not needed for the project, so delete it after completing the above preparation work. (Since the file under this is large, if you open Choregraphe with this folder left, Choregraphe will freeze when reading the file,) **
Example:
rm -r env
I introduced a box that seems to be useful for development in hackathons. I hope it will be useful for prototyping development.
Recommended Posts