Video Processing on Companion Computer

Hello all,

I am fairly new to MAVSDK and PX4, and have been asked to help with a system that seems like it should be fairly common, but lack of experience is making this difficult. The goal of the system is to have a quadcopter running a mission with a small pc on the side running a camera and some computer vision algorithms. The small pc would be physically attached to the quadcopter, and needs to be able to take control under certain circumstances. Additionally, we should be able to send images to the ground station for manual inspection.

My working assumptions are that the pc on the quadcopter is considered a ‘companion’ and any instructions it sends to the copter are called ‘offboard’. It also seems like I can send images to the ground station using standard file transfer protocols because everything is WiFI connected, and I don’t need to use MAVLink FTP unless I am sending files to the autopilot system. Does this seem correct or am I missing something critical?

Sorry for the vagueness, I have yet to receive hardware and am working entirely in simulation (px4_sitl, jmavsim/airsim, and QGroundControl). Any suggested reading/corrections/documentation would be greatly appreciated.

Yes you’re right you can talk with PX4 using a companion computer (Raspberry pi or other). MAVSDK will give you simples functions to be able to talk to the FCU: offboard, takeoff, kill, get parameters, etc…

For the images I guess you have many solutions. Your camera could be connected directly to the receiver in the drone so that you can get the image in real time on your remote controller. Not sure what your final goal here

1 Like

Let me attempt to clarify the camera situation. As of right now, the intent is to have a camera connected to the companion pc. Most of the time, the companion pc should be taking in images and running analysis. When it detects something of interest, I need to send the images to a human for verification and pause the current mission.

As I understand things, the companion pc is connected to PX4 using serial and communicates with MAVLink (MAVSDK). The companion pc currently being used has access to wifi. I guess my real question is: given this set up, does the companion pc have to also use MAVSDK (Camera or FTP) to communication with the human on the ground or can that be a separate system utilizing the wifi connection?

No, no need to use MAVSDK for camera communication. Your companion computer can be connected to a WiFi and share the information like this with a computer on the same network

I agree with Katawan. But I also want to note that mavlink has already a system for cameras to take a picture. I think it could be tweeakd a little bit to allow camera component to send messages sparsly (when ever an interesting image is detected), this way you would save yourself from dealing with establishing new connection and managing it etc. Note that I have no experience with mavlink camera micro service but you can find docs about it here: Camera Protocol · MAVLink Developer Guide . As you said this seems to be a common enough problem that even if it is missing mavlink guys would probably happy to implement.
Since you also said you are new to px4 you might not now it, but there is a very active slack channel and weekly open online meetings, so take a look at there as well :smiley:

1 Like

I’ve also wondered about this (camera hooked up to companion, sometimes want to send images to base station). Wifi has limited range and I’d like to use the 433hz telemetry / LoRa setup to send stuff. I’ve never hooked up a camera to the flight controller itself, just to a pi running a separate process. Maybe its time to start since it seems that feature is pretty built out in the px4 world.