Page 1 of 1
C++ experiences with the Pixy Cam?
Posted: Sat Apr 02, 2016 7:57 pm
by davenull
hey,
is anyone experienced in programming the Pixy Cam with gpp C/C++ (possibly in Geany IDE)?
which interface ist most easy to use?
SPI, UART, or I2C? (the standard 6-pin header cable just supports SPI, at least for Arduinos, IIRC)
Re: C++ experiences with the Pixy Cam?
Posted: Tue Apr 05, 2016 1:49 pm
by davenull
no one who used the Pixy Cam by Raspi C compilers so far?
Re: C++ experiences with the Pixy Cam?
Posted: Tue Apr 05, 2016 2:28 pm
by topguy
Probably very few have experience with this hardware in general.
Looking at their open-source code, (
https://github.com/charmedlabs/pixy/tre ... r/src/host) I can see that their example software PixyMon usex C++ and QT4 so I would start there.
Re: C++ experiences with the Pixy Cam?
Posted: Tue Apr 05, 2016 2:56 pm
by davenull
PixyMon is just used for teaching and programming the targeting colors e.g., from a Windows PC, but the Pixy onboard-processor itself then generates the blob data of detected blobs, sorted by color, size, and position.
I once used one of the first Pixy versions on an Arduino Due, but the libs were not ARM (Due-) compatible, neither for UART nor for SPI, so I abandoned my attempts. Myriads of blob data missing and/or dozens of cks errors (check sum), one after the other. I returned the cam to the supplier.
Meanwhile there are newer versions of hardware, firmware, and software, so perhaps some issues have been fixed, for one or the other of the protocols. That's why I was asking about general experience with C and especially about which interface to prefer for the Raspi.
Re: C++ experiences with the Pixy Cam?
Posted: Tue Apr 05, 2016 3:33 pm
by topguy
The linux build of PixyMon depends on libusb and USB sound like the most convenient interface to me.
Re: C++ experiences with the Pixy Cam?
Posted: Tue Apr 05, 2016 3:46 pm
by davenull
I saw that a Raspi build uses USB, but I don't see a C lib for that.
A theoretical discussion wouldn't help either, as the issues just appear when you use it, just as it once happened for my Arduino Due.
So if anyone used USB for the Pixy with a C lib (which?) - - - : personal experiences and approved source codes highly appreciated!
Re: C++ experiences with the Pixy Cam?
Posted: Tue Apr 05, 2016 3:51 pm
by topguy
davenull wrote:I saw that a Raspi build uses USB, but I don't see a C lib for that.
https://github.com/charmedlabs/pixy/blo ... ude/pixy.h
Re: C++ experiences with the Pixy Cam?
Posted: Tue Apr 05, 2016 3:55 pm
by davenull
no, I need application examples, and personal experiences with it , no link to the source code of a lib.
Re: C++ experiences with the Pixy Cam?
Posted: Tue Apr 05, 2016 3:57 pm
by davenull
something like this, but for Raspi, not Arduino:
Code: Select all
/*
06.04.2014 v0.1.3 John Leimon
+ Now using pixy.init() to initialize Pixy in setup().
*/
#include <SPI.h>
#include <Pixy.h>
Pixy pixy;
void setup()
{
Serial.begin(9600);
Serial.print("Starting...\n");
pixy.init();
}
void loop()
{
static int i = 0;
int j;
uint16_t blocks;
char buf[32];
blocks = pixy.getBlocks();
if (blocks)
{
i++;
if (i%50==0)
{
sprintf(buf, "Detected %d:\n", blocks);
Serial.print(buf);
for (j=0; j<blocks; j++)
{
sprintf(buf, " block %d: ", j);
Serial.print(buf);
pixy.blocks[j].print();
}
}
}
}
and different ones,
by personal experiences (not on the paper!)!
How do they work and perform?
Issues?
Hints?
Re: C++ experiences with the Pixy Cam?
Posted: Tue Apr 05, 2016 4:55 pm
by topguy
Re: C++ experiences with the Pixy Cam?
Posted: Tue Apr 05, 2016 5:13 pm
by davenull
yes, for example.
Many programs look fine at first sight, but actually don't (or didn't) work in practice, or partially (i.e., on Arduino) just by i2c, not by SPI, not by UART.
Or some of the provided original source codes had to be sort of reworked, partially e.g. by additionally patching the Arduino SPI libs.
There once were many issues which have been reported.
This is what my question was about, but now about experiences with the Pi.
Re: C++ experiences with the Pixy Cam?
Posted: Tue Apr 05, 2016 5:59 pm
by jamesh
I suspect the deafening lack of answers means that few if anyone has done this. Google might find something.
Re: C++ experiences with the Pixy Cam?
Posted: Tue Apr 05, 2016 6:52 pm
by davenull
I also suspected that.
I did already google - no such experience reports found, but that doesn't mean anything:
if no issues had occured, and if everything worked, why should one post?
But a pity if there are no experiences, could be a good and convenient Raspi addon, in case it worked.
Re: C++ experiences with the Pixy Cam?
Posted: Tue Apr 05, 2016 7:14 pm
by 6by9
Re: C++ experiences with the Pixy Cam?
Posted: Tue Apr 05, 2016 7:36 pm
by davenull
Of course I found the Python instruction link, but no references to C sources.
http://cmucam.org/projects/cmucam5/wiki ... e_on_Linux
also this one is just about Python:
http://cmucam.org/projects/cmucam5/wiki ... spberry_Pi
I basically was looking for i2c, UART, or SPI, not USB, just like for Arduino, but also for USB: no experience report with source code found.
So have you found experience reports about C and USB?
To which source codes in detail?
To my experience it's about C not compellingly the same as to Python, and I don't understand Python code at all.
at your last link I also can't find C code for SPI:
http://notes.pitfall.org/pixy-for-raspberry-pi.html
Re: C++ experiences with the Pixy Cam?
Posted: Tue Apr 05, 2016 9:10 pm
by 6by9
From
http://notes.pitfall.org/pixy-for-raspberry-pi.html he links to
https://github.com/omwah/pixy_rpi
The README includes the wiring for SPI on the Pi. It looks like it's fairly crude in the SPI interfacing based on
https://github.com/omwah/pixy_rpi/blob/master/Pixy.h, but it's there.
Same repo referenced from
http://www.cmucam.org/boards/9/topics/3529?r=6097
And as a random piece of code,
http://pastebin.com/ddEHZWV5 is using Pixy and WiringPi, though I can't find any projects referencing it.
Otherwise I suggest you go and ask on the PixyCam forums - you're more likely to find users there.
Re: C++ experiences with the Pixy Cam?
Posted: Wed Apr 06, 2016 7:38 am
by davenull
no libs and no C++ guides available from Pixy via the Pixy forum.
Only moronic and evasive answers.
That is really rediculous and emberrassing for that company.
Especially this Wiring Pi approach
https://github.com/omwah/pixy_rpi
sounds very promising, I like the syntax because I'm used to Wiring/Sketch for Arduino and it's very handsome.
Thank you for your hints!
Re: C++ experiences with the Pixy Cam?
Posted: Fri Apr 22, 2016 9:27 am
by davenull
is anyone around here who is already successfully using the Pixy Cam by C/C++ when plugged to USB ?