Is the pixy.h editable

Added by julien pirot about 1 month ago

For my project i am using the pixy cam, and i wanted to change a few things in the pixy.h (/home/pi/pixy/src/host/libpixyusb/include ) but none of my changes are taken into account. On the other hand i have made changes on the hello_pixy.cpp and that working fine, there for i wanted to know if it is possible to do the same with pixy.h? what i want to do is where it writes the signature,the x,the y,the width and the lengh, i want it to right it only for a certain position(x and y) of the object.

thank you for your time


Replies (9)

RE: Is the pixy.h editable - Added by Edward Getz about 1 month ago

Hello Julien,
You can edit pixy.h :) You can find it in your Documents/Arduino/libraries/Pixy directory.

Hope this helps!

Edward

RE: Is the pixy.h editable - Added by julien pirot about 1 month ago

i am using a raspberry pi,so i guess it different?

RE: Is the pixy.h editable - Added by Edward Getz 27 days ago

Hi Julien,
That's correct, the Raspberry PI works best with USB communications and libpixyusb. Here is some more information:

http://cmucam.org/projects/cmucam5/wiki/Building_the_libpixyusb_example_on_Linux
http://charmedlabs.github.io/pixy/pixy_8h.html

Hope this helps!

Edward

RE: Is the pixy.h editable - Added by julien pirot 27 days ago

Hello, thanks for your time.

Sorry for so many questions, but our project is due soon.

We are using a Rasperri Pi connected to the pixy cam via USB.
When compiling the file (make) after the changes were made to pixy.h, such as deleting the void print function (just to test), there was no change or error when printing the information of the signature caught by the pixy. It still printed those values even after deleting the print function in pixy.h

We are wanting to change the format in which the information for the pixy is printed (we thought editing pixy.h would solve the problem)
Any changes made to hello_pixy.cpp are successful, but when editing pixy.h (src/host/libpixyusb/include) there seems to be no effect even after compiling.

RE: Is the pixy.h editable - Added by Edward Getz 25 days ago

Hello Julien,
I'm not sure how you want the printed information to change, but I believe you probably want to edit hello_pixy.cpp, particularly where it calls printf. What are you trying to change in pixy.h?

Edward

RE: Is the pixy.h editable - Added by Edward Getz 25 days ago

Hello Julien,
I'm not sure how you want the printed information to change, but I believe you probably want to edit hello_pixy.cpp, particularly where it calls printf. What are you trying to change in pixy.h?

Edward

RE: Is the pixy.h editable - Added by julien pirot 20 days ago

here is what i want to change from pixy.h:
struct Block {
void print(char *buf) {
int i, j;
char sig6, d;
bool flag;
if (type==PIXY_BLOCKTYPE_COLOR_CODE) {
// convert signature number to an octal string
for (i=12, j=0, flag=false; i>=0; i-=3) {
d = (signature>>i)&0x07;
if (d>0 && !flag)
flag = true;
if (flag)
sig[j++] = d + '0';
}
sig[j] = '\0';
sprintf(buf, "CC block! sig: %s (%d decimal) x: %d y: %d width: %d height: %d angle %d", sig, signature, x, y, width, height, angle);
}
else // regular block. Note, angle is always zero, so no need to print
sprintf(buf, "sig: %d x: %d y: %d width: %d height: %d", signature, x, y, width, height);
}

to this function i want to add something but too complicated to send it so let just say for X reason i just want the "x" and the"y" of the block.
What i will do is simply in the the pixy.h ,i will change : sprintf(buf, "sig: %d x: %d y: %d width: %d height: %d", signature, x, y, width, height);
to sprintf(buf, "sig: %d x: %d y: %d);
I know it stupid, but it just an example,and doing that doesn't change a thing. When i compile (make) and launch hello_pixy it will still write the "x", "y","width","height"... which i don't want.

An other way to solve my problem that will allow me not to touch the pixy.h but only pixy.cpp which works perfectly is: is there a function in pixy.h that i can call in pixy.cpp that returns the "x" and the "y" of the block.

RE: Is the pixy.h editable - Added by Edward Getz 20 days ago

Hello Julien,
I don't have a linux machine I can use to test, but the makefile has made another copy of pixy.h and is using that instead, so when you edit the main copy and rerun "make", nothing has actually changed. If you do a file search on pixy.h, in your hello_pixy directory, you should find it.

Hope this helps!

Edward

RE: Is the pixy.h editable - Added by julien pirot 20 days ago

i'll try it when i get the chance, thank your for you time!

(1-9/9)