<< return to Pixycam.com

pixy_rcs_get_position

Hi Guys, I am trying to get the servo position from the PIXY in python. I would let pixy to track the object. The pan_tilt example works, but it sets the rc position, while I would like to use the function pixy_rcs_get_position (that is defined in the API). How do I include that function?

Thanks

I reply myself: just modify the pixi.i file in order to include the wanted function during the compilation phase. In my case, I went into pixy/src/host and in the libpixiusb_swig folder I found the pixi.i file. I added the function declaration as

int pixy_rcs_get_position(uint8_t channel);

and then i use the .sh file to compile. Now I can refer to the function.

BUT… is taking 60 ms to read each channel (120 ms for both)… how could it be possible? Am I missing something?

Hi Tiziano,
60 ms sounds high. It should take around 20ms. When doing image processing, Pixy isn’t servicing these kinds of requests with much priority. You might try stopping the processing by issuing a “stop” command. You can resume processing by issuing a “run” command. The response time should improve.

Hope this helps!

Edward

Thanks, where I can find the stop and run command protocol? There is nothing in pixy.h (http://charmedlabs.github.io/pixy/pixy_8h.html)