Install ARToolKit 2.72.1 in Ubuntu 11.10 and 12.04

The installation process is the same as in Ubuntu 10.10 but it looks like there is a problem when executing the configure script. When running “./Configure” the gstreamer libraries are not correctly configured in the GST_LIBS variable. Here is how it is defined in the script:

GST_LIBS=`pkg-config --libs gstreamer-0.10`

You can fix this problem by manually adding the GST_LIBS variable to the definition of the LIBS variable:

LIBS="-lpthread -lglut -lGLU -lGL -lXi -lX11 -lm $GST_LIBS"

You can also add the result of executing the “pkg-config --libs gstreamer-0.10” command to that variable, both will make LIBS have this value:

LIBS="-lpthread -lglut -lGLU -lGL -lXi -lX11 -lm -pthread -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lxml2 -lgthread-2.0 -lrt -lglib-2.0"

You may also have some problems with V4L when executing make, this is caused because they changed the “linux/videodev.h” header file name to “libv4l1-videodev.h”. If you have that problem change the header file name in those files of ARToolKit:

include/AR/sys/videoLinuxV4L.h
lib/SRC/VideoLinuxV4L/video.c

You might also like

Installation scripts for ARToolKit, Collada DOM, OpenSceneGraph and osgART
I've created some scripts and patches so installation of all this libraries will be much less painful....
ARToolKit with OpenKinect using the IR camera
More than one year ago I started adding Kinect support to ARToolKit using libfreenect. I had some results...
ARSlides v1.0: Augmented Reality slide presentation application
I'm glad to inform that I've (finally) published the code for the Augmented Reality application I've...
Run a command from a Java application dealing properly with stdin, stdout and stderr
If you want to run an external command from a Java application you have to deal properly with the input,...
Leave a comment ?

23 Comments.

  1. Hi, thanky you for your tutorial. I still have the following problem:

    When running ./simpleTest, I get:

    Using config string from environment [v4l2src device=/dev/video0 use-fixed-fps=false ! ffmpegcolorspace ! capsfilter caps=video/x-raw-rgb,bpp=24 ! identity name=artoolkit ! fakesink].
    ARVideo may be configured using one or more of the following options,
    separated by a space:

    DEVICE CONTROLS:
    -dev=filepath
    specifies device file.
    -channel=N
    specifies source channel.
    -noadjust
    prevent adjusting the width/height/channel if not suitable.
    -width=N
    specifies expected width of image.
    -height=N
    specifies expected height of image.
    -palette=[RGB|YUV420P]
    specifies the camera palette (WARNING:all are not supported on each camera !!).
    IMAGE CONTROLS (WARNING: every options are not supported by all camera !!):
    -brightness=N
    specifies brightness. (0.0 1.0)
    -contrast=N
    specifies contrast. (0.0 1.0)
    -saturation=N
    specifies saturation (color). (0.0 1.0) (for color camera only)
    -hue=N
    specifies hue. (0.0 1.0) (for color camera only)
    -whiteness=N
    specifies whiteness. (0.0 1.0) (REMARK: gamma for some drivers, otherwise for greyscale camera only)
    -color=N
    specifies saturation (color). (0.0 1.0) (REMARK: obsolete !! use saturation control)

    OPTION CONTROLS:
    -mode=[PAL|NTSC|SECAM]
    specifies TV signal mode (for tv/capture card).

    What should I do?

    • Your problem is that you selected option number 1 for video input (V4L) when you configured with “./Configure” (you can find that text message you posted in the lib/SRC/VideoLinuxV4L/video.c on ar2VideoDispOption function), but you are configuring the ARTOOLKIT_CONFIG environment variable with a config string for a GStreamer video input.

      If you want to use GStreamer as input (for webcams using /dev/videoX devices as it looks like from you config string) configure again running “./Configure”, select the option for GStreamer (it should be option number 5 if you didn’t apply any patch to ARToolKit), compile and install it again.

      If you want to use V4L as video input you should change your ARTOOLKIT_CONFIG environment variable with a config string that describes a video camera as the message explains. I’ve never used V4L though.

  2. Hello,

    I am trying to get ARToolKit to work and compiled it to use the GStreamer. Then running it with no ARTOOLKIT_CONFIG variable set I get this:

    ARToolKit/bin$ ./videoTest
    No video config string supplied, using defaults.
    ioctl failed

    How do you setup the configuration? If I do something like:
    export ARTOOLKIT_CONFIG=’asdf’

    I get the same error’s as Marco above. I am just hacking at it at the moment to just see if it can work. I initially just want to use the built in web cam, but then like you would like to use the Kinect.

    • First I’ll try to figure out if your webcam works properly. Check if you have any /dev/videoX file (X is a number, and usually you only have 1 webcam so it should be /dev/video0) or you can try “camorama” or “cheese” to see live video from your webcam. ioctl error may be caused because your webcam driver is not working OK.

      Once you know your webcam is working OK you can look at Install ARToolKit 2.72.1 in Ubuntu 10.10 how to configure the ARTOOLKIT_CONFIG variable but for GStreamer and only one webcam this should work:

      export ARTOOLKIT_CONFIG=”v4l2src device=/dev/video0 use-fixed-fps=false ! ffmpegcolorspace ! capsfilter caps=video/x-raw-rgb,bpp=24 ! identity name=artoolkit ! fakesink”

      Then try using “./simpleTest” because I think the “videoTest” example uses a fixed configuration string that is not correct.

      • Thanks for the help, that started pushing me in the correct direction. I used your config string, but for some reason it did not work with my onboard camera or kinect. For those of you who are wondering what this config string is, its GSTREAMER configuration options for a video device. ARToolkit needs this to find out how to read from the video device.

        After playing with ‘gst-launch-0.10 $ARTOOLKIT_CONFIG’ and updating the config I eventually got it working. I needed to set the height and width of the image.

        I wrote down the information on my post about the same things: http://adriangerardcooke.com/kinect-on-ubuntu-12-04/

    • Oh, I forgot to comment that if you have the kernel Linux 3.0 or upper you can use the Kinect with Gstreamer. It has a kernel module that creates /dev/videoX device files when you plug a Kinect.

  3. Hello, first, I want to thank you because of the excelent tutorial and installation scripts!, you are helping me a lot!…

    I already installed the script for ARToolKit, everything was ok, but I only can run successful simpleLite,and when I run any other example as simpleTest, I got an error message:

    “libARvideo: GStreamer pipeline is PLAYING!
    Segmentation fault (core dumped)”

    I selected GStreamer in the script… Do you know why I’m gettin this error?…

    I’ll apreciate very much your help!…

    Thanks!

    Reply
    • If GStreamer sais it’s still playing I suposse the previous execution of simpleLite didn’t finished and is still runing somehow in the background. Have you tried booting your computer and directly running one of those examples that gets the error? Before anything else of course.

      Reply
  4. Hello, thanks for the help.

    I’m installing the ARTookit on Ubuntu Quantal 12.1, and I have a problem using make.

    It shows me several errors when entering to the lib/SRC/VideoGStreamer/video.c file it says: undefined reference to ‘gst_pad_get_negotiated_caps’ and some similar errors.

    I’ve changed the name of the file but it still is doing the same thing, error in video.c. I don’t understand since I’m new to this ARToolkit and Linux. It doesn’t let me install the toolkit, in this case can you tell me what can I do? , do I have to modify another script?. I changed the name in the folder VideoGStreamer/video.c to libv4l1-videodev. Is this right?

    Thanks for the answer.

    Reply
    • You have to change “linux/videodev.h” to “libv4l1-videodev.h” INSIDE the files listed. Change the content of the files, not change the name of the files.

      Reply
      • Hola,

        He hecho lo que me haz sugerido, sin embargo tengo los siguientes errores al escribir make en la ventana de comandos:

        ../../lib/libARvideo.a(video.o): In function `cb_have_data’:
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:66: undefined reference to `gst_pad_get_negotiated_caps’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:67: undefined reference to `gst_caps_get_structure’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:70: undefined reference to `gst_structure_get_int’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:71: undefined reference to `gst_structure_get_int’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:72: undefined reference to `gst_structure_get_double’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:74: undefined reference to `g_print’
        ../../lib/libARvideo.a(video.o): In function `testing_pad’:
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:103: undefined reference to `gst_pad_get_negotiated_caps’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:106: undefined reference to `gst_caps_get_structure’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:109: undefined reference to `gst_structure_get_int’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:110: undefined reference to `gst_structure_get_int’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:111: undefined reference to `gst_structure_get_double’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:113: undefined reference to `g_print’
        ../../lib/libARvideo.a(video.o): In function `ar2VideoOpen’:
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:199: undefined reference to `g_printf’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:202: undefined reference to `g_printf’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:206: undefined reference to `g_printf’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:210: undefined reference to `gst_init’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:219: undefined reference to `gst_version_string’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:219: undefined reference to `g_print’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:236: undefined reference to `gst_parse_launch’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:239: undefined reference to `g_print’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:244: undefined reference to `gst_bin_get_type’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:244: undefined reference to `g_type_check_instance_cast’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:244: undefined reference to `gst_bin_get_by_name’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:247: undefined reference to `g_print’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:252: undefined reference to `gst_element_get_pad’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:256: undefined reference to `gst_pad_add_buffer_probe’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:273: undefined reference to `gst_element_set_state’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:275: undefined reference to `gst_pad_get_peer’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:280: undefined reference to `gst_object_unref’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:283: undefined reference to `gst_element_get_state’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:284: undefined reference to `g_log’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:286: undefined reference to `g_print’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:294: undefined reference to `gst_element_set_state’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:297: undefined reference to `gst_element_get_state’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:298: undefined reference to `g_log’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:300: undefined reference to `g_print’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:304: undefined reference to `gst_element_set_state’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:307: undefined reference to `gst_element_get_state’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:308: undefined reference to `g_log’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:310: undefined reference to `g_print’
        ../../lib/libARvideo.a(video.o): In function `ar2VideoClose’:
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:328: undefined reference to `gst_element_set_state’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:331: undefined reference to `gst_object_get_type’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:331: undefined reference to `g_type_check_instance_cast’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:331: undefined reference to `gst_object_unref’
        ../../lib/libARvideo.a(video.o): In function `ar2VideoCapStart’:
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:349: undefined reference to `gst_element_set_state’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:355: undefined reference to `gst_element_get_state’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:358: undefined reference to `g_log’
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:362: undefined reference to `g_print’
        ../../lib/libARvideo.a(video.o): In function `ar2VideoCapStop’:
        /home/johanna/Descargas/ARToolKit/lib/SRC/VideoGStreamer/video.c:371: undefined reference to `gst_element_set_state’
        collect2: ld devolvió el estado de salida 1
        make[2]: *** [../../bin/videoTest] Error 1
        make[2]: se sale del directorio «/home/johanna/Descargas/ARToolKit/util/videoTest»
        make[1]: *** [all] Error 2
        make[1]: se sale del directorio «/home/johanna/Descargas/ARToolKit/util»
        make: *** [all] Error 2
        johanna:~/Descargas/ARToolKit$ ^C
        johanna:~/Descargas/ARToolKit$ pkg-config –libsgstreamer-0.10–libsgstreamer-0.10: unknown option

        ¿Este error se debe al scritp ./Configure o que podría ser?.

        Reply
      • Sorry, I write in Spanish. I meant that I have those errors related to VideoGStreamer when I write “make” on the command window. I’ve done what you suggested, ¿What else can I do?. Besides on the bin folder I don’t have the file “SimpleTest”.

        Thanks for the answer

        Reply
  5. can u please solve this problem

    No video config string supplied, using defaults.
    ioctl failed

    Reply
  6. when i am trying to make am getting following error will u please say what is my mistake am following the steps as given by you

    make[2]: *** [../../bin/videoTest] Error 1
    make[2]: Leaving directory `/home/mlearn/ARToolKit/util/videoTest’
    make[1]: *** [all] Error 2
    make[1]: Leaving directory `/home/mlearn/ARToolKit/util’
    make: *** [all] Error 2

    after am selecting 5 option am getting following questions what should i give y or n please help in doing this
    1.Do you want to create debug symbols? (y or n)

    2.Build gsub libraries with texture rectangle support? (y or n)
    GL_NV_texture_rectangle is supported on most NVidia graphics cards
    and on ATi Radeon and better graphics cards

    Reply
  7. I have successfully installed ARToolkit but unable to run simpleLite program. Can some you please help me? Below is the error message I am getting when I run ./simpleLite

    kumar:~/ARToolKit/bin$ ./simpleLite
    Using config string from environment [-palette=YUV420P].
    === debug info ===
    vd.driver = uvcvideo
    vd.card = HD Pro Webcam C920
    vd.bus_info = usb-0000:00:1d.0-1.8
    vd.version = 197166
    vd.capabilities = 67108865
    Width: 640
    Height: 480
    Pix Fmt: YUYV
    Type: Camera
    Control 9963779 is not supported
    Control 9963792 is not supported
    Control 9963793 is not supported
    Brightness: 128
    Contrast: 128
    Saturation: 128
    Control 9963779 is not supported
    Control 9963792 is not supported
    Control 9963793 is not supported
    Gain: 0
    Camera image size (x,y) = (640,480)
    *** Camera Parameter ***
    ————————————–
    SIZE = 640, 480
    Distortion factor = 318.500000 263.500000 26.200000 1.012757
    700.95147 0.00000 316.50000 0.00000
    0.00000 726.09418 241.50000 0.00000
    0.00000 0.00000 1.00000 0.00000
    ————————————–
    freeglut (./simpleLite): ERROR: Internal error in function fgOpenWindow
    X Error of failed request: BadWindow (invalid Window parameter)
    Major opcode of failed request: 4 (X_DestroyWindow)
    Resource id in failed request: 0×0
    Serial number of failed request: 37
    Current serial number in output stream: 40

    Reply
  8. Hi.
    I have two problems:.
    -When I do a make, something is wrong:
    make[2]: se ingresa al directorio «/home/maria/ARToolKit/examples/paddle»
    make[2]: No se hace nada para «all».
    make[2]: se sale del directorio «/home/maria/ARToolKit/examples/paddle»
    This code is repeated many times(sorry, in spanish, it says that it enter in a directory, it does nothing for “all” and get out of the directory)

    -After all, when I try the simpletest, the program ask for the configuration of the webcam:
    DEVICE CONTROLS:
    -dev=filepath
    specifies device file.
    -channel=N
    specifies source channel.
    ETC…
    And when I finish the configuration, it does nothing.

    I have tried some of the answers here, and nothing.
    What can I do?
    Thanks.

    Reply
    • 1) When make does “nothing” is not an error. That’s ok.

      2) When configuring ARToolKit use Gstreamer (option 5) and then export the ARTOOLKIT_CONFIG variable in command line. All explained here: http://tech.enekochan.com/2012/05/01/install-artoolkit-2-72-1-in-ubuntu-10-10/

      Reply
      • 1) Thanks :)
        2) I did it. I followed the ubuntu 10.10 tutorial when I couldn’t solve this problem, but it still crashing.
        Thanks.

        Reply
        • When configuring you didn’t select Gstreamer, option 5. Look that you have the option “-dev=filepath” and if you select Gstreamer there is no “-dev” option, it is “device=”.

          Reply
          • I clear all and I install all again. The installation seems to have been well, but when I run ./simpleTest it appears:

            maria:~/ARToolKit/bin$ ./simpleTest
            Using config string from environment [v4l2src device=/dev/video0 use-fixed-fps=false ! ffmpegcolorspace ! capsfilter caps=video/x-raw-rgb,bpp=24 ! identity name=artoolkit ! fakesink].
            libARvideo: GStreamer 0.10.36
            libARvideo: GStreamer pipeline is PAUSED!
            libARvideo: GStreamer negotiated 640×480
            libARvideo: GStreamer pipeline is PLAYING!
            libARvideo: GStreamer pipeline is PAUSED!
            Image size (x,y) = (640,480)
            *** Camera Parameter ***
            ————————————–
            SIZE = 640, 480
            Distortion factor = 318,500000 263,500000 26,200000 1,012757
            700,95147 0,00000 316,50000 0,00000
            0,00000 726,09418 241,50000 0,00000
            0,00000 0,00000 1,00000 0,00000
            ————————————–
            libARvideo: GStreamer pipeline is PLAYING!
            Abortado (`core’ generado)

            (In english: “Aborted (‘core’ generated)”)

            I don’t understand this error…

Leave a Comment

Trackbacks and Pingbacks:

  • Install osgART 2.0 RC3 with OpenSceneGraph 2.8.3 and Collada suppor in Ubuntu 12.04 | Programming and Technology - Pingback on 2012/06/10/ 17:12