Bug in playerc_ranger_calculate_points() (or elsewhere) or misconfiguration?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug in playerc_ranger_calculate_points() (or elsewhere) or misconfiguration?

Fred Labrosse
All,

While playing more with stage, I realised that I was not getting any points in
my rangers.  In fact, I was getting 8 (as defined in the pioneer front sonar
array in the example pioneer.inc file from stage, but they were all set to 0.

Delving into player, I realised that this was because device->element_count is
0 in the function playerc_ranger_calculate_points().  I don't understand what
this is supposed to represent (in particular if this can be different from
points_count or ranges_count) but I tried to follow where it is set.  This
seems to come from the geometry but since I don't understand that variable, I
don't know if the 0 I get is OK or a bug, or a bad configuration somewhere.

If I replace

      if (device->element_count == 1)

with

      if (device->element_count <= 1)

in playerc_ranger_calculate_points(), then all works fine.  I noticed that
there are many more functions that have similar tests, so I guess this is not
the bug, but I don't know where to look.

Anyone has any idea?

Cheers,

Fred

P.S.  This is using player svn and stage-4.1.1.

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users
Reply | Threaded
Open this post in threaded view
|

Re: Wrong number of elements in ranges with stage (Was: Bug in playerc_ranger_calculate_points() (or elsewhere) or misconfiguration?)

Fred Labrosse
On Thursday 09 February 2012 20:36:17 Fred Labrosse wrote:

> All,
>
> While playing more with stage, I realised that I was not getting any points
> in my rangers.  In fact, I was getting 8 (as defined in the pioneer front
> sonar array in the example pioneer.inc file from stage, but they were all
> set to 0.
>
> Delving into player, I realised that this was because device->element_count
> is 0 in the function playerc_ranger_calculate_points().  I don't
> understand what this is supposed to represent (in particular if this can
> be different from points_count or ranges_count) but I tried to follow
> where it is set.  This seems to come from the geometry but since I don't
> understand that variable, I don't know if the 0 I get is OK or a bug, or a
> bad configuration somewhere.
>
> If I replace
>
>       if (device->element_count == 1)
>
> with
>
>       if (device->element_count <= 1)
>
> in playerc_ranger_calculate_points(), then all works fine.  I noticed that
> there are many more functions that have similar tests, so I guess this is
> not the bug, but I don't know where to look.
>
> Anyone has any idea?

I think I now understand part of the story.  A sick scanner, for example, has
a single element but with many ranges.  The angular resolution is then
computed from the fov and number of samples, coming from the stage config file.

In the case of sonars (on pioneers for example), there are 8 elements (for the
front only).  Each has 1 sample and their angular resolution is therefore 0.

This is why my solution above does not work (at least for sonars).  The px
field is set to the range and the py field is set to 0, always.  And the fact
that element_count is 0 is indeed a bug and should be 8 in the case of 8 front
sonars.  I'm not sure where this should be set though.

Any pointer would be much appreciated.

Cheers,

Fred

>
> Cheers,
>
> Fred
>
> P.S.  This is using player svn and stage-4.1.1.
>

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users
Reply | Threaded
Open this post in threaded view
|

Re: Wrong number of elements in ranges with stage (Was: Bug in playerc_ranger_calculate_points() ( or elsewhere ) or misconfiguration?)

Fred Labrosse
On Thursday 09 February 2012 21:17:06 Fred Labrosse wrote:

> On Thursday 09 February 2012 20:36:17 Fred Labrosse wrote:
> > All,
> >
> > While playing more with stage, I realised that I was not getting any
> > points in my rangers.  In fact, I was getting 8 (as defined in the
> > pioneer front sonar array in the example pioneer.inc file from stage,
> > but they were all set to 0.
> >
> > Delving into player, I realised that this was because
> > device->element_count is 0 in the function
> > playerc_ranger_calculate_points().  I don't understand what this is
> > supposed to represent (in particular if this can be different from
> > points_count or ranges_count) but I tried to follow where it is set.
> > This seems to come from the geometry but since I don't understand that
> > variable, I don't know if the 0 I get is OK or a bug, or a bad
> > configuration somewhere.
> >
> > If I replace
> >
> >       if (device->element_count == 1)
> >
> > with
> >
> >       if (device->element_count <= 1)
> >
> > in playerc_ranger_calculate_points(), then all works fine.  I noticed
> > that there are many more functions that have similar tests, so I guess
> > this is not the bug, but I don't know where to look.
> >
> > Anyone has any idea?
>
> I think I now understand part of the story.  A sick scanner, for example,
> has a single element but with many ranges.  The angular resolution is then
> computed from the fov and number of samples, coming from the stage config
> file.
>
> In the case of sonars (on pioneers for example), there are 8 elements (for
> the front only).  Each has 1 sample and their angular resolution is
> therefore 0.
>
> This is why my solution above does not work (at least for sonars).  The px
> field is set to the range and the py field is set to 0, always.  And the
> fact that element_count is 0 is indeed a bug and should be 8 in the case
> of 8 front sonars.  I'm not sure where this should be set though.
>
> Any pointer would be much appreciated.

After more exploration, the plot thickens (for me at least).  playerv (a C
client) displays the sonars correctly an the ranger_draw() function has the
correct number of elements.  And this is set in playerc_ranger_copy_geom(), as
testified by a printf I added.

When I use my C++ client, element_count is equal to 0 and never set (the
function playerc_ranger_copy_geom() is not called, and as far as I can see
this is the only function that sets this variable).

This is therefore not a stage issue but a bug in the C++ library.

I'm running out of ideas where to look, so any suggestion would be more than
welcome.

Cheers,

Fred

P.S.  Sorry for the bombardment of emails, but I need to fix that urgently.

>
> Cheers,
>
> Fred
>
> > Cheers,
> >
> > Fred
> >
> > P.S.  This is using player svn and stage-4.1.1.
>
> ---------------------------------------------------------------------------
> --- Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Playerstage-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/playerstage-users

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users
Reply | Threaded
Open this post in threaded view
|

[SOLVED?] Re: Wrong number of elements in ranges with stage (Was: Bug in playerc_ranger_calculate_points() ( or elsewhere ) or misconfiguration?)

Fred Labrosse
On Friday 10 February 2012 08:12:24 Fred Labrosse wrote:

> On Thursday 09 February 2012 21:17:06 Fred Labrosse wrote:
> > On Thursday 09 February 2012 20:36:17 Fred Labrosse wrote:
> > > All,
> > >
> > > While playing more with stage, I realised that I was not getting any
> > > points in my rangers.  In fact, I was getting 8 (as defined in the
> > > pioneer front sonar array in the example pioneer.inc file from stage,
> > > but they were all set to 0.
> > >
> > > Delving into player, I realised that this was because
> > > device->element_count is 0 in the function
> > > playerc_ranger_calculate_points().  I don't understand what this is
> > > supposed to represent (in particular if this can be different from
> > > points_count or ranges_count) but I tried to follow where it is set.
> > > This seems to come from the geometry but since I don't understand that
> > > variable, I don't know if the 0 I get is OK or a bug, or a bad
> > > configuration somewhere.
> > >
> > > If I replace
> > >
> > >       if (device->element_count == 1)
> > >
> > > with
> > >
> > >       if (device->element_count <= 1)
> > >
> > > in playerc_ranger_calculate_points(), then all works fine.  I noticed
> > > that there are many more functions that have similar tests, so I guess
> > > this is not the bug, but I don't know where to look.
> > >
> > > Anyone has any idea?
> >
> > I think I now understand part of the story.  A sick scanner, for example,
> > has a single element but with many ranges.  The angular resolution is
> > then computed from the fov and number of samples, coming from the stage
> > config file.
> >
> > In the case of sonars (on pioneers for example), there are 8 elements
> > (for the front only).  Each has 1 sample and their angular resolution is
> > therefore 0.
> >
> > This is why my solution above does not work (at least for sonars).  The
> > px field is set to the range and the py field is set to 0, always.  And
> > the fact that element_count is 0 is indeed a bug and should be 8 in the
> > case of 8 front sonars.  I'm not sure where this should be set though.
> >
> > Any pointer would be much appreciated.
>
> After more exploration, the plot thickens (for me at least).  playerv (a C
> client) displays the sonars correctly an the ranger_draw() function has the
> correct number of elements.  And this is set in playerc_ranger_copy_geom(),
> as testified by a printf I added.
>
> When I use my C++ client, element_count is equal to 0 and never set (the
> function playerc_ranger_copy_geom() is not called, and as far as I can see
> this is the only function that sets this variable).
>
> This is therefore not a stage issue but a bug in the C++ library.
>
> I'm running out of ideas where to look, so any suggestion would be more
> than welcome.

I solved it, although I am not sure this is not a bug.  If I explicitly call
RangerProxy::RequestGeom(), then it all works.

The question is: should this function really have to be explicitly called?  I
certainly never had to with the old sonar and laser proxies.

Cheers,

Fred


>
> Cheers,
>
> Fred
>
> P.S.  Sorry for the bombardment of emails, but I need to fix that urgently.
>
> > Cheers,
> >
> > Fred
> >
> > > Cheers,
> > >
> > > Fred
> > >
> > > P.S.  This is using player svn and stage-4.1.1.
> >
> > -------------------------------------------------------------------------
> > -- --- Virtualization & Cloud Management Using Capacity Planning
> > Cloud computing makes use of virtualization - but cloud computing
> > also focuses on allowing computing to be delivered as a service.
> > http://www.accelacomm.com/jaw/sfnl/114/51521223/
> > _______________________________________________
> > Playerstage-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/playerstage-users
>
> ---------------------------------------------------------------------------
> --- Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Playerstage-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/playerstage-users

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users
Reply | Threaded
Open this post in threaded view
|

Re: [SOLVED?] Re: Wrong number of elements in ranges with stage (Was: Bug in playerc_ranger_calculate_points() ( or elsewhere ) or misconfiguration?)

Geoffrey Biggs-3
On 10/02/12 18:45, Fred Labrosse wrote:
> I solved it, although I am not sure this is not a bug.  If I explicitly call
> RangerProxy::RequestGeom(), then it all works.
>
> The question is: should this function really have to be explicitly called?  I
> certainly never had to with the old sonar and laser proxies.

The old sonar and laser proxies didn't depend on geometry to understand
the data. Since the ranger proxy does, probably the call should be added
in either the C++ class's constructor or in a similar place in the C
client library.

Geoff

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users