ArduPilot / MissionPlanner

Mission Planner Ground Control Station for ArduPilot (c# .net)
http://ardupilot.org/planner/
GNU General Public License v3.0
1.8k stars 2.42k forks source link

New Gimbal Interface #3386

Open robertlong13 opened 3 months ago

robertlong13 commented 3 months ago

Still a bit to do, but I have some stuff working. It's going to be a massive PR, so I want to get some of this out there to start review early.

(Terrible gif quality, had to really squeeze it down to fit in a github post, so there are a ton of artifacts; these obviously aren't in the real thing) gimbal_early_demo

rmackay9 commented 3 months ago

This is really great to see! Thanks for also finding the issue with FOV_STATUS. We added support ages ago but no GCS has used it yet so I guess we missed the bug.

Davidsastresas commented 3 months ago

Very neat! :)

IuliuNovac commented 3 months ago

How did you manage to get the simulation with a video feed up and running, is that gazebo?

robertlong13 commented 3 months ago

How did you manage to get the simulation with a video feed up and running, is that gazebo?

I use RealFlight. I'm sure the same thing could be done in Gazebo, but I don't know my way around it nearly as well. You need this model and this lua script. You also need to be running on AP master (until the FOV message bug fix gets backported to 4.5)

I use a gstreamer pipeline to grab a cropped area of a monitor. I toyed with using OBS to stream as RTSP, but that introduced more than a second of latency.

dx9screencapsrc x=10 y=60 width=640 height=360 monitor=1 ! videoconvert ! video/x-raw,format=BGRA ! appsink name=outsink sync=false

Adjust the monitor, x, y, width, and height for your setup.

If you configure your autopilot to provide VIDEO_STREAM_INFORMATION messages, with gst://[pipeline] as the URI, this new UI can grab the pipeline from there automatically (it doesn't auto connect to it yet though; that's a planned feature).

The airport in this video was Pendleton Airport (KPDT), but I don't know if I can share my RealFlight model of that airport publicly. Instead, I'll share Base INFOCA, which has the side benefit of being within the real terrain model RealFlight pulled from Spain, so all the terrain actually lines up: Base INFOCA_AP.zip. The downside is that I went WAY overboard manually adding one metric crapload of trees to it. Disable trees with View > Scenery > Trees to disable them if your computer is choking on them. Launch SITL with -O 37.412620,-3.075734,1052.0,0

robertlong13 commented 1 month ago

This PR is getting close to ready. All buttons and (almost) all keybindings are implemented, and I have a nice settings page where you can customize every keybinding.

Still needed:

meee1 commented 1 month ago

need to tweak for android/apple - currently failing. system.drawing cant be used easerly....

robertlong13 commented 1 month ago

Tracking added

robertlong13 commented 1 month ago

Added new ways to display the new control

image

Full Sized. In this mode, there is a mini map by default, but it can be hidden with a button in the right-click menu. image

Mini image

Mini and full-sized can be swapped at any point with the "swap with map" when right clicking on the video.

And pop-out works exactly as before (except now it remains always on top, which I think is always better, you can always intentionally minimize it if it's in the way).