I ran player under ddd (a wrapper for gdb) and indeed, it seems that the maximum number of visible beacons is being overrun with my larger environments.
This happens in stg_driver.cc, somewhere in this function:
void StgDriver::RefreshDataFiducial( device_record_t* device )
memset( &pdata, 0, sizeof(pdata) );
size_t datalen = stg_model_get_data(device->mod, fids, 100*sizeof(fids) );
if( datalen > 0 )
size_t fcount = datalen / sizeof(stg_fiducial_t);
assert( fcount > 0 );
pdata.count = htons((uint16_t)fcount);
for( int i=0; i<(int)fcount; i++ )
pdata.fiducials[i].id = htons((int16_t)fids[i].id);
// 2D x,y only
double xpos = fids[i].range * cos(fids[i].bearing);
double ypos = fids[i].range * sin(fids[i].bearing);
pdata.fiducials[i].pos = htonl((int32_t)(xpos*1000.0));
pdata.fiducials[i].pos = htonl((int32_t)(ypos*1000.0));
// yaw only
pdata.fiducials[i].rot = htonl((int32_t)(fids[i].geom.a*1000.0));
// player can't handle per-fiducial size.
// we leave uncertainty (upose) at zero
// publish this data
this->PutData( device->id, &pdata, sizeof(pdata), NULL);
The value of fcount at the beginning of the for loop is sometimes greater than 32. This causes player to seg fault at the last line of the function.
I am sorry this probably not the precise information you are looking for - I am quite unproficient with debuggers.
Thanks for your help.
Cathy Laporte wrote:
> I"m using Player 1.6.3 with Stage 1.6.2 and am currently experiencing
> odd behaviour from Player. My world is created using a cfg file such as
> The number of "beacon" models in the world file may vary. Player seems
> to crash when the number of beacons is large (75 beacons are enough to
> make it crash). Shortly after initialisation of the client, I get the
> following error messages:
>  Segmentation fault player map100.cfg
Without looking at the code, I would guess that a maximum number of
visible beacons is being overrun (e.g., 75 > 32). There should be
checks to make sure that doesn"t happen.
Try running player under gdb, and send a backtrace. You might also try
valgrind; it should point out exactly where the overrun occurs.
Brian P. Gerkey gerkey@...
Stanford AI Lab http://ai.stanford.edu/~gerkey <http://ai.stanford.edu/%7Egerkey>
From: Brian Gerkey <brian@ge...> - 2005-07-13 22:45:22
On Jul 5, 2005, at 1:01 PM, Cathy Laporte wrote:
> I ran player under ddd (a wrapper for gdb) and indeed, it seems
> that the maximum number of visible beacons is being overrun with my
> larger environments. This happens in stg_driver.cc, somewhere in
> this function
That's what I figured. I've submitted a bug on your behalf:
Until it's fixed, a workaround would be to add a check in that
function to truncate fiducial reporting to the first 32.