Re: Indexing an interface, a possible bug ?
Tarek Taha <[email protected]>
| Newsgroups | gmane.science.robotics.playerstage |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Jun 30, 2010 at 12:03 AM, < [email protected]> wrote: > Send Playerstage-developers mailing list submissions to > [email protected] > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/playerstage-developers > or, via email, send a message with subject or body 'help' to > [email protected] > > You can reach the person managing the list at > [email protected] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Playerstage-developers digest..." > > > Today's Topics: > > 1. Re: How to make a Player driver (anterma) > 2. Indexing an interface, a possible bug ? (Tarek Taha) > 3. Re: How to make a Player driver (Rich Mattes) > 4. Re: Indexing an interface, a possible bug ? (Rich Mattes) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 29 Jun 2010 03:22:57 -0700 (PDT) > From: anterma <[email protected]> > Subject: Re: [Playerstage-developers] How to make a Player driver > To: [email protected] > Message-ID: <[email protected]> > Content-Type: text/plain; charset=us-ascii > > > Ok, thanks > I have problems writting my own CMakeLists.txt. Could you show me another > example of a plugin driver? Could you show me another example of a > CMakeLists.txt of a plugin driver? > > Thanks > > > > Geoffrey Biggs-3 wrote: > > > > No, I'm afraid that's very wrong. > > > > If you are making a plugin driver, do not place it in the Player source > > tree. It should also not be a part of the Player build system. You > > compile your driver completely separately. > > > > Look at the installed example plugin driver. See how it includes a > > CMakeList.txt file. You are able to compile just that driver all on its > > own. Copy that file for your own driver and modify it to suit. > > > > Geoff > > > > On 29/06/10 17:24, anterma wrote: > >> > >> Thanks. > >> > >> I've changed my CMakeLists.txt > >> (player-3.0.1/server/drivers/mixed/mydriver/CMakeLists.txt) and use > #SET > >> (CMAKE_MODULE_PATHN "/usr/local/share/cmake/Modules"), but I have the > >> same > >> error again. > >> Now I've added 'ADD_SUBDIRECTORY (mydriver)' in > >> player-3.0.1/server/drivers/mixed/CMakeLists.txt and > >> player-3.0.1/server/drivers/mixed/mydriver/CMakeLists.txt is: > >> PLAYERDRIVER_OPTION(mbase build_mbase ON) > >> PLAYERDRIVER_ADD_DRIVER (mbase build_mbase CFLAGS "-DUSE_METEOR" SOURCES > >> mbase.cc motorpacket.cc packet.cc robot_params.cc) > >> Now I can compile player, do you think this is right? > >> > >> Thanks > >> > >> > >> > >> > >> Rich Mattes-2 wrote: > >>> > >>> Oh dear, what a bad copy/paste oversight. I've corrected the article > >>> and > >>> made a note of how to find the correct module path. > >>> > >>> Rich > >>> > >>> -----Original Message----- > >>> From: Geoff Biggs [mailto:[email protected]] > >>> Sent: Monday, June 28, 2010 7:57 AM > >>> To: [email protected] > >>> Subject: Re: [Playerstage-developers] How to make a Player driver > >>> > >>> When you copy a sample CMakeLists.txt, use the ones that are installed > >>> into $prefix/share/. The ones in the Player source are written in such > a > >>> way that they get customised for your system when you install Player. > >>> You can't use them directly. > >>> > >>> Geoff > >>> > >>> On 28/06/10 20:02, anterma wrote: > >>>> > >>>> Hi, > >>>> I'm using > >>>> http://psurobotics.org/wiki/index.php?title=Writing_a_Player_Plugin > >>> should, > >>>> but I have problems writing my CMakeLists.txt. This is my > >>>> CMakeLists.txt > >>>> file: > >>>> > >>>> CMAKE_MINIMUM_REQUIRED (VERSION 2.4 FATAL_ERROR) > >>>> PROJECT (MYDRIVER_PLAYER_DRIVER) > >>>> #Include ths Cmake module to get most of the settings need to build > >>>> SET (CMAKE_MODULE_PATHN "@CMAKE_INSTALL_PREFIX@share/cmake/Modules") > >>>> INCLUDE (UsePlayerPlugin) > >>>> PLAYER_ADD_PLUGIN_DRIVER (mydriver SOURCES mydriver.cc motorpacket.cc > >>>> packet.cc robot_params.cc) > >>>> > >>>> Then I use "cmake ." and this is the result: > >>>> CMake Error at CMakeLists.txt:6 (INCLUDE): > >>>> include could not find load file: > >>>> > >>>> UsePlayerPlugin > >>>> > >>>> > >>>> CMake Error at CMakeLists.txt:8 (PLAYER_ADD_PLUGIN_DRIVER): > >>>> Unknown CMake command "PLAYER_ADD_PLUGIN_DRIVER". > >>>> > >>>> > >>>> -- Configuring incomplete, errors occurred! > >>>> > >>>> What am I doing wrong? Somebody can help me? > >>>> > >>>> Thanks > >>>> > >>>> > >>>> > >>>> > >>>> Rich Mattes-2 wrote: > >>>>> > >>>>> http://psurobotics.org/wiki/index.php?title=Writing_a_Player_Plugin > >>> should > >>>>> help. You can also look at > >>>>> http://playerstage.sourceforge.net/wiki/Tutorials and see if any of > >>>>> the > >>>>> other tutorials help you out. > >>>>> > >>>>> Rich > >>>>> > >>>>> -----Original Message----- > >>>>> From: anterma [mailto:[email protected]] > >>>>> Sent: Thursday, June 10, 2010 6:48 AM > >>>>> To: [email protected] > >>>>> Subject: [Playerstage-developers] How to make a Player driver > >>>>> > >>>>> > >>>>> I'm looking for a manual about how to write a Player driver, but is > >>>>> empty > >>>>> > >>> > http://playerstage.sourceforge.net/doc/Player-2.1.0/player/group__tutorial__ > >>>>> plugins.html > >>>>> Somebody can help me? > >>>>> Thanks > >>>>> -- > >>>>> View this message in context: > >>>>> > >>> > http://old.nabble.com/How-to-make-a-Player-driver-tp28841441p28841441.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 > >>>>> > >>>>> > >>>>> > >>> > ---------------------------------------------------------------------------- > >>> -- > >>>>> 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 > >>>>> > >>>>> > >>>> > >>> > >>> > ---------------------------------------------------------------------------- > >>> -- > >>> This SF.net email is sponsored by Sprint > >>> What will you do first with EVO, the first 4G phone? > >>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > >>> _______________________________________________ > >>> Playerstage-developers mailing list > >>> [email protected] > >>> https://lists.sourceforge.net/lists/listinfo/playerstage-developers > >>> > >>> > >>> > ------------------------------------------------------------------------------ > >>> This SF.net email is sponsored by Sprint > >>> What will you do first with EVO, the first 4G phone? > >>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > >>> _______________________________________________ > >>> Playerstage-developers mailing list > >>> [email protected] > >>> https://lists.sourceforge.net/lists/listinfo/playerstage-developers > >>> > >>> > >> > > > > > ------------------------------------------------------------------------------ > > This SF.net email is sponsored by Sprint > > What will you do first with EVO, the first 4G phone? > > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > > _______________________________________________ > > Playerstage-developers mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/playerstage-developers > > > > > > -- > View this message in context: > http://old.nabble.com/How-to-make-a-Player-driver-tp28841441p29022163.html > Sent from the playerstage-developers mailing list archive at Nabble.com. > > > > > ------------------------------ > > Message: 2 > Date: Tue, 29 Jun 2010 20:51:35 +1000 > From: Tarek Taha <[email protected]> > Subject: [Playerstage-developers] Indexing an interface, a possible > bug ? > To: [email protected] > Message-ID: > <[email protected]> > Content-Type: text/plain; charset="iso-8859-1" > > Hi all, > > I am trying to fix a bug in the MRICP driver. This driver allows the usage > of multiple lasers, previously using the "ReadDeviceAddr" I was able to > index the interface directly using "ReadDeviceId" which is now depreciated. > Some of the users highlighted that recently the multi laser support doesn't > work as it uses the same interface multiple times. In my driver I loop > "number of laser" times to load any laser interface using this : > cf->ReadDeviceAddr(&this->laser_addr[i], section, "requires", > PLAYER_LASER_CODE,-1, NULL). This however seems to load the same interface > "the first listed in the tuple" multiple times (verified by printing the > actual address and geom properties). I tried to use the previous method by > indexing the interface directly using : > cf->ReadDeviceAddr(&this->laser_addr[i], section, "requires", > PLAYER_LASER_CODE,i, NULL) but the file configuration parser fails to load > correctly. > > I then tried to trace the problem by debugging the configfile.cpp. This > section : > // Match the tuple index (< 0 matches all indices) > if (index >= 0 && i != index) > continue; > > didn't make much of a senses, the if statement I think should be if (index > >= 0 && ind != index), but changing that breaks a lot of interface loading > in other drivers. I am puzzled at the moment, anyone can point me to a > solution that doesn't require major hacking of the player core ? Or is it a > bug in loading an interface by index perhaps ? > > Regards, > Tarek > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > Message: 3 > Date: Tue, 29 Jun 2010 08:02:20 -0400 > From: Rich Mattes <[email protected]> > Subject: Re: [Playerstage-developers] How to make a Player driver > To: [email protected] > Message-ID: <[email protected]> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > > > If you're setting "CMAKE_MODULE_PATHN" then of course you're having > problems. > There's an extra N on the end. Also, the # sign before SET will comment > the > line out and force it not to be evaluated. Verify that there's a file > called > UsePlayerPlugin.cmake at /usr/local/share/cmake/Modules, then put your > sources > in their own directory outside of the Player tree with this CMakeLists.txt: > > CMAKE_MINIMUM_REQUIRED (VERSION 2.4 FATAL_ERROR) > PROJECT(mbase) > SET(CMAKE_MODULE_PATH "/usr/local/share/cmake/Modules") > INCLUDE(UsePlayerPlugin) > PLAYER_ADD_PLUGIN_DRIVER (mbase SOURCES mbase.cc motorpacket.cc packet.cc > robot_params.cc) > > Then create a "build" directory within in your source directory, change > into it, and run > "cmake .." like you would if you were building Player normally. > > Rich > > > > On 6/29/2010 6:22 AM, anterma wrote: > > Ok, thanks > > I have problems writting my own CMakeLists.txt. Could you show me another > > example of a plugin driver? Could you show me another example of a > > CMakeLists.txt of a plugin driver? > > > > Thanks > > > > > > > > Geoffrey Biggs-3 wrote: > >> No, I'm afraid that's very wrong. > >> > >> If you are making a plugin driver, do not place it in the Player source > >> tree. It should also not be a part of the Player build system. You > >> compile your driver completely separately. > >> > >> Look at the installed example plugin driver. See how it includes a > >> CMakeList.txt file. You are able to compile just that driver all on its > >> own. Copy that file for your own driver and modify it to suit. > >> > >> Geoff > >> > >> On 29/06/10 17:24, anterma wrote: > >>> Thanks. > >>> > >>> I've changed my CMakeLists.txt > >>> (player-3.0.1/server/drivers/mixed/mydriver/CMakeLists.txt) and use > #SET > >>> (CMAKE_MODULE_PATHN "/usr/local/share/cmake/Modules"), but I have the > >>> same > >>> error again. > >>> Now I've added 'ADD_SUBDIRECTORY (mydriver)' in > >>> player-3.0.1/server/drivers/mixed/CMakeLists.txt and > >>> player-3.0.1/server/drivers/mixed/mydriver/CMakeLists.txt is: > >>> PLAYERDRIVER_OPTION(mbase build_mbase ON) > >>> PLAYERDRIVER_ADD_DRIVER (mbase build_mbase CFLAGS "-DUSE_METEOR" > SOURCES > >>> mbase.cc motorpacket.cc packet.cc robot_params.cc) > >>> Now I can compile player, do you think this is right? > >>> > >>> Thanks > >>> > >>> > >>> > >>> > >>> Rich Mattes-2 wrote: > >>>> Oh dear, what a bad copy/paste oversight. I've corrected the article > >>>> and > >>>> made a note of how to find the correct module path. > >>>> > >>>> Rich > >>>> > >>>> -----Original Message----- > >>>> From: Geoff Biggs [mailto:[email protected]] > >>>> Sent: Monday, June 28, 2010 7:57 AM > >>>> To: [email protected] > >>>> Subject: Re: [Playerstage-developers] How to make a Player driver > >>>> > >>>> When you copy a sample CMakeLists.txt, use the ones that are installed > >>>> into $prefix/share/. The ones in the Player source are written in such > a > >>>> way that they get customised for your system when you install Player. > >>>> You can't use them directly. > >>>> > >>>> Geoff > >>>> > >>>> On 28/06/10 20:02, anterma wrote: > >>>>> Hi, > >>>>> I'm using > >>>>> http://psurobotics.org/wiki/index.php?title=Writing_a_Player_Plugin > >>>> should, > >>>>> but I have problems writing my CMakeLists.txt. This is my > >>>>> CMakeLists.txt > >>>>> file: > >>>>> > >>>>> CMAKE_MINIMUM_REQUIRED (VERSION 2.4 FATAL_ERROR) > >>>>> PROJECT (MYDRIVER_PLAYER_DRIVER) > >>>>> #Include ths Cmake module to get most of the settings need to build > >>>>> SET (CMAKE_MODULE_PATHN "@CMAKE_INSTALL_PREFIX@share/cmake/Modules") > >>>>> INCLUDE (UsePlayerPlugin) > >>>>> PLAYER_ADD_PLUGIN_DRIVER (mydriver SOURCES mydriver.cc motorpacket.cc > >>>>> packet.cc robot_params.cc) > >>>>> > >>>>> Then I use "cmake ." and this is the result: > >>>>> CMake Error at CMakeLists.txt:6 (INCLUDE): > >>>>> include could not find load file: > >>>>> > >>>>> UsePlayerPlugin > >>>>> > >>>>> > >>>>> CMake Error at CMakeLists.txt:8 (PLAYER_ADD_PLUGIN_DRIVER): > >>>>> Unknown CMake command "PLAYER_ADD_PLUGIN_DRIVER". > >>>>> > >>>>> > >>>>> -- Configuring incomplete, errors occurred! > >>>>> > >>>>> What am I doing wrong? Somebody can help me? > >>>>> > >>>>> Thanks > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> Rich Mattes-2 wrote: > >>>>>> http://psurobotics.org/wiki/index.php?title=Writing_a_Player_Plugin > >>>> should > >>>>>> help. You can also look at > >>>>>> http://playerstage.sourceforge.net/wiki/Tutorials and see if any of > >>>>>> the > >>>>>> other tutorials help you out. > >>>>>> > >>>>>> Rich > >>>>>> > >>>>>> -----Original Message----- > >>>>>> From: anterma [mailto:[email protected]] > >>>>>> Sent: Thursday, June 10, 2010 6:48 AM > >>>>>> To: [email protected] > >>>>>> Subject: [Playerstage-developers] How to make a Player driver > >>>>>> > >>>>>> > >>>>>> I'm looking for a manual about how to write a Player driver, but is > >>>>>> empty > >>>>>> > >>>> > http://playerstage.sourceforge.net/doc/Player-2.1.0/player/group__tutorial__ > >>>>>> plugins.html > >>>>>> Somebody can help me? > >>>>>> Thanks > >>>>>> -- > >>>>>> View this message in context: > >>>>>> > >>>> > http://old.nabble.com/How-to-make-a-Player-driver-tp28841441p28841441.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 > >>>>>> > >>>>>> > >>>>>> > >>>> > ---------------------------------------------------------------------------- > >>>> -- > >>>>>> 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 > >>>>>> > >>>>>> > >>>> > ---------------------------------------------------------------------------- > >>>> -- > >>>> This SF.net email is sponsored by Sprint > >>>> What will you do first with EVO, the first 4G phone? > >>>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > >>>> _______________________________________________ > >>>> Playerstage-developers mailing list > >>>> [email protected] > >>>> https://lists.sourceforge.net/lists/listinfo/playerstage-developers > >>>> > >>>> > >>>> > ------------------------------------------------------------------------------ > >>>> This SF.net email is sponsored by Sprint > >>>> What will you do first with EVO, the first 4G phone? > >>>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > >>>> _______________________________________________ > >>>> Playerstage-developers mailing list > >>>> [email protected] > >>>> https://lists.sourceforge.net/lists/listinfo/playerstage-developers > >>>> > >>>> > >> > ------------------------------------------------------------------------------ > >> This SF.net email is sponsored by Sprint > >> What will you do first with EVO, the first 4G phone? > >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > >> _______________________________________________ > >> Playerstage-developers mailing list > >> [email protected] > >> https://lists.sourceforge.net/lists/listinfo/playerstage-developers > >> > >> > > > > > ------------------------------ > > Message: 4 > Date: Tue, 29 Jun 2010 09:39:11 -0400 > From: "Rich Mattes" <[email protected]> > Subject: Re: [Playerstage-developers] Indexing an interface, a > possible bug ? > To: <[email protected]> > Message-ID: <000901cb1790$76170260$62450720$@com> > Content-Type: text/plain; charset="us-ascii" > > You could try using keys: I.e. have a Requires line in the config file > like > > > > requires ["laser0:::laser:0" "laser1:::laser:5"] > > > > and then when you read the device addr you do something like: > > > > for (int i<0; i<NumLasers; i++) > > { > char device_key[16]; > > sprintf(device_key, "laser%d",i); > > cf->ReadDeviceAddr(&this->laser_addr[i], section, "requires", > PLAYER_LASER_CODE,-1, device_key) > > // the rest of the device reading stuff > > } > > > > I took this approach when I wrote a driver that merges the laser readings > from two separate lasers into one laser device. I had the same issue in > trying to subscribe to two separate lasers, this is the method that worked > the best for me. > > > > In order to maintain compatibility for people that have been using mricp > for > a while with one laser, it might also be good to check for a laser without > a > key if numLasers == 1, so people don't have to add the laser0::: key to > their config files. > > > > Rich > > Thanks Rich. I knew that I can use the key for filtering, but I really wanted the indexing to work as it's the logical solution for this problem, and if there is a bug in player core regarding indexing an interface then perhaps it should be fixed. For now it seems my only solution will using the keys as you suggested. Thanks for your reply. Regards, Tarek > > > From: Tarek Taha [mailto:[email protected]] > Sent: Tuesday, June 29, 2010 6:52 AM > To: [email protected] > Subject: [Playerstage-developers] Indexing an interface, a possible bug ? > > > > Hi all, > > I am trying to fix a bug in the MRICP driver. This driver allows the usage > of multiple lasers, previously using the "ReadDeviceAddr" I was able to > index the interface directly using "ReadDeviceId" which is now depreciated. > Some of the users highlighted that recently the multi laser support doesn't > work as it uses the same interface multiple times. In my driver I loop > "number of laser" times to load any laser interface using this : > cf->ReadDeviceAddr(&this->laser_addr[i], section, "requires", > PLAYER_LASER_CODE,-1, NULL). This however seems to load the same interface > "the first listed in the tuple" multiple times (verified by printing the > actual address and geom properties). I tried to use the previous method by > indexing the interface directly using : > cf->ReadDeviceAddr(&this->laser_addr[i], section, "requires", > PLAYER_LASER_CODE,i, NULL) but the file configuration parser fails to load > correctly. > > I then tried to trace the problem by debugging the configfile.cpp. This > section : > // Match the tuple index (< 0 matches all indices) > if (index >= 0 && i != index) > continue; > > didn't make much of a senses, the if statement I think should be if (index > >= 0 && ind != index), but changing that breaks a lot of interface loading > in other drivers. I am puzzled at the moment, anyone can point me to a > solution that doesn't require major hacking of the player core ? Or is it a > bug in loading an interface by index perhaps ? > > Regards, > Tarek > > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > > ------------------------------ > > _______________________________________________ > Playerstage-developers mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/playerstage-developers > > > End of Playerstage-developers Digest, Vol 49, Issue 14 > ****************************************************** > ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Playerstage-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/playerstage-developers