Club robotique de Sophia-Antipolis

Home > Essais > Robots et kits > Aisoy > A journey with Aisoy > Explorer travelogue > 13/04/14

13/04/14

Thursday 8 May 2014, by Eric P.


All the versions of this article: [English] [français]

After have re-assembled the beast, we are ready to have a look to software now.

Since I have not (yet) understood what the botserver really was (more on this later), let’s use the good old school method. I connect to the RasPi using ssh, and as documented here, I start with :

sudo apt-get update && sudo apt-get install aisoy-raspberry

All seems to go well. Time to code a bit now 😛

First steps with software

As documentation, we can find a Hello world example program which... makes Aisoy says "Hello world". In fact, not really, since they have misspelled "world" in "word". Is this an English language mastering problem of a touch of humour ? Or maybe some kind of devotion for Microsoft Office...

The API C++ documentation is also available (Doxygen generated) and it has the good idea to include examples of use written in C++ and in Python. Good news 😉

But the bad news is that the examples I have tried just do not work 🙁 For instance, the example for mouthPrint() in Actuator class omits to indicate that lower case letters are not displayed. It took me some time to understand why none of the messages I tried to have displayed on the LED matrix were visible.

In fact this happened with the environment version I was using at that time, and a subsequent upgrade using botserver (more on this later) added the automatic conversion to upper case.

Another "joke" : mouthDraw() documentation mentions various geometries for the matrix and the provided code sample does not work. The reason is that despite what is said, off dots must be represented by a "0" and not by a space. In addition, I’ve the feeling that the sentence which deals with the 14 first dots of I-don’t-understand-what is not at the right place, and belongs to another method.

It crawls

We progress however and succeed in having a couple of tests running as expected. But it just runs like a snail :(

Having added some trace messages in the Hello World, I could notice that some statements take several seconds to complete. This is especially surprising since the CPU load is quite reasonable (between 40 and 60 percent). Even ssh lags a lot, although I’m using a wired network connection from end to end. It is like working on an Arduino trying to compute a cubic convolution of Landsat pictures [1]

A quick analysis of top command output shows that the CPU hogger is the camera related ROS node. There are a couple of other guys I don’t catch the usefulness for the moment, so I decide to comment them out in ROS initialisation sequence.

A solution

Where does it sit ?

In /opt/ros/fuerte/stacks/aisoy_launch/launch/aisoy.launch. This does not look quite obvious, but with a bit of logic, it can be easily deduced :

  • the init script named ros calls roslaunch aisoy_launch aisoy.launch, which means that it starts the aisoy.launch sequence which is part if the aisoy_launch stack
  • /opt/ros/fuerte/ : this is just the named of the installed ROS release (not quite recent by the way, since current version is hydro, which is two versions above, knowing that ROS releases seem to be distant by at least 6 months)
  • stacks/ is the directory containing the stacks, (ROS distribution units)

qED

Once this slimmed done, by commenting out parts we are not interested in for the moment, our Aisoy friend is far more responsive, and the RasPi behaves as we are used too. We will need to find the reason why such a poor responsiveness although the CPU load was far under 100%. Maybe memory usage is reaching 100%, and thus the system is paginating on the SD car ? Not really good news for the SD card if this is the case.

Some mechanics works in view

While testing various aspects, I noticed that the vertical move of the head does not work. We can hear some noise, but no move. Would it be the servo which cable has been damaged by the screw ? We will have to open the head too, and I guess that removing the screw taps will not be that simple 😕

By the way...

While investigating how to have the beast run faster, I tried to understand if it would be possible to work without ROS. Such frameworks are very interesting since they take care of a lot of plumbing for you, and let you concentrate on your own problem, but they are quite often very greedy, which is not that good if they do far more than you really need.

Some retro-engineering let me discover the communication protocol between the RasPi and the Jetpack board. This can be found in the sources of a module named freedom_node.py which implements the ROS-ification of the sensors and actuators controlled by the JetPack, and consists in simple ASCII messages sent on the USB serial link to the JetPack. (More on this in a soon to come article).

To be continued...


[1private joke related to a long long time ago internship while in engineering school 😢

Any message or comments?

pre-moderation

Warning, your message will only be displayed after it has been checked and approved.

Who are you?

To show your avatar with your message, register it first on gravatar.com (free et painless) and don’t forget to indicate your Email addresse here.

Enter your comment here

This form accepts SPIP shortcuts {{bold}} {italic} -*list [text->url] <quote> <code> and HTML code <q> <del> <ins>. To create paragraphs, just leave empty lines.