SoftBank Robotics documentation What's new in NAOqi 2.5?

New qi C++ SDK


What is the C++ SDK for

  • Develop with your favorite IDE: Visual Studio, QtCreator, Eclipse or XCode.
  • Use the NAOqi framework on your PC. You can run the NAOqi executable on your platform, and use it with a simulator, or you can use the framework to write software which communicates with your robot.
  • On Linux and Mac, you can cross-compile libraries to embed in Aldebaran robots.

C++ SDK specificities

Please make sure to have read the Key concepts section first.

Additionaly, there are a few things that are C++ specific, one key difference is that there are only generic proxies in the qi framework (yet). The generic proxy has no information about the methods which are bound to these modules. This means that the user must specify himself the name and parameters of the methods: if there is a mistake somewhere, it will raise an exception during execution. This kind of proxy is more error-prone, but very flexible since it can adapt to any module. For user-created modules that have no specialized proxy, this is your only choice.

#include <qi/anyobject.hpp>

const std::string phraseToSay = "Hello world";
qi::SessionPtr session = qi::makeSession();
session->connect("tcp://nao.local:9559");
qi::AnyObject proxy = session->service("ALTextToSpeech");
proxy.call<void>("say", phraseToSay);

// Or, if the method returns something, you
// must use a template parameter
bool ping = proxy.call<bool>("ping");

Deprecated features

The ancient framework is now deprecated. There is no replacement for specialized proxies yet (though you can still use the old ones with the new framework).

ALValue is also deprecated (it can still be used, and most of our API still use it) and is replaced by real types (vector, map, ...).

For more information about the cohabitation of the old and new framework, refer to Porting C++ code from NAOqi1 to NAOqi2.

Installation

Please read the C++ SDK - Installation Guide section.

Samples and tutorials

The main tutorial can be found in the Creating a new application outside Choregraphe using the qi Framework section.

It is recommended that you use qiBuild to build your projects.

Please make sure to also read the Local modules section.