ModalAI Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Adding USB camera to Voxl1

    VOXL Accessories
    5
    14
    922
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      riteshsharma @Moderator
      last edited by

      @Moderator Thank you for your suggestion. I would like to know if two USB supported camera (Thermal and Hires) can use UVC configurations. In other words, Can I use UVC pipe to connect attached USB cameras together? If yes, Can you provide example of the configuration file.

      ModeratorM 1 Reply Last reply Reply Quote 0
      • ModeratorM
        Moderator ModalAI Team @riteshsharma
        last edited by

        @riteshsharma we don't have an example of this, sorry. It seems like it would be feasible

        R 1 Reply Last reply Reply Quote 0
        • R
          riteshsharma @Moderator
          last edited by riteshsharma

          @Moderator

          Thank you for your reply. It gives me hope that I can connect two camera together. However, I wonder how should I configure uvc for each of my camera. Each time I use voxl-uvc-server with one of the option popping up on my terminal (options are shown below), the configuration file at /etc/modalai/voxl-uvc-server.conf get replaced with new settings.
          1.png

          Also, I tried changing configuration file manually but then only the first configuration shows up on voxl-portal.

          {
          "pipe_name": "uvc_hires",
          "width": 1920,
          "height": 1080,
          "fps": 5,

              "pipe_name":    "uvc_boson",
              "width":        640,
              "height":       480,
              "fps":  30
          

          }

          R 1 Reply Last reply Reply Quote 0
          • R
            riteshsharma @riteshsharma
            last edited by riteshsharma

            @Moderator I was able to start two camera (thermal camera and hires camera) connected through two USB using the command below.

            voxl-uvc-server -d -v 0c45 -p 636b -r 1920x1080 -f 5 -o uvc_hires (Hires Camera)

            voxl-uvc-server -d -v 09cb -p4007 -r 640x512 -f 30 -o uvc_boson (Thermal Camera)

            But I could not find a way to start both the camera together. Only one works at a time as the configuration file overrides. It can only accept one UVC configuration settings. I would appreciate if you could provide me a way to correctly set up configuration file for both the camera.

            I have already gone through documentation at https://docs.modalai.com/voxl-uvc-server/. It only mentions that we need to have different setup for each camera which in my case is evident from the two commands above.

            ModeratorM 1 Reply Last reply Reply Quote 0
            • ModeratorM
              Moderator ModalAI Team @riteshsharma
              last edited by

              @riteshsharma Here's the source code to where the voxl-uvc-server is killing other processes: https://gitlab.com/voxl-public/voxl-sdk/services/voxl-uvc-server/-/blob/master/src/main.c?ref_type=heads#L302

              you should fork that repository and add a command line flag to disable that feature. We're happy to look at a merge request if you feel that feature is helpful

              R 1 Reply Last reply Reply Quote 0
              • R
                riteshsharma @Moderator
                last edited by riteshsharma

                @Moderator Can you please provide updated instruction to build voxl-uvc-server package so that I can deploy it to Voxl1? I followed the instruction on the link (https://gitlab.com/voxl-public/voxl-sdk/services/voxl-uvc-server). It is giving me errors.

                voxl-emulator:~$  ./install_build_deps.sh apq8096 dev
                using apq8096 dev repo
                Downloading http://voxl-packages.modalai.com/dists/apq8096/dev/binary-arm64//Packages.gz.
                Updated source 'dev'.
                installing: 
                libmodal-json
                libmodal-pipe
                voxl-libuvc
                Package libmodal-json (0.4.3) installed in root is up to date.
                Package libmodal-pipe (2.10.0) installed in root is up to date.
                Package voxl-libuvc (1.0.7) installed in root is up to date.
                
                Done installing dependencies
                
                voxl-emulator:~$ ./build.sh  apq8096 
                CMake Error at /usr/share/cmake-3.3/Modules/CMakeDetermineSystem.cmake:104 (message):
                  Could not find toolchain file:
                  /opt/cross_toolchain/arm-gnueabi-4.9.toolchain.cmake
                Call Stack (most recent call first):
                  CMakeLists.txt:2 (project)
                
                
                CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
                Missing variable is:
                CMAKE_C_COMPILER_ENV_VAR
                CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
                Missing variable is:
                CMAKE_C_COMPILER
                CMake Error: Could not find cmake module file: /home/root/build/CMakeFiles/3.3.1/CMakeCCompiler.cmake
                CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
                Missing variable is:
                CMAKE_CXX_COMPILER_ENV_VAR
                CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
                Missing variable is:
                CMAKE_CXX_COMPILER
                CMake Error: Could not find cmake module file: /home/root/build/CMakeFiles/3.3.1/CMakeCXXCompiler.cmake
                CMake Error at CMakeLists.txt:2 (project):
                  No CMAKE_C_COMPILER could be found.
                
                  Tell CMake where to find the compiler by setting the CMake cache entry
                  CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name
                  if it is in the PATH.
                
                
                CMake Error at CMakeLists.txt:2 (project):
                  No CMAKE_CXX_COMPILER could be found.
                
                  Tell CMake where to find the compiler by setting the CMake cache entry
                  CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler
                  name if it is in the PATH.
                
                
                CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
                CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
                -- Configuring incomplete, errors occurred!
                make: *** No targets specified and no makefile found.  Stop.
                

                I also tried using voxl-cross. It was able to build the package correctly but gave me error while executing.

                voxl:~$ voxl-uvc-server
                voxl-uvc-server: error while loading shared libraries: libuvc.so.0: cannot open shared object file: No such file or directory
                
                Alex KushleyevA 1 Reply Last reply Reply Quote 0
                • Alex KushleyevA
                  Alex Kushleyev ModalAI Team @riteshsharma
                  last edited by

                  @riteshsharma,

                  Can you please try to put the source code of voxl-uvc-server on VOXL1 and just build it on target?

                  You will need to modify the build.sh file (https://gitlab.com/voxl-public/voxl-sdk/services/voxl-uvc-server/-/blob/master/build.sh)

                  to have an entry like below and execute using ./build.sh native

                  native)
                  		mkdir -p build
                  		cd build
                  		cmake -DBUILDSIZE=32 ../
                  		make -j$(nproc)
                  		cd ../
                  		;;
                  
                  
                  
                  R 1 Reply Last reply Reply Quote 0
                  • R
                    riteshsharma @Alex Kushleyev
                    last edited by

                    @Alex-Kushleyev
                    Thank you @Alex-Kushleyev . Finally I was able to modify the code to make it work for 2 USB cameras.

                    Alex KushleyevA Eric KatzfeyE 2 Replies Last reply Reply Quote 0
                    • Alex KushleyevA
                      Alex Kushleyev ModalAI Team @riteshsharma
                      last edited by

                      @riteshsharma excellent!

                      1 Reply Last reply Reply Quote 0
                      • Eric KatzfeyE
                        Eric Katzfey ModalAI Team @riteshsharma
                        last edited by

                        @riteshsharma Was there an error in our documentation that we need to fix? Did you make some changes that you think may be valuable to others and, if so, are you willing to share them?

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Powered by NodeBB | Contributors