trouble fixing ARToolKit

right now ARToolKit is broken under all non-windows os-es. unfortunately.

trying to use it causes a grutil error

:grutil(error): The copy of ARToolKit that you are using is not compiled for BGRA input.  Panda3D cannot use this copy of ARToolKit. Modify the ARToolKit's config file and compile it again.

so i tried to compile artoolkit to use the bgra color.
i tried to alter the config.h of the artoolkit source and build it. no errors during build , it created the correct .so file.so i compiled panda afterwards with the new ar and with the new/old config.h. tried various cobinations. panda builds fine but the error still shows up.

pro-rsoft already gave me good tips but now i’m stuck.
someone knows how to fix this?

thx in advance,
thomas

What did you change in the config.h then? You did alter it between the ./configure step and the make step, right?

Oh, I believe Panda links to libAR.a which is a static library, so creating a .so won’t work. It surprises me that it did compile, you must have some other version still around.

now that you mention it… it output an .a file . stupid me messed up the names in my brain.

first i did ./configure which let me choose between various input-sources. then i altered the config.h to use the BGRA format for the choice i made.
i also tried to replace all formats with bgra which didnt work either.
then i compiled it, copied the .a file over into pandas thirdparty folder replacing the old one. then recompiled panda.
also tried to change the config.h in the panda folders to match the changes i made in the artoolkit source config.h. same result

You actually just need to change one thing in config.h. What did you change?

Don’t forget to clear the config.h files and libAR.a out of the built/lib, built/tmp and built/include directories! Makepanda doesn’t do that automatically.

i changed the config.h from

#ifdef __linux
#define  AR_INPUT_V4L
#undef  AR_INPUT_DV
#undef  AR_INPUT_1394CAM
#undef  AR_INPUT_GSTREAMER

#  ifdef AR_INPUT_V4L
#    ifdef USE_EYETOY
#      define AR_DEFAULT_PIXEL_FORMAT AR_PIXEL_FORMAT_RGB
#    else
#      define AR_DEFAULT_PIXEL_FORMAT AR_PIXEL_FORMAT_BGR
#    endif
#  endif

#  ifdef AR_INPUT_DV
#    define  AR_DEFAULT_PIXEL_FORMAT AR_PIXEL_FORMAT_RGB
#  endif

#  ifdef AR_INPUT_1394CAM
#    define  AR_DEFAULT_PIXEL_FORMAT AR_PIXEL_FORMAT_RGB
#  endif

#  ifdef AR_INPUT_GSTREAMER
#    define  AR_DEFAULT_PIXEL_FORMAT AR_PIXEL_FORMAT_RGB
#  endif

#  undef   AR_BIG_ENDIAN
#  define  AR_LITTLE_ENDIAN
#endif

to

#ifdef __linux
#define  AR_INPUT_V4L
#undef  AR_INPUT_DV
#undef  AR_INPUT_1394CAM
#undef  AR_INPUT_GSTREAMER

#  ifdef AR_INPUT_V4L
#    ifdef USE_EYETOY
#      define AR_DEFAULT_PIXEL_FORMAT AR_PIXEL_FORMAT_BGRA
#    else
#      define AR_DEFAULT_PIXEL_FORMAT AR_PIXEL_FORMAT_BGRA
#    endif
#  endif

#  ifdef AR_INPUT_DV
#    define  AR_DEFAULT_PIXEL_FORMAT AR_PIXEL_FORMAT_RGB
#  endif

#  ifdef AR_INPUT_1394CAM
#    define  AR_DEFAULT_PIXEL_FORMAT AR_PIXEL_FORMAT_RGB
#  endif

#  ifdef AR_INPUT_GSTREAMER
#    define  AR_DEFAULT_PIXEL_FORMAT AR_PIXEL_FORMAT_RGB
#  endif

#  undef   AR_BIG_ENDIAN
#  define  AR_LITTLE_ENDIAN
#endif

during configure i selected V4L as input. thought it would be enough but it seems like i missed something

Why not change it to this, to be certain? :slight_smile:

#ifdef __linux
#define  AR_INPUT_V4L
#undef  AR_INPUT_DV
#undef  AR_INPUT_1394CAM
#undef  AR_INPUT_GSTREAMER

#define AR_DEFAULT_PIXEL_FORMAT AR_PIXEL_FORMAT_BGRA

#  undef   AR_BIG_ENDIAN
#  define  AR_LITTLE_ENDIAN
#endif 

Just make sure you dont have anything conflicting around. It might be an idea to entirely remove the “built” directory to be certain, make sure you dont have any other copies of ARToolKit, the thirdparty packages or Panda3D somewhere.

man great that worked!

while(1):
    print "thank you"

now i can continue to write on the artoolkit sample:)

i really wonder why it didnt work when i changed ALL the single entries to BGRA… well who cares :smiley: