Re: Can't publish laser data
Chris Chambers <[email protected]>
| Newsgroups | gmane.science.robotics.playerstage |
|---|---|
| Message-ID | <[email protected]> |
Are you meaning to look at "Lintensity1[i]" for i=3, 4 and 5, rather than "Lintensity1[i-data.ranges_count/2]" instead (to get 0 1 and 2 indices)? ~Chris On 7 June 2010 04:29, aneves <[email protected]> wrote: > > 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 > -- CONFIDENTIAL INFORMATION This transmission contains information from INRO Technologies Ltd that is confidential or privileged. The information is intended to be for the use of the individual or entity named on this transmission. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this transmission is prohibited. ------------------------------------------------------------------------------ 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