Quantcast

Ranger Interface messes up my data from driver

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Ranger Interface messes up my data from driver

JanStevens
Dear Mailing subscribers,

I'm working on a driver for the SICK LMS 100 laser. Everything is going fine but I notice some strange behavior of Stage/Player (using latest svn versions). After debugging I narrowed the problem down to the following:

I fill a vector with 361 values for the range data and set them all equal to 5, this means that in stage (if I draw them out) I should get a perfect halve circle (assuming my range goes form 0-180, hence the 361 values).

So this is my main loop:

void sicklms100::Main()
{
    while ( true )
    {
        pthread_testcancel();
        ProcessMessages();
       
        if ( laser_enabled )
        {
            player_ranger_data_range_t data;
            std::vector< double > range;
            lms100->readMeasurement ( &range );
            if ( !range.empty() )
            {
                data.ranges_count = range.size();
                data.ranges = new double[range.size()];
               
                for(std::vector<double>::iterator it = range.begin(); it != range.end(); ++it) {
                    if(*it != 5.0) {
                        std::cout << "Error: " << *it << std::endl;
                    }
                }
               
                Publish ( device_addr, PLAYER_MSGTYPE_DATA, PLAYER_RANGER_DATA_RANGE, &data );
                player_ranger_data_range_t_cleanup ( &data );
            }
        }
    }
}

As you can see I check if all my values equal 5, I don't get an error there. I then send back the ranger data and I use the following code to display my ranger measurements (which should be a perfect halve circle) back in stage.

void DrawRanges ( PlayerCc::RangerProxy * rangerProxy, PlayerCc::Graphics3dProxy * graphProxy)
{
    const int nRanges = rangerProxy->GetRangeCount();
    player_point_3d_t pts [ nRanges + 1 ];
    double minAngle = rangerProxy->GetMinAngle();
    double maxAngle = rangerProxy->GetMaxAngle();
    double angRes   = rangerProxy->GetAngularRes();
   
   
    //std::cout << "min: " << minAngle << "; max: " << maxAngle << "; res: " << angRes << "; ranges: " << nRanges << std::endl;
   
    double curAngle = minAngle;
    for ( int i = 0; i < nRanges; i++ )
    {

       
        if((*rangerProxy)[i] == 0) {
            cout << "Range: " << rangerProxy->GetRange(i) << " @ " << curAngle << endl;  
        }
       
        double x = (*rangerProxy)[i] * cos ( PlayerCc::dtor( curAngle ) );
        double y = (*rangerProxy)[i] * sin ( PlayerCc::dtor( curAngle ) );
       
        pts[i].px = x;
        pts[i].py = y;
        pts[i].pz = 0.1;
       
        curAngle += angRes;
    }
    pts[nRanges].px = 0.0;
    pts[nRanges].py = 0.0;
    pts[nRanges].pz = 0.1;
   
    graphProxy->Color( 0, 0, 255, 250 );
   
    graphProxy->Draw( PLAYER_DRAW_LINE_LOOP, pts, nRanges + 1 );
}

Now the output should be nothing (since it check if measurements where 0) but instead I get various measurements returning zero, knowing that I've set them all manually at 5.

The angles distances are almost always zero: 36, 36.5, 101, 101.5

so my question is simple, why does player/stage changes my data and set some values to zero? Also there is a lot of noise and other values also tend to be zero.

As you can see not a perfect halve circle

Thanks a lot to anyone that can help in this matter!

Kind Regards,
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ranger Interface messes up my data from driver

Rich Mattes-2
On 02/06/2013 08:09 AM, JanStevens wrote:

> Dear Mailing subscribers,
>
> I'm working on a driver for the SICK LMS 100 laser. Everything is going fine
> but I notice some strange behavior of Stage/Player (using latest svn
> versions). After debugging I narrowed the problem down to the following:
>
> I fill a vector with 361 values for the range data and set them all equal to
> 5, this means that in stage (if I draw them out) I should get a perfect
> halve circle (assuming my range goes form 0-180, hence the 361 values).
>
> So this is my main loop:
>
> void sicklms100::Main()
> {
>      while ( true )
>      {
>          pthread_testcancel();
>          ProcessMessages();
>          
>          if ( laser_enabled )
>          {
>              player_ranger_data_range_t data;
>              std::vector< double > range;
>              lms100->readMeasurement ( &range );
>              if ( !range.empty() )
>              {
>                  data.ranges_count = range.size();
>                  data.ranges = new double[range.size()];
>                  
>                  for(std::vector<double>::iterator it = range.begin(); it !=
> range.end(); ++it) {
>                      if(*it != 5.0) {
>                          std::cout << "Error: " << *it << std::endl;
>                      }
>                  }
>                  
>                  Publish ( device_addr, PLAYER_MSGTYPE_DATA,
> PLAYER_RANGER_DATA_RANGE, &data );
>                  player_ranger_data_range_t_cleanup ( &data );
>              }
>          }
>      }
> }
>
> As you can see I check if all my values equal 5, I don't get an error there.
> I then send back the ranger data and I use the following code to display my
> ranger measurements (which should be a perfect halve circle) back in stage.
>
> void DrawRanges ( PlayerCc::RangerProxy * rangerProxy,
> PlayerCc::Graphics3dProxy * graphProxy)
> {
>      const int nRanges = rangerProxy->GetRangeCount();
>      player_point_3d_t pts [ nRanges + 1 ];
>      double minAngle = rangerProxy->GetMinAngle();
>      double maxAngle = rangerProxy->GetMaxAngle();
>      double angRes   = rangerProxy->GetAngularRes();
>      
>      
>      //std::cout << "min: " << minAngle << "; max: " << maxAngle << "; res: "
> << angRes << "; ranges: " << nRanges << std::endl;
>      
>      double curAngle = minAngle;
>      for ( int i = 0; i < nRanges; i++ )
>      {
>
>          
>          if((*rangerProxy)[i] == 0) {
>              cout << "Range: " << rangerProxy->GetRange(i) << " @ " <<
> curAngle << endl;
>          }
>          
>          double x = (*rangerProxy)[i] * cos ( PlayerCc::dtor( curAngle ) );
>          double y = (*rangerProxy)[i] * sin ( PlayerCc::dtor( curAngle ) );
>          
>          pts[i].px = x;
>          pts[i].py = y;
>          pts[i].pz = 0.1;
>          
>          curAngle += angRes;
>      }
>      pts[nRanges].px = 0.0;
>      pts[nRanges].py = 0.0;
>      pts[nRanges].pz = 0.1;
>      
>      graphProxy->Color( 0, 0, 255, 250 );
>      
>      graphProxy->Draw( PLAYER_DRAW_LINE_LOOP, pts, nRanges + 1 );
> }
>
> Now the output should be nothing (since it check if measurements where 0)
> but instead I get various measurements returning zero, knowing that I've set
> them all manually at 5.
>
> The angles distances are almost always zero: 36, 36.5, 101, 101.5
>
> so my question is simple, why does player/stage changes my data and set some
> values to zero? Also there is a lot of noise and other values also tend to
> be zero.
>
> <http://player-stage-gazebo.10965.n7.nabble.com/file/n18576/laser-error.png>
>
> Thanks a lot to anyone that can help in this matter!
>
> Kind Regards,
>
Do you see your "5" values when you run playerprint or playerv?

Are you calling Read() on your PlayerClient?

Rich


------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ranger Interface messes up my data from driver

JanStevens
Thanks for your response,

The output of playerprint gives me the same, some values are really small:

#Ranger (62:0)
Device pose: (0, 0, 0), (0, 0, 0)
Device size: (0.1, 0.1, 0)
Configuration:
Minimum angle: 0 Maximum angle: 180 Angular resolution: 0.5
Minimum range: 6.90258e-310 Maximum range: 20 Range resolution: 0.03
Scanning frequency: 50
361 range readings:
  [6.90256e-310, 6.90256e-310, 6.90256e-310, 6.90256e-310, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4.11557e-321, 6.90256e-310, 6.90256e-310, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 9.0167e-321, 6.90256e-310, 6.90256e-310, 6.90256e-310, 6.90256e-310, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1.3488e-321, 6.90256e-310, 6.90256e-310, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1.43081e-320]

#Ranger (62:0)
Device pose: (0, 0, 0), (0, 0, 0)
Device size: (0.1, 0.1, 0)
Configuration:
Minimum angle: 0 Maximum angle: 180 Angular resolution: 0.5
Minimum range: 6.90258e-310 Maximum range: 20 Range resolution: 0.03
Scanning frequency: 50
361 range readings:
  [6.90256e-310, 6.90256e-310, 6.90256e-310, 6.90256e-310, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4.11557e-321, 6.90256e-310, 6.90256e-310, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 9.0167e-321, 6.90256e-310, 6.90256e-310, 6.90256e-310, 6.90256e-310, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1.9812e-321, 6.90256e-310, 6.90256e-310, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1.43081e-320]

Playerv starts up but when I try to subscribe to the device I get the following errors:
fritz@fritz-laptop:~$ playerv
PlayerViewer 3.1.0-svn
Connecting to [localhost:6665]
playerc warning   : warning : [Player v.3.1.0-svn] connected on [localhost:6665] with sock 10

Available devices: localhost:6665
ranger:0         sicklms100                              ready
simulation:0     stage                                   unsupported
graphics3d:0     stage                                   unsupported
playerv: malloc.c:3806: _int_malloc: Assertion `victim->fd_nextsize->bk_nextsize == victim' failed.
Aborted (core dumped)

Or this error pops up also after the malloc error:

fritz@fritz-laptop:~$ playerv
PlayerViewer 3.1.0-svn
Connecting to [localhost:6665]
playerc warning   : warning : [Player v.3.1.0-svn] connected on [localhost:6665] with sock 10

Available devices: localhost:6665
ranger:0         sicklms100                              ready
simulation:0     stage                                   unsupported
graphics3d:0     stage                                   unsupported
Segmentation fault (core dumped)


Kind Regards,
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ranger Interface messes up my data from driver

JanStevens
Forgot to add, yes I'm doing a robot.Read() in my while function;

int main ( int argc, char *argv[] )
{
    PlayerCc::PlayerClient robot ( "localhost" );
    PlayerCc::RangerProxy rangerProxy ( &robot, 0 );
    PlayerCc::Graphics3dProxy graphProxy ( &robot, 0 );
   
    rangerProxy.RequestGeom();
    rangerProxy.RequestConfigure();
   
    while ( true )
    {
        robot.Read();
        DrawRanges(&rangerProxy, &graphProxy);
    }
}

Kind Regards,
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ranger Interface messes up my data from driver

JanStevens
I've solved my problem. I never really copied the result of my range scan. The solution is simply:

 // Allocate the memory for the array
data.ranges = new double[range.size()];
// copy the vector to the array
memcpy(data.ranges, &range[0], sizeof(double)*range.size());
// Clear the vector
range.clear();

Now I get good results, playerv still wont work (segment fault).

Thanks for your help,

kind regards
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ranger Interface messes up my data from driver

Rich Mattes-2
On 02/07/2013 07:48 AM, JanStevens wrote:

> I've solved my problem. I never really copied the result of my range scan.
> The solution is simply:
>
>   // Allocate the memory for the array
> data.ranges = new double[range.size()];
> // copy the vector to the array
> memcpy(data.ranges, &range[0], sizeof(double)*range.size());
> // Clear the vector
> range.clear();
>
> Now I get good results, playerv still wont work (segment fault).
>
> Thanks for your help,
>
> kind regards
>
>

I noticed that after I sent my first mail; I was just hoping that you
just left that part out of your copy and paste :/

I wonder why playerv is crashing though.  Are you implementing the
PLAYER_RANGER_REQ_GET_CONFIG and PLAYER_RANGER_REQ_GET_GEOM calls in
your driver? Is there any way you can run it in gdb and provide a
backtrace?  There are some details on how to at [1].

Thanks,

Rich

[1] http://playerstage.sourceforge.net/wiki/Debugging_with_GDB

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ranger Interface messes up my data from driver

Raf Berkvens
Dear Rich

I'm working with Jan on the same driver. I've checked the PLAYER_RANGER_REQ_GET_CONFIG and PLAYER_RANGER_REQ_GET_GEOM calls with the existing LMS200 driver. They seem to do the same thing, our driver and that driver.

Here's a backtrace of running playerv with gdb three times, since the crash doesn't seem to repeat at the same point every time.

$ gdb playerv
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
Reading symbols from /usr/local/bin/playerv...done.
(gdb) run
Starting program: /usr/local/bin/playerv 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
PlayerViewer 3.1.0-svn
[New Thread 0x7fffef7e1700 (LWP 7338)]
[New Thread 0x7fffeefe0700 (LWP 7339)]
Connecting to [localhost:6665]
playerc warning   : warning : [Player v.3.1.0-svn] connected on [localhost:6665] with sock 14

[New Thread 0x7fffe5ffe700 (LWP 7340)]
Available devices: localhost:6665
ranger:0         sicklms100                              ready
simulation:0     stage                                   unsupported
graphics3d:0     stage                                   unsupported
playerv: /home/raf/PlayerStage/Player/rtk2/rtk_fig.c:534: rtk_fig_calc: Assertion `child->parent == fig' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff5e46425 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff5e46425 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007ffff5e49b8b in __GI_abort () at abort.c:91
#2  0x00007ffff5e3f0ee in __assert_fail_base (fmt=<optimized out>, assertion=0x42307c "child->parent == fig", 
    file=0x423050 "/home/raf/PlayerStage/Player/rtk2/rtk_fig.c", line=<optimized out>, function=<optimized out>) at assert.c:94
#3  0x00007ffff5e3f192 in __GI___assert_fail (assertion=0x42307c "child->parent == fig", file=0x423050 "/home/raf/PlayerStage/Player/rtk2/rtk_fig.c", line=534, 
    function=0x423153 "rtk_fig_calc") at assert.c:103
#4  0x000000000041c02d in rtk_fig_calc (fig=0x7ffff61c8788) at /home/raf/PlayerStage/Player/rtk2/rtk_fig.c:534
#5  0x000000000041b707 in rtk_fig_show (fig=0x7ffff61c8788, show=1) at /home/raf/PlayerStage/Player/rtk2/rtk_fig.c:313
#6  0x0000000000416d7f in ranger_draw (ranger=0x7366e0) at /home/raf/PlayerStage/Player/utils/playerv/pv_dev_ranger.c:251
#7  0x0000000000416a3c in ranger_update (ranger=0x7366e0) at /home/raf/PlayerStage/Player/utils/playerv/pv_dev_ranger.c:179
#8  0x0000000000409429 in main (argc=1, argv=0x7fffffffe288) at /home/raf/PlayerStage/Player/utils/playerv/playerv.c:372
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/local/bin/playerv 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
PlayerViewer 3.1.0-svn
[New Thread 0x7fffef7e1700 (LWP 7344)]
[New Thread 0x7fffeefe0700 (LWP 7345)]
Connecting to [localhost:6665]
playerc warning   : warning : [Player v.3.1.0-svn] connected on [localhost:6665] with sock 14

[New Thread 0x7fffe5ffe700 (LWP 7346)]
Available devices: localhost:6665
ranger:0         sicklms100                              ready
simulation:0     stage                                   unsupported
graphics3d:0     stage                                   unsupported

Program received signal SIGSEGV, Segmentation fault.
0x000000000042023f in rtk_region_test_empty (region=0xee2630) at /home/raf/PlayerStage/Player/rtk2/rtk_region.c:132
132  if (region->rect.width * region->rect.height == 0)
(gdb) bt
#0  0x000000000042023f in rtk_region_test_empty (region=0xee2630) at /home/raf/PlayerStage/Player/rtk2/rtk_region.c:132
#1  0x00000000004200ca in rtk_region_set_union (regiona=0xee2630, regionb=0x7ffff61c8868) at /home/raf/PlayerStage/Player/rtk2/rtk_region.c:70
#2  0x000000000041bf1a in rtk_fig_calc (fig=0x7ffff61c8788) at /home/raf/PlayerStage/Player/rtk2/rtk_fig.c:510
#3  0x000000000041b707 in rtk_fig_show (fig=0x7ffff61c8788, show=1) at /home/raf/PlayerStage/Player/rtk2/rtk_fig.c:313
#4  0x0000000000416d7f in ranger_draw (ranger=0x7366e0) at /home/raf/PlayerStage/Player/utils/playerv/pv_dev_ranger.c:251
#5  0x0000000000416a3c in ranger_update (ranger=0x7366e0) at /home/raf/PlayerStage/Player/utils/playerv/pv_dev_ranger.c:179
#6  0x0000000000409429 in main (argc=1, argv=0x7fffffffe288) at /home/raf/PlayerStage/Player/utils/playerv/playerv.c:372
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/local/bin/playerv 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
PlayerViewer 3.1.0-svn
[New Thread 0x7fffef7e1700 (LWP 7349)]
[New Thread 0x7fffeefe0700 (LWP 7350)]
Connecting to [localhost:6665]
playerc warning   : warning : [Player v.3.1.0-svn] connected on [localhost:6665] with sock 14

[New Thread 0x7fffe5ffe700 (LWP 7351)]
Available devices: localhost:6665
ranger:0         sicklms100                              ready
simulation:0     stage                                   unsupported
graphics3d:0     stage                                   unsupported

Program received signal SIGSEGV, Segmentation fault.
0x000000000042023f in rtk_region_test_empty (region=0xffffec390fe0) at /home/raf/PlayerStage/Player/rtk2/rtk_region.c:132
132  if (region->rect.width * region->rect.height == 0)
(gdb) bt
#0  0x000000000042023f in rtk_region_test_empty (region=0xffffec390fe0) at /home/raf/PlayerStage/Player/rtk2/rtk_region.c:132
#1  0x00000000004200ca in rtk_region_set_union (regiona=0xffffec390fe0, regionb=0x7ffff61c8868) at /home/raf/PlayerStage/Player/rtk2/rtk_region.c:70
#2  0x000000000041bf1a in rtk_fig_calc (fig=0x7ffff61c8788) at /home/raf/PlayerStage/Player/rtk2/rtk_fig.c:510
#3  0x000000000041b707 in rtk_fig_show (fig=0x7ffff61c8788, show=1) at /home/raf/PlayerStage/Player/rtk2/rtk_fig.c:313
#4  0x0000000000416d7f in ranger_draw (ranger=0x736760) at /home/raf/PlayerStage/Player/utils/playerv/pv_dev_ranger.c:251
#5  0x0000000000416a3c in ranger_update (ranger=0x736760) at /home/raf/PlayerStage/Player/utils/playerv/pv_dev_ranger.c:179
#6  0x0000000000409429 in main (argc=1, argv=0x7fffffffe288) at /home/raf/PlayerStage/Player/utils/playerv/playerv.c:372

From what I can read here, it seems to be connected with the rtk drawing. 

Kind regards
Raf Berkvens


On 8 February 2013 05:16, Rich Mattes <[hidden email]> wrote:

I noticed that after I sent my first mail; I was just hoping that you
just left that part out of your copy and paste :/

I wonder why playerv is crashing though.  Are you implementing the
PLAYER_RANGER_REQ_GET_CONFIG and PLAYER_RANGER_REQ_GET_GEOM calls in
your driver? Is there any way you can run it in gdb and provide a
backtrace?  There are some details on how to at [1].

Thanks,

Rich

[1] http://playerstage.sourceforge.net/wiki/Debugging_with_GDB


------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ranger Interface messes up my data from driver

Raf Berkvens
Dear Rich

I forgot to include a list of the code being executed at the time of the last two crashes. Here it is:

(gdb) list
127
128
129 // Test to see if a region is empty.
130 int rtk_region_test_empty(rtk_region_t *region)
131 {
132  if (region->rect.width * region->rect.height == 0)
133    return 1;
134  return 0;
135 }
136

Kind regards
Raf Berkvens

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ranger Interface messes up my data from driver

JanStevens
Dear mailing subscribers,

I noticed that when I take a log from a stage laser (so simulation) I'm able to playback that data as expected. When I take a log from our driver and then try to play it back playerv crashes again. So there must be something in the log file thats different and also the reason why playerv crashes (and maybe we can backtrace this to a setting or thingy thats wrong).

The log file from the stage laser:

0000000000.000 16777343 6665 ranger 00 004 001 +00.230 +00.000 +00.000 +00.000 +00.000 +00.000 +00.100 +00.100 +00.000 0001 +00.000 +00.000 +00.100 +00.000 +00.000 +00.000 0001 +00.020 +00.020 +00.020
0000000000.200 16777343 6665 ranger 00 004 005 -1.570796 1.570796 0.008702 0.000000 8.000000 0.020000 10.000000

The log file from our laser:
0000000002.000 16777343 6665 ranger 00 004 001 +00.230 +00.000 +00.000 +00.000 +00.000 -00.150 +00.100 +00.100 +00.000 0000 0000
0000000002.000 16777343 6665 ranger 00 004 005 0.500000 -45.000000 0.000100 0.000000 20.000000 0.030000 0.000000

So yes some numbers are different, but I have no clue what they actually mean (and where the problem is). But something is wrong in those first 2 lines because after that It are just range scans (and they seem oke).

Thanks!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ranger Interface messes up my data from driver

JanStevens
Dear mailing-list subscribers,

And I found the issue, stupid mistake of course, but for anyone writing their own driver this might be useful. We started from the lms200 driver but this is a laser interface, and we forgot to update the HANDLE_CAPABILITITY_REQUEST to correspond to a ranger interface instead of a laser interface.

A small bug that make playerv crash. Also in the ranger interface everything is in radians instead of degrees (our laser is configured in degrees, but we return the values are radians). Everything works now :)

Thanks,

Regards,
Loading...