Skip to content
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

Add Guided mode handling to Mavlink telemetry #10424

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xznhj8129
Copy link

This PR adds a simple check for BOXGCSNAV in the mavlink mode mapping switch caes to either return GUIDED if GCS NAV is active or LOITER if not, i tested it working using X-plane HITL.

@mmosca
Copy link
Collaborator

mmosca commented Oct 24, 2024

@stronnag does this make sense?

@bartslinger
Copy link
Contributor

I think a fundamental decision needs to be made about the mavlink integration. You can choose to pretend to be an ArduPlane. The current mavlink implementation basically already does that, by the mode mapping. It's the quickest (and dirtiest) way to mavlink functionality.

However I think the 'proper' thing to do, is to stick as much as possible to the generic protocol. The generic protocol also supports "custom_mode", which is something autopilot-specific. The mavlink common dialect should add type MAV_AUTOPILOT_INAV (like there are constants for every other type of firmware). The ground station software should then handle the custom modes accordingly.

However this is significantly more work of course, because it requires work on the mavlink protocol and the ground station software. Personally I don't really mind mimicking ArduPlane for the time being, but it would be nice to kick off some efforts into supporting INAV properly.

@MrD-RC
Copy link
Collaborator

MrD-RC commented Oct 24, 2024

It depends on the overhead on the flight controller. There is only a small amount of space. IMHO, INAV is not a MAVLink platform. It is an MSP platform. The right solution would be MSP GCS. Space is much more abundant on computers. MVPTools is an option.

@bartslinger
Copy link
Contributor

You raise an interesting point. It made me look up the design choices for MSP, which includes this statement:

I thought first about an implementation of Mavlink, but I think it's not what I was looking for.
Even with a partial implementation, the predefined structures are not light enough for what I have in mind.
Some messages are however inspired from mavlink structure.

Mavlink is still very tempting though, especially because of the compatibility, all the tools, ground stations and things like mLRS.

If Mavlink is really desired, perhaps it's "better" to run a protocol translator on the computer. Except that you can't use mLRS in that case, so we would need "mspLRS" too.

@mmosca
Copy link
Collaborator

mmosca commented Oct 24, 2024

INAV is not aiming at providing feature parity between MSP and Mavlink and will remain a MSP first platform for the time being.

I have no issues with this change, but overall expectations need to be aligned.

Using Mavlink will not magically turn INAV into ArduPilot or PX4 and you certainly should not expect INAV to care about random Mavlink messages or to be able to setup INAV from scratch using Mavlink.

@sensei-hacker
Copy link
Collaborator

sensei-hacker commented Oct 24, 2024

to be able to setup INAV from scratch using Mavlink

I think that's a useful distinction. Setup / configuration vs flight. There's no need to do configuration via Mavlink. I didn't think there's a need to substitute for INAV Configurator.

That significantly reduces the number of messages that matter.

@xznhj8129
Copy link
Author

Except that you can't use mLRS in that case, so we would need "mspLRS" too.

I think mLRS already supports MSP, i've seen people talking about using it (i don't have mLRS hardware yet), in any case it's in active development and if it doesn't fully support it stable it will soon enough so that's a plus.

to be able to setup INAV from scratch using Mavlink

I think that's a useful distinction. Setup / configuration vs flight. There's no need to do configuration via Mavlink. I didn't think there's a need to substitute for INAV Configurator.

That significantly reduces the number of messages that matter.

Configuring INAV with Mission Planner? Good lord, no. The configurator is one of the best things about INAV. We only have to look at the flight related messages of Mavlink, which does cut down immensely on the number of things that need to be implemented and is actually quite manageable and won't take up that much space. INAV will always be configured with MSP (thank god), when people talk about Mavlink support they almost exclusively mean telemetry, control and missions.

Full feature parity with Mavlink is not something that can, or should, be contemplated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants