MAVLINK GPS Tracking PTZ Camera Project

Hello everyone,

I’m working on a custom code project that processes MAVLINK messages received by the GCS and does some math to adjust the pan, tilt, zoom, and focus of a PTZ camera. I have tested it in ArduPilot SITL and it worked just fine… but when it comes to real life, the camera movement is not smooth. It seems like the MAVLINK messages are not coming in at the same rate as SITL.

Does anyone have info on this phenomenon, maybe the GPS updates are not rapid enough, the telemetry stream is slow over RF compared to SITL, or something else is going on. Initially I thought we needed PID control logic, but it just seems like we are receiving laggy messages because SITL works smooth. It seems like we get 1 good GPS message every 1 second using a real flight vehicle so the camera is jumping to the next position. Is there a way to increase the rate at which GPS messages are sent using MAVLINK or any other ideas fix this problem? This is not the same as an antenna tracking issue, I’ve spent hours looking through those other projects. I would think RF and even a 10Hz update rate with 10% loss should still be fine, but clearly we are losing a lot of data. Need a better radio? We are using Microhards.

Additionally, I realized Mission Planner’s first MAVLINK mirror option uses TCP, which is what I selected. This could cause crashes and additional lag compared to UDP. I bet I need to set up the MAVLINK mirror as UDP and test again. Will keep you updated.

1 Like