Can't publish laser data

aneves <[email protected]>
Newsgroups gmane.science.robotics.playerstage
Message-ID <[email protected]>
Hi everyone!

I'm trying to create a plugin driver for Player to do GridSLAM. I haven't
got experience in writing drivers so i followed some tutorials. 

I started by trying to create a simple exempledriver which requires to
lasers and provides a 3rd laser with the ranges of the first one in the left
side and the ranges of the second on the right side (just a "hello world"
kind of thing)

I think my code is right but i can't seem to publish the data to use in a
client program.

This is the part of the code where i think is the problem:
 
===============================================================
for (unsigned int i=0; i < data.ranges_count/2; i++)
{
   
        data.intensity[i] = this->Lintensity0[i];
        data.ranges[i] = this->Lranges0[i];
	//debug prints
	printf(" r[%d]=%1.2f ",i,data.ranges[i]);
}
printf("\n");
for (unsigned int i=data.ranges_count/2; i<data.ranges_count; i++)
{
        data.intensity[i] = this->Lintensity1[i];
        data.ranges[i] = Lranges1[i];
	//debug prints
	printf(" r[%d]=%4.2f ",i,data.ranges[i]);
    }

  
// Increment outgoing scan ID
data.id = this->scan_id++;

// Make data available to other devices
 this->Publish(this->laser2ID, NULL, PLAYER_MSGTYPE_DATA,
PLAYER_LASER_DATA_SCAN, (void*)&data, 0, &time);
==================================================================

My client program just calls the laser and prints its number of ranges and
range-values. 

But this is the output i'm getting:
==============================================
calling connect
done
GetCount=5
laser[0]7.58714e+31
laser[1]6.86636e-44
laser[2]0
laser[3]0
laser[4]0

GetCount=5
laser[0]7.58714e+31
laser[1]6.86636e-44
laser[2]0
laser[3]0
laser[4]0

GetCount=5
laser[0]7.58714e+31
laser[1]6.86636e-44
laser[2]0
laser[3]0
laser[4]0

GetCount=5
laser[0]7.58714e+31
laser[1]6.86636e-44
laser[2]0
laser[3]0
laser[4]0

GetCount=0
GetCount=0
GetCount=0
GetCount=0
...
=====================================

Anyone can tell me what I'm doing wrong??

Thanks in advance,

André Neves
DEEC - FCTUC
Coimbra, Portugal

-- 
View this message in context: http://old.nabble.com/Can%27t-publish-laser-data-tp28793169p28793169.html
Sent from the playerstage-developers mailing list archive at Nabble.com.


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Playerstage-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-developers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.