Best Practise for developing with NAO and ROS?

357 views
Skip to first unread message

Stephan Opfer

unread,
Oct 27, 2014, 6:29:44 AM10/27/14
to ros-sig-...@googlegroups.com
Hi NAO Users,

I am not sure, what is the best way to develop and test ROS packages with the NAO Robot. I would like to develop and compile on my desktop pc and deploy the cross-compiled libraries onto the NAOs.

Greetings,
  Stephan

Okan Aşık

unread,
Oct 27, 2014, 6:46:23 AM10/27/14
to ros-sig-...@googlegroups.com
Hello,

I am also curious about the issue of development. I installed ros on Nao using virtual-nao os. I will develop code on my computer, copy the code/package to virtual-nao and compile and finally I will copy compiled packages to nao robot. Is that the current development cycle or is there anyone who developed cross-compilation cmake for nao robot packages?

Regards,
Okan

--
You received this message because you are subscribed to the Google Groups "ROS Sig Aldebaran" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ros-sig-aldeba...@googlegroups.com.
To post to this group, send email to ros-sig-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ros-sig-aldebaran.
To view this discussion on the web visit https://groups.google.com/d/msgid/ros-sig-aldebaran/d02b2865-9912-42de-ab18-7f7048d2d1bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vincent Rabaud

unread,
Oct 27, 2014, 7:15:46 AM10/27/14
to ros-sig-...@googlegroups.com
Before even dumping your code to NAO, you can use the NAOqi Python bindings locally.
And THEN cross-compile. There are no official instructions for compiling your own code but please write a tutorial !
It is like we do for the sources in the VM (at http://wiki.ros.org/nao/Installation/compileFromVirtualNao) and you have several examples out there (e.g. https://github.com/ros-nao/nao_sensors/blob/master/CMakeLists.txt#L38 ).

Séverin Lemaignan

unread,
Oct 27, 2014, 7:37:17 AM10/27/14
to ros-sig-...@googlegroups.com
Hi,

The way I usually work is by installing a ROS environment that I know is identical between the robot and the VM:
http://wiki.ros.org/nao/Installation/local

And then, as explained on this wiki page (section 2), I build on the VM and rsync on the robot.

In my experience, it's simple and fast.

Cheers,
Séverin


On 27/10/14 12:15, Vincent Rabaud wrote:
> Before even dumping your code to NAO, you can use the NAOqi Python bindings locally.
> And THEN cross-compile. There are no official instructions for compiling your own code but please write a tutorial !
> It is like we do for the sources in the VM (at http://wiki.ros.org/nao/Installation/compileFromVirtualNao) and you have several examples out there (e.g. https://github.com/ros-nao/nao_sensors/blob/master/CMakeLists.txt#L38 ).
>
> On Mon, Oct 27, 2014 at 11:45 AM, Okan Aşık <asik...@gmail.com <mailto:asik...@gmail.com>> wrote:
>
> Hello,
>
> I am also curious about the issue of development. I installed ros on Nao using virtual-nao os. I will develop code on my computer, copy the code/package to virtual-nao and compile and finally I will copy compiled packages to nao robot. Is that the current development cycle or is there anyone who
> developed cross-compilation cmake for nao robot packages?
>
> Regards,
> Okan
>
> 2014-10-27 12:29 GMT+02:00 Stephan Opfer <op...@vs.uni-kassel.de <mailto:op...@vs.uni-kassel.de>>:
>
> Hi NAO Users,
>
> I am not sure, what is the best way to develop and test ROS packages with the NAO Robot. I would like to develop and compile on my desktop pc and deploy the cross-compiled libraries onto the NAOs.
>
> Greetings,
> Stephan
>
> --
> You received this message because you are subscribed to the Google Groups "ROS Sig Aldebaran" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ros-sig-aldeba...@googlegroups.com <mailto:ros-sig-aldeba...@googlegroups.com>.
> To post to this group, send email to ros-sig-...@googlegroups.com <mailto:ros-sig-...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ros-sig-aldebaran/d02b2865-9912-42de-ab18-7f7048d2d1bd%40googlegroups.com <https://groups.google.com/d/msgid/ros-sig-aldebaran/d02b2865-9912-42de-ab18-7f7048d2d1bd%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups "ROS Sig Aldebaran" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ros-sig-aldeba...@googlegroups.com <mailto:ros-sig-aldeba...@googlegroups.com>.
> To post to this group, send email to ros-sig-...@googlegroups.com <mailto:ros-sig-...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ros-sig-aldebaran/CAP5grNR4Wy9TfcjGR%2BS_65d9-G4WjkgjxSZUZcDnL2y3_PA76w%40mail.gmail.com
> <https://groups.google.com/d/msgid/ros-sig-aldebaran/CAP5grNR4Wy9TfcjGR%2BS_65d9-G4WjkgjxSZUZcDnL2y3_PA76w%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups "ROS Sig Aldebaran" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ros-sig-aldeba...@googlegroups.com <mailto:ros-sig-aldeba...@googlegroups.com>.
> To post to this group, send email to ros-sig-...@googlegroups.com <mailto:ros-sig-...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ros-sig-aldebaran/CABKcRosXp5nf_wD%3DZRM1x2aDAS516dNY%3DEzj%2BamZw%3DgWZ-q5CQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/ros-sig-aldebaran/CABKcRosXp5nf_wD%3DZRM1x2aDAS516dNY%3DEzj%2BamZw%3DgWZ-q5CQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
signature.asc

Stephan Opfer

unread,
Oct 27, 2014, 12:54:04 PM10/27/14
to ros-sig-...@googlegroups.com
Hello,

as I understand are Vincent and Séverin compiling their source code on the virtual box. Please correct me, if I misunderstood your posts.

I had a look into the  cross-config.cmake file of the cross-toolchain provided by Aldebaran. All I found are a lot of cmake variables set, which simply forces cmake to use the provided gcc-crosscompiler of Aldebaran (found in the same archive under cross/bin/...).

Wouldn't it be possible to "simply" include this cross-config.cmake file in your NAO-Project-CMakeLists.txt?

For example call "$ catkin_make -DCMAKE_NAOFLAG" and have the following lines in your CMakeLists.txt:

if (CMAKE_NAO_FLAG)
  include(cross-config.cmake)
endif()

Probably you will also need another destination for your cross-compiled binaries, but, if that works, you can spare the VM-Step in your develop/deploy-cycle.

Greetings,
  Stephan

Vincent Rabaud

unread,
Oct 28, 2014, 7:16:34 AM10/28/14
to ros-sig-...@googlegroups.com
Hi, if you don't use a VM and robotpkg, you will have to compile ROS by yourself.

After talking with Karsten, we see 3 ways:
1) use Aldebaran's toolchain but that requires you to use qiBuild. It is because the CMake files in there are non-standard (e.g. variables are always capitalized like BOOST_SYSTEM_LIBRARIES, instead of the upstream Boost_LIBRARIES)
2) you compile ROS in a VM, export it in a tar with its dependencies, write the proper CMake file for the cross-compilation and make that whole package a toolchain.
3) create your own cross-compile CMake file that uses Aldebaran's toolchain but also redefines a few variables to make it usable by pure CMake (to circumvent the problem in 1). But in that case, you would need to also add a few pure CMake dependencies to build (like poco).

The third one is the one that requires the least amount of work on a daily basis (no need to qibuildize ROS like in 1 or keep moving files like in 2). It would also be reusable for compiling on Windows/OSX. More info here: http://www.cmake.org/Wiki/CMake_Cross_Compiling

If you start such a work, please announce it: it can go pretty fast.

There might also be something we can use from the Yocto ROS support: http://wiki.ros.org/hydro/Installation/OpenEmbedded

--
You received this message because you are subscribed to the Google Groups "ROS Sig Aldebaran" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ros-sig-aldeba...@googlegroups.com.
To post to this group, send email to ros-sig-...@googlegroups.com.

Stephan Opfer

unread,
Nov 17, 2014, 5:05:31 AM11/17/14
to ros-sig-...@googlegroups.com
Hi Vincent,

I started with the 3rd option. My setup consists of the ROS beginners tutorial (just talker.cpp), which I changed to let the NAO talk what ever string is published. I tested it with a redirected ROS_MASTER_URI and the NAO started to talk.

I had a look into the cross-config.cmake of the cross-toolchain from Aldebaran. The CMake-Flags set there, were looking promising. So I copied some stuff into my talker-project, which now looks like this:

test_nao_talker/
 -> cmake/
 |--> cross/ //as it is given in the Aldebaran Cross-toolchain
 |--> pthread/  //as it is given in the Aldebaran Cross-toolchain
 |--> cross-config.cmake
 -> src/
 |--> talker.cpp
 -> CMakeLists.txt
 -> package.xml

Afterwards I simply included the cross-config.cmake into the test_nao_talker/CMakeLists.txt: include(cmake/cross-config.cmake)

Unfortunately it wasn't that easy ;-)  My current problem is, that roscpp trys to use pthread and does not find it anymore. I guess because of the settings in the cross-config.cmake file.

Here you can see my catkin_make error:
CMake Error at /opt/ros/indigo/share/roscpp/cmake/roscppConfig.cmake:141 (message):
  Project 'test_nao' tried to find library 'pthread'.  The library is neither
  a target nor built/installed properly.  Did you compile project 'roscpp'?
  Did you find_package() it before the subdirectory containing its code is
  included?
Call Stack (most recent call first):
  /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:75 (find_package)
  cnc-naos/test_nao/CMakeLists.txt:11 (find_package)

Actually I was hoping that CMake finds it in "test_nao_talker/cross/i686-aldebaran-linux-gnu/sysroot/usr/lib/libpthread.so". I think, the question is, how can we teach ROS to use the cross-toolchain libraries for the "test_nao_talker" package.

Any suggestions are welcome. :)

Greetings,
  Stephan

Vincent Rabaud

unread,
Nov 17, 2014, 5:31:20 AM11/17/14
to ros-sig-...@googlegroups.com
Hi, what you should do to speed up the process:
- you get your code to some GitHub repo (without Aldebaran's cross-toolchain of course)
- add a README to say the instructions you are executing (commands that include dowloading the toolchain and unzipping it wherever, catkin_make ...)
You can then file bugs against your code and the community will help you there.
As a first quick sight, I'd say you need to define the CMAKE_TOOLCHAIN_FILE to point to the cross-config.cmake (and not include it, that's not how it works, cf http://www.cmake.org/Wiki/CMake_Cross_Compiling#The_toolchain_file).

--
You received this message because you are subscribed to the Google Groups "ROS Sig Aldebaran" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ros-sig-aldeba...@googlegroups.com.
To post to this group, send email to ros-sig-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ros-sig-aldebaran.

Stephan Opfer

unread,
Nov 17, 2014, 5:51:09 AM11/17/14
to ros-sig-...@googlegroups.com
Hi, I will setup such a GitHub repo (today or tomorrow).

When I just write "set(CMAKE_TOOLCHAIN_FILE cmake/cross-compile.cmake)" catkin ignores it and does not cross-compile it.

Greetings,
  Stephan

Vincent Rabaud

unread,
Nov 17, 2014, 6:02:01 AM11/17/14
to ros-sig-...@googlegroups.com
Right, that's not the way to do it: you need to do it on the command line -DCMAKE_TOOLCHAIN_FILE=cmake/cross-compile.cmake (cf examples of ROS with Arduino/Android here: https://github.com/ros/catkin/issues/484 ). Just announce your repo and we'll complete the README there.

--
You received this message because you are subscribed to the Google Groups "ROS Sig Aldebaran" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ros-sig-aldeba...@googlegroups.com.
To post to this group, send email to ros-sig-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ros-sig-aldebaran.

Stephan Opfer

unread,
Nov 18, 2014, 6:13:35 AM11/18/14
to ros-sig-...@googlegroups.com

The repository is up and I think we should switch to the new post accordingly: https://groups.google.com/forum/#!topic/ros-sig-aldebaran/9XZU8j7wQpU

heromoga2000

unread,
Jan 2, 2015, 4:17:29 AM1/2/15
to ros-sig-...@googlegroups.com
Hi
can you help me and tell  me how to setup using opennao vm and how to install ros ?

Dang Thi Hai Ha

unread,
Jan 2, 2015, 4:23:28 AM1/2/15
to ros-sig-...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages