Wednesday, March 14, 2012

Jazz now supports ROS

Gostai Technologies provides a ROS API for the Jazz robot through the Urbi/ROS bridge (available in Urbi 2.7 here).
This interface provides access to all sensors and effectors and allows the use of all ROS stacks (more than 2000 modules) with the robot.

Visit the Jazz-ROS official page here.



An example of application was already published in a previous post.

Monday, March 5, 2012

Uobject profiling

If you want profile your uobjects in an Urbi engine, try this piece of code:


Global.removeSlot("displayStats");
function Global.displayStats(d)
{
  enableStats(true);
  clearStats();
  sleep(d);
  var s = getStats();
  s = s.asList.sort(function(a, b) {
    a[1][0]*a[1][3] > b[1][0]*b[1][3]
  });
  for|(var i in s)
  {
    var comps = i[0].asString.split(".");
    if (hasSlot(comps[0]))
      comps[0] = getSlot(comps[0]).asString;
    if (comps.size < 2)
      comps.insertBack("")
    else
    {
      var c2 = comps[1].split(" --> ");
      if (c2.size == 2)
      {
        if (hasSlot(c2[1]))
          c2[1] = getSlot(c2[1].asString);
        comps[1] = c2[0] + " --> " + c2[1];
      }
    };
    var percent=(i[1][0]*i[1][3]/d)/10000;
    var hz=i[1][3]/d;
    echo(" %s %% %s Hz  %s.%s  %s" %
      [percent, hz, comps[0], comps[1],  i[1]])
  };
};

// And now you can just use it with
displayStats(10s);
// to get statistics during 10s

You can find the source file here: profile.u.