#327 Camera image broken in Python

Brian Gerkey
player (137)

After revision 4232 the binding for camera image dont work anymore in client_libs/libplayerc/bindings/python/playerc.i

At line 373 in playerc.i

%typemap(out) uint8_t [ANY]
$result = PyBuffer_FromMemory((void*)$1,sizeof(uint8_t)*$1_dim0);

As i understad it $1_dim0 takes the size of the array but camera image is no longer an array as of rev 4232 its a pointer to memory so sizeof(uint8_t)*$1_dim0 will be zero.

What can we do to get camera.image to work in python?


  • Anonymous

    It was i, Torbjorn Svangard, who wrote this bug report... i forgot to login :)
    You can reach me at 'tosv8225 {at] student.uu.se'

  • Rich Mattes
    Rich Mattes

    SVN revision 9010 contians a fix for this problem. uint8_t * arrays are now treated the same way as double* float* and int* arrays. This allows camera image data to be indexed much the same way laser.ranges are, for example. Please file a new bug if you experience any problems.

  • Rich Mattes
    Rich Mattes

    • status: open --> closed-fixed
  • Hi all! At some point we had some problems with our notification for bug reports like this, and I don't have any memory of ever having seen this problem report before. Sorry if it seemed to be ignored, and I'm glad that it's solved now!

  • Whoa; sf.net let me post the last bit without logging in, which I've now done. I'm surprised that the forums aren't all full of spam if they let just anyone post like that!