From: Rich M. <jp...@gm...> - 2011-01-20 16:31:57
|
> -----Original Message----- > From: Tyler Gunn [mailto:ty...@eg...] > Sent: Thursday, January 20, 2011 11:13 AM > To: pla...@li... > Subject: Re: [Playerstage-users] wifi model > > > On Thu, 20 Jan 2011 07:53:47 -0800 (PST), "T.sahar" > <tri...@ya...> > wrote: > > > In the method below: > > > void InterfaceWifi::Publish( void ) > > { > > ModelWifi* wmod = (ModelWifi*)this->mod; > > > > player_wifi_data_t pdata; > > memset( &pdata, 0, sizeof(pdata) ); > > > > // Translate the Stage-formatted sdata into the Player-formatted > pdata > > > > // Publish it > > this->driver->Publish(this->addr, > > PLAYER_MSGTYPE_DATA, > > PLAYER_WIFI_DATA_STATE, > > (void*)&pdata); > > } > > Note the comment "Translate the Stage-formatted sdata into the > Player-formatted pdata". This should read: "TODO". This is code I > never > implemented because I didn't need it. You'll need to look at the > player_wifi_data_t structure defined in player > (player/libplayerinterface/interfaces/023_wifi.def) and copy values > from > the wmod class instance to the pdata structure defined in there. > > I haven't done this myself, but it looks like in player it'll get you > basic information about link status to nearby robots in the stage > simulation. If you want to be able to send/receive messages between > robots > using the simulated wifi you'll need to add the ability to do that to > the > driver as well. > > Tyler > > -- > Tyler Gunn > ty...@eg... Just to clarify: libstageplugin _is_ a Player driver. Once it's modified to publish wifi messages, that's it; you don't have to modify any Player code. Looking at the provided code, you're zeroing out a player_wifi_data_t struct and publishing it. You'll have to modify the Player .cfg file you're using so your Stage driver provides a wifi interface, and then you should be able to subscribe to the wifi interface using a utility like playerprint or via a program using the Player client libraries. You should be able to see the wifi data coming across as all zeros, but it's enough to verify things are working. From there, you'll have to do as Tyler said and fill the appropriate fields of player_wifi_data_t[1] with Stage's simulated wifi information. Rich [1] http://playerstage.sourceforge.net/doc/Player-svn/player/structplayer__wifi_ _data.html |