On 05/15/2012 06:15 AM, Claudio Carbone wrote:

Hello fellow users.

I'm back to player and stage after a few years of hiatus.

My last work has been a Dempster-Shafer based hexagonal mapping algorithm.

Didn't work that good as DS tends to saturate as everyone knows but anyway...

I had my nice program reading data from player and stage through the sonar interface.

Was using the simple world having removed the laser to better see the sonars I was plotting.

 

Now I installed the latest player trunk and latest stage trunk (3.1.0-svn and 4.1.1) and my old program doesn't want to work.

When I launch it, it can't find the sonar interface.

Player reports a request for an unknown interface

 

warning : skipping subscription to unknown device sonar:0

 

Now this seems coherent with the fact that the simple.cfg has

 

driver

(

   name "stage"

   provides [ "positon2d:0" "ranger:0" "ranger:1" ]

   model "r0"

)

 

But if I change the provides with

 

provides [ "positon2d:0" "sonar:0" "ranger:0" ]

 

player quits saying

 

Stage plugin: 6665.sonar.0 is err: error: stage driver doesn't support interface type 5

 

So apparently stage doesn't support sonar anymore?

I tried reverting to stage 3.2.2, 3.2.1, and even 3.2.0 but got the same results.

If that's the case my program should not compile, at least for how I view it if an interface isn't supported anymore headers shouldn't be available.

But it compiles.

 

So what am I missing here?

My stupid program does the following

 

#include <libplayerc/playerc.h>

client = playerc_client_create(NULL, player_host, player_port);

  if (0 != playerc_client_connect(client))

    return 1;

 

// Create and subscribe to a position2d device.

position2d = playerc_position2d_create(client, 0);

  if (playerc_position2d_subscribe(position2d, PLAYER_OPEN_MODE))

    return 2;

 

sonar=playerc_sonar_create(client,0);

  if (playerc_sonar_subscribe(sonar, PLAYER_OPEN_MODE))

    return 3;

playerc_client_read(client);

playerc_sonar_get_geom(sonar);

 

Then lots of geometric calculations with the sonar data.

Any help would be greatly appreciated.

Regards

 

Claudio Carbone



Hi Claudio,

The sonar, laser, and IR interfaces are slowly being deprecated in favor of the ranger interface.  The deprecated interfaces still exist in Player, which is why your program is still compiling.  Stage removed support for the laser and sonar interfaces in version 3, and all ranging devices it simulates now use Player's ranger interface.

You can do a couple of things to update your program.  The easiest thing to do would be to replace your sonar proxy with a ranger proxy in your client code, and modify your config files to be like simple.cfg with stage providing ranger interfaces.  Ranger and sonar similar enough that it shouldn't be too much trouble to do.  You can also try to make a driver that converts a ranger interface to a sonar interface; there is a driver that converts sonar to ranger that you could base it off, but it's probably not worth the trouble.

Hope this helps!

Rich