-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Gimbal Interface #3386
base: master
Are you sure you want to change the base?
New Gimbal Interface #3386
Conversation
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. |
Very neat! :) |
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.
Adjust the If you configure your autopilot to provide 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 |
9fb28b3
to
56a2a6b
Compare
eb3d908
to
15628d5
Compare
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:
|
need to tweak for android/apple - currently failing. system.drawing cant be used easerly.... |
@@ -7,6 +7,8 @@ namespace MissionPlanner.Controls | |||
{ | |||
public partial class Video : Form | |||
{ | |||
private readonly GStreamer stream = new GStreamer(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to confirm if this can be instance based. i have a feeling it cant. as it will lead to native crashs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can open multiple GStreamer sources (multiple gimbal windows and a separate stream on the HUD) with no apparent issues if that's what you mean.
6cd30be
to
6adf829
Compare
Tracking added |
7cdfb5e
to
dbb9168
Compare
f133b6f
to
b7075f7
Compare
I've tested this quite a bit now and it works! A few issues I found (and have already reported to Rob):
Some of the things I tested include:
From my point of view, besides the two crash issues listed it looks very usable. I guess one enhancement (also already discussed with Rob) is it would be nice to reduce the number of clicks the user must do before the video appears. In particular the user must currently do this each time MP is started:
|
b91248c
to
0f81dac
Compare
|
Previously, this function did nothing. It was also trying to do the opposite of what it claimed to do.
This library was originally copy-pasted from ArduPilot and ported to C#, but many mistakes were made in the process. For example, many of the methods in the C++ implementation take a reference variable as input, and the C# code was taking a regular input and outputting nothing. This commit overhauls the whole library, making it more C#-like and documents all methods.
e4b3d3b
to
16659c2
Compare
Hi @robertlong13, Thanks for that. Re up/down, I think that "forward" on the keyboard (e.g. "w" is forward of "a" and "s") is "up" and that should make the gimbal pitch up. Ok, re retract, I'm pretty sure I did have a keyboard shortcut conflict. Txs for the info on re-connect. Perhaps I just didn't wait 8 seconds. Thanks again! I hope @meee1 will have time to review and merge once he's happy with it |
Hrm, what you're describing is what it is supposed to do right now, unless I have my signs wrong in my mavlink commands (that must be it). Will test on my Siyi when I get home.
|
@rmackay9 I can't reproduce your reversal issue. Hitting up (W) definitely makes the gimbal pitch up by default. Can you confirm your keybindings? I confirmed that the keybinding defaults to what you're asking for, and I tested in SITL, and confirmed the MAVLink message going out matches the MAVLink spec. I didn't actually test with my Siyi, because I forgot how much of a pain it is for me to get it moving my current setup (though I should get that working again). If it's still going backwards for you, that makes me wonder if there's an AP implementation issue. Could you send a short tlog of you commanding slew-up (and only up, no down)? |
16659c2
to
efffc05
Compare
@rmackay9, I found the issue with the click to pan. I was correctly clipping the mouse coordinates to the top and to the left of the image, but I was letting it overflow when clicking past the bottom or the right of the image. Clicking in the grey area on any side now should act just like hitting the edge exactly. However, I couldn't reproduce exactly the symptom you drew in your picture. On the top side, even before my fix just now, clicking that red x did the same as the green x. It was only broken on bottom (which is why the bottom moved further than the top as you said in your message). |
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.
I have a test setup using RealFlight that I will need to document so anyone can play around with this.
I have a lua script I need to publish that sends VIDEO_STREAM_INFORMATION messages so Planner can detect the URIs for the video.
ArduPilot's
CAMERA_FOV_STATUS
message has a bug that causes the wrong units to be used for alt. Needs fixing.Most of the buttons and right-click options do not work yet
Need a settings page so people can adjust the stuff like keybindings
Things you can do
CAMERA_FOV_STATUS
to send the correct units)(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)