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

DO_REPOSITION ignores frame, always assumes AMSL #10246

Open
julianoes opened this issue Aug 16, 2018 · 16 comments · May be fixed by #23080
Open

DO_REPOSITION ignores frame, always assumes AMSL #10246

julianoes opened this issue Aug 16, 2018 · 16 comments · May be fixed by #23080

Comments

@julianoes
Copy link
Contributor

julianoes commented Aug 16, 2018

It looks like the frame of a DO_REPOSITION command is ignored. The altitude is always assumed to be AMSL:

https://github.com/PX4/Firmware/blob/96995852cb6a2e2e23894c7ea05dd8385c595172/src/modules/navigator/navigator_main.cpp#L357

This was discovered by @mzahana in mavlink/MAVSDK#485.

@julianoes
Copy link
Contributor Author

julianoes commented Aug 17, 2018

@dagar
Copy link
Member

dagar commented Aug 17, 2018

Yes I'm aware. I wanted to make all of these things respect frame (both commands and missions), but what is it supposed to be if sent with COMMAND_LONG (no frame)?
https://mavlink.io/en/messages/common.html#COMMAND_LONG

@mzahana
Copy link
Contributor

mzahana commented Aug 17, 2018

I guess it would be more consistent to have frame field in COMMAND_LONG, no?

@julianoes
Copy link
Contributor Author

I vote to start ignoring warning when receiving a COMMAND_LONG and assuming a frame in that case and after a while not accepting it anymore.

@stale
Copy link

stale bot commented Feb 4, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Admin: Wont fix label Feb 4, 2019
@hamishwillee
Copy link
Contributor

@julianoes Can we just stop accepting COMMAND_LONG now. Probably safer. If we do accept it then should we should emit a deprecation STATUS_TEXT with frame used info included? That way there is a cost to sending us those messages.

@julianoes
Copy link
Contributor Author

@hamishwillee agreed.

@hamishwillee
Copy link
Contributor

@julianoes So this went stale last time, how do we get work done so it gets completed?

@julianoes
Copy link
Contributor Author

Ok, so I started looking into it and found that we don't even store the frame from any incoming COMMAND_INT, so clearly we're just ignoring this and not adhering to the spec. I don't even know where to start 😕.

https://github.com/PX4/Firmware/blob/6178ead6ea48568972fa71ef95d87683783c482d/src/modules/mavlink/mavlink_receiver.cpp#L518-L545

@hamishwillee
Copy link
Contributor

That has implications for any test suite :-(.

Proposal.

  1. We store the frame.
  2. We reject any message that does not use the frames we support
    I can try do this if you want.

@stale stale bot removed the Admin: Wont fix label Feb 5, 2019
@julianoes
Copy link
Contributor Author

Sure, I think that would make sense.

@julianoes
Copy link
Contributor Author

It's still wrong you bot.

@hamishwillee
Copy link
Contributor

One day I will find time

@stale stale bot removed the Admin: Wont fix label Oct 1, 2019
@PX4 PX4 deleted a comment from stale bot Oct 1, 2019
@PX4 PX4 deleted a comment from stale bot Oct 1, 2019
@ericjohnson97
Copy link

I think the current version still doesn't support any other frames besides MAV_FRAME_GLOBAL

@jperez-droneup
Copy link

I am having issue with this bug as well. We would prefer to run MAV_CMD_DO_REPOSITION with MAV_FRAME_GLOBAL_RELATIVE_ALT_INT. Is this bug planned to be fixed in the near future?

@hamishwillee hamishwillee removed their assignment Jun 7, 2023
@hamishwillee
Copy link
Contributor

@julianoes @dagar Recent discussion on this area is that if it is sent with COMMAND_LONG (which has no frame) it should be rejected with a result of MAV_RESULT_COMMAND_INT_ONLY.

I am also proposing MAV_RESULT_COMMAND_UNSUPPORTED_FRAME so that we can relatively easily do the right thing and indicate that we don't support "wrong" frames. Currently we don't even return unsupported which is horribly buggy.

I am having issue with this bug as well. We would prefer to run MAV_CMD_DO_REPOSITION with MAV_FRAME_GLOBAL_RELATIVE_ALT_INT. Is this bug planned to be fixed in the near future?

@jperez-droneup No.

I have unassigned me as I am never going to find time, and would not be the most efficient person to do so. Given @dagar hasn't done it in years probably he won't either.

You are most welcome to create a PR that implements another frame and/or errors if unsupported frames are used.

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

Successfully merging a pull request may close this issue.

6 participants