Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse
Brand Logo

ModalAI Forum

  1. ModalAI Support Forum
  2. Development Drones
  3. Python, OpenCV, MAVLink, Docker, and cameras how to use all?

Python, OpenCV, MAVLink, Docker, and cameras how to use all?

Scheduled Pinned Locked Moved Unsolved Development Drones
m500
5 Posts 5 Posters 1.6k Views 2 Watching
  • 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.
  • A Offline
    A Offline
    Alfonso Ponce
    Contributor
    wrote on last edited by
    #1

    Hello! So I work on a ModalAI m500 developement drone. I've used Docker to run python programs along with MAVSDK. My next goal is to create a program that detects faces or AprilTags or any specified object and make the drone follow it while the object/person moves, however I don't know how to stream what the camera sees into my Pyhton program using OpenCV. Considering my program is running inside a Docker, how can I get real time images from any of the cameras on the drone, make the stream get into the Docker, make the Python program get that stream, process it and make the drone react to the processing output?

    Thank you!

    Eric KatzfeyE 1 Reply Last reply
    0
    • Daniel RyuD Offline
      Daniel RyuD Offline
      Daniel Ryu
      Regular
      wrote on last edited by
      #2

      Not Modalai, but this is what I used. When running the docker container, make sure you run it with the --device tag. This will let you add devices such as cameras you can then access with opencv. For instance, if I use the gimbal camera, I would add to the "docker run" command the "--device=/dev/video2." I would then use opencv like "cap = cv2.VideoCapture(2)" which will try to access the camera at /dev/video2. I'm uncertain whether this process will work for the other cameras, but theoretically as long as you find the correct folders where the camera devices are stored, you should be able to connect to them

      1 Reply Last reply
      0
      • A Alfonso Ponce

        Hello! So I work on a ModalAI m500 developement drone. I've used Docker to run python programs along with MAVSDK. My next goal is to create a program that detects faces or AprilTags or any specified object and make the drone follow it while the object/person moves, however I don't know how to stream what the camera sees into my Pyhton program using OpenCV. Considering my program is running inside a Docker, how can I get real time images from any of the cameras on the drone, make the stream get into the Docker, make the Python program get that stream, process it and make the drone react to the processing output?

        Thank you!

        Eric KatzfeyE Offline
        Eric KatzfeyE Offline
        Eric Katzfey
        ModalAI Team
        wrote on last edited by
        #3

        @Alfonso-Ponce If you want to use any of the standard cameras then you need to get the frames from voxl-camera-server. It is based on our "ModalAI Pipe Architecture" (MPA) that uses standard Linux pipes to move data between processes. You can make an MPA client application in your Docker and receive the frames there. You will likely need to use the "-v" flag when launching your container to remap the pipe names outside of the Docker to new names inside of the Docker (e.g. -v <pipe name>:<container pipe name>)

        J 1 Reply Last reply
        0
        • Eric KatzfeyE Eric Katzfey

          @Alfonso-Ponce If you want to use any of the standard cameras then you need to get the frames from voxl-camera-server. It is based on our "ModalAI Pipe Architecture" (MPA) that uses standard Linux pipes to move data between processes. You can make an MPA client application in your Docker and receive the frames there. You will likely need to use the "-v" flag when launching your container to remap the pipe names outside of the Docker to new names inside of the Docker (e.g. -v <pipe name>:<container pipe name>)

          J Offline
          J Offline
          jaredjohansen
          Regular
          wrote on last edited by
          #4

          @Eric-Katzfey , would you be able to share a minimal code example (preferably in python) that retrieves a single frame from the high-res camera? The minimal code would be running in a Docker container running on the VOXL.

          1 Reply Last reply
          0
          • todd45040T Offline
            todd45040T Offline
            todd45040
            wrote on last edited by
            #5

            I'm going to assume you know about the Docker examples at:
            https://gitlab.com/voxl-public/voxl-docker-images

            Will any of those help?

            -Todd

            1 Reply Last reply
            0

            Reading along? Create a free ModalAI Forum account to join in.

            With an account you can reply, ask your own question, get an email when a ModalAI engineer answers, and mark the reply that solved it. Your place in each thread is saved between visits.

            Questions about VOXL, Flight Core, ESCs and ModalAI drones are answered here by the engineers who build them.

            Register Login
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            ModalAI
            Categories Recent Tags ModalAI.com Docs
            © 2026 ModalAI® · Accelerating autonomy for smaller, smarter, safer drones · Powered by NodeBB
            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups