Monday, March 31, 2014

ROS Hydro in Linux Mint: installation tutorial

First of all make sure your system is up-to-date by
$ sudo apt-get update
$ sudo apt-get upgrade
Download Hydro version of ROS: (full version includes: rviz simulator, 2D/3D simulators and other useful things)
$ sudo apt-get install ros-hydro-desktop-full
Set up your keys:
$ wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
Before using ROS, we need to initialize rosdep, which enables easy system dependencies installation required by ROS.
$ sudo rosdep init 
$ rosdep update
Then we set up environment for ROS and for that we need hydro setup.bash variables and better to add it to your ~/.bashrc file so it will be loaded each time you open bash
$ echo source /opt/ros/hydro/setup.bash >> ~/.bashrc 
and restart it
$ source ~/.bashrc 
Then install ROS command-line tool rosinstall - an easy way of downloading and installing useful ROS components
$ sudo apt-get install python-rosinstall
Here, you should be done with ROS itself, but to use ROS with NAO robot you need NAO stacks installed. For that you need your Naoqi Python SDK in PYTHONPATH variable, good way to add it to your .bashrc file:
export PYTHONPATH=~/NAO/pynaoqi-python-2.7-naoqi-1.14-linux64:$PYTHONPATH
Then you can install recompiled binaries by:
$ sudo apt-get install ros-hydro-nao-robot
But better way to keep your stacks up-to-date is to install it from repositories. Add next lines to your rosinstall.txt located in your local workspace (I use rosbuild workspace) and I use all the stacks so I listed them all:
- git:
    uri: https://github.com/ahornung/humanoid_msgs
    local-name: stacks/humanoid_msgs
- git:
    uri: https://github.com/ros-nao/nao_robot
    local-name: stacks/nao_robot
- git:
    uri: https://github.com/ahornung/nao_common
    local-name: stacks/nao_common
- git:
    uri: https://github.com/ros-nao/nao_extras
    local-name: stacks/nao_extras
- git:
     uri: https://github.com/ros-nao/nao_camera
     local-name: stacks/nao_camera
- git:
    uri: https://github.com/ahornung/humanoid_navigation
    local-name: stacks/humanoid_navigation

Run command that will download stacks from git:
$ rosinstall . /opt/ros/hydro rosinstall.txt
Then using rosdep install the stacks (you can list some of the stacks or all of them at the same time):
$ rosdep install humanoid_msgs nao_robot nao_common --os ubuntu:raring
!IMPORTANT here: stacks will not get install complaning on the Linux Mint system, so you should add
-- os ubuntu:raring
parameter whenever you want to install particular stack in Linux Mint system. And to get stacks working we need to compile them:
$ rosmake humanoid_msgs nao_robot nao_common
Congrats! If everything went well - it's pretty all what you have to do. To completely update stack you should first delete it from you local workspace and install it once again.

Monday, February 10, 2014

Concerning SDK selection

First thing to be done when starting working with NAO is selecting the SDK.
I have experienced the problem by wasting spending  the time on trying each of them. So, Aldebaran Robotics propose quite a variety of SDKs for different technologies and languages:
  • Python
  • C++ 
  • Java
  • and even .NET SDK which is not the last one, but I will concentrate on what I have tried. 
Having the most of my background in .NET area for sure I have started with .NET SDK.  Well, first it is Windows based. There is a reason for which you may actually  like Windows - is Visual Studio, nowadays it is incredible and very comfortable IDE (not at all advertising - just my personal opinion). Nevertheless nothing against Windows :) but it is not really suitable for working with NAO robot. 
Pluses Minuses
Variety of languages C#, F#, VB.NET .NET languages are not supported on the robot (just on computer to remotely access NAO)
Small size and easy integration with Visual Studio(included as dll and that's it) As a consequence of just remote access we cannot do fast access using remote module (direct memory access for example).

Java SDK promises support of Eclipse. Included as external naoqi.jar and compatible with any later version of the JVM except on Windows where only the 32-bit version of Java is supported.
Pluses Minuses
Easy integration Just 32 bits version of Java is supported on Windows
I consider Java language as a plus itself as it's wide used and rather easy Rather limited API (original API is C++ based and going deeply still requires knowledge of C++ SDK)

Python SDK - one of the easiest way to program for NAO.
Pluses Minuses
Python-small and powerful Being interpreted language, it might be slow
One of the most complete SDKs Compared to Java or C++ threading is not really well-performing
The most suitable SDK for beginners
Great code readability
Easy integrated with tools that Aldebaran proposes - Choregraphe

The most full framework and I would say one that NAO was born with is C++ SDK.
Pluses Minuses
Running in Linux provides both robot and computer compilation C++ is complicated - requires knowledge of C/C++ language
Linux + C++ SDK allow cross-compilation QtCreator - recommended by Aldebaran - I would say not the most comfortable IDE (again - just my personal opinion)
The most complete API

There are underlined some key points discovered by me by the moment and for sure this is far not a complete list of SDKs comparison, but this is what helped me to select C++ SDK in Linux system. I would recommend to use Linux for working with NAO as it allows easier integration of SDKs and also it is the only system with which it is possible to configure NAO robot through the wire(Local-Link an alternative to DHCP). These are some recommendations any different opinions and advices are appreciated ;)

Welcome ;)

Welcome to the blog about NAO robots!
Hello, I am a programmer and beginner in robotics started my way with NAO robot. According to not very big amount of information about NAO robots I decided to create a blog to find out useful issues while programming for NAO. The aim of this blog is to gather, share and discuss information we often need to work with NAOs. Hope to meet people interested in working in robotics and NAO robots in particular :)