Error libplayercpp_py>>GetPose2D

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

Error libplayercpp_py>>GetPose2D

Stefano Franchi-2
Hi all,

I am just starting to use the python bindings for libplayercpp and I get a type error with the GetPose2D function. The c++ signature of the function is:

void GetPose2d (char *identifier, double &x, double &y, double &a)

but I am not clear how to pass those pointers in python. I tried just passing float variables, but I get:

TypeError: in method 'SimulationProxy_GetPose2d', argument 3 of type 'double &'

Is this a problem with the Swig-generated bindings? Or am I missing something on how to use the python version of libplayercpp ?


Help appreciated,

Stefano

--
__________________________________________________
Stefano Franchi

[hidden email]
http://stefano.cleinias.org

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
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: Error libplayercpp_py>>GetPose2D

Stefano Franchi-2
Well,

answering to myself for future reference:
problem solved by adding a couple of lines to:

/player-svn/trunk/client_libs/libplayerc++/bindings/python/playercpp.i

----------------
%include "cpointer.i"    // Grab the SWIG pointer library
/* Create some functions for working with "double *" */
%pointer_functions(double, doublePtr);
---------------

and used them according to SWIG instructions at:

http://www.swig.org/Doc3.0/SWIGDocumentation.html#Library_nn3



On Sun, Feb 8, 2015 at 4:51 PM, stefano franchi <[hidden email]> wrote:
Hi all,

I am just starting to use the python bindings for libplayercpp and I get a type error with the GetPose2D function. The c++ signature of the function is:

void GetPose2d (char *identifier, double &x, double &y, double &a)

but I am not clear how to pass those pointers in python. I tried just passing float variables, but I get:

TypeError: in method 'SimulationProxy_GetPose2d', argument 3 of type 'double &'

Is this a problem with the Swig-generated bindings? Or am I missing something on how to use the python version of libplayercpp ?


Help appreciated,

Stefano

--
__________________________________________________
Stefano Franchi

[hidden email]
http://stefano.cleinias.org



--
__________________________________________________
Stefano Franchi

[hidden email]
http://stefano.cleinias.org

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
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: Error libplayercpp_py>>GetPose2D

Dr. Kevin Nickels
Thanks, Stefano!  This has been bothering one of my students for quite a while.
--kn

On Sun, Feb 8, 2015 at 6:00 PM, stefano franchi <[hidden email]> wrote:
Well,

answering to myself for future reference:
problem solved by adding a couple of lines to:

/player-svn/trunk/client_libs/libplayerc++/bindings/python/playercpp.i

----------------
%include "cpointer.i"    // Grab the SWIG pointer library
/* Create some functions for working with "double *" */
%pointer_functions(double, doublePtr);
---------------

and used them according to SWIG instructions at:

http://www.swig.org/Doc3.0/SWIGDocumentation.html#Library_nn3



On Sun, Feb 8, 2015 at 4:51 PM, stefano franchi <[hidden email]> wrote:
Hi all,

I am just starting to use the python bindings for libplayercpp and I get a type error with the GetPose2D function. The c++ signature of the function is:

void GetPose2d (char *identifier, double &x, double &y, double &a)

but I am not clear how to pass those pointers in python. I tried just passing float variables, but I get:

TypeError: in method 'SimulationProxy_GetPose2d', argument 3 of type 'double &'

Is this a problem with the Swig-generated bindings? Or am I missing something on how to use the python version of libplayercpp ?


Help appreciated,

Stefano

--
__________________________________________________
Stefano Franchi

[hidden email]
http://stefano.cleinias.org



--
__________________________________________________
Stefano Franchi

[hidden email]
http://stefano.cleinias.org

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users




--
Kevin Nickels <[hidden email]>
http://www.trinity.edu/knickels 210-999-7543
Associate Professor, Engineering Science, Trinity University
Center for Sciences and Innovation (CSI), Rm 470Q, San Antonio TX 78212-7200

------------------------------------------------------------------------------

_______________________________________________
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: Error libplayercpp_py>>GetPose2D

Stefano Franchi-2


On Wed, Jun 10, 2015 at 11:42 AM, Dr. Kevin Nickels <[hidden email]> wrote:
Thanks, Stefano!  This has been bothering one of my students for quite a while.
--kn


Glad it helped!

Cheers,

S.


--
__________________________________________________
Stefano Franchi

[hidden email]
http://stefano.cleinias.org

------------------------------------------------------------------------------

_______________________________________________
Playerstage-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/playerstage-users
Loading...