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

New VehicleAction in MissionItem #1424

Closed
wants to merge 19 commits into from

Conversation

@rligocki rligocki changed the title Added first iteration of code to generate MAVLink commands based on VehicleAction in MissionItem New VehicleAction in MissionItem Apr 29, 2021
Copy link
Collaborator

@JonasVautherin JonasVautherin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for a wrong comment, it looks good to me 😊. Did you test it? Does it work? 🚀

src/plugins/mission/mission_impl.cpp Outdated Show resolved Hide resolved
@JonasVautherin
Copy link
Collaborator

Seeing the errors in CI (e.g. in mission.h), I come to wonder: did you auto-generate the code from the proto file, or did you write it manually? mission.h should be auto-generated, you should not have to write anything there yourself, right?

@julianoes
Copy link
Collaborator

Thank @rligocki. Now it would be nice if there was a new integration test using it.

@rligocki
Copy link
Contributor Author

Yep I wrote it manually. Didn't know that it is possible to generate templates based on MAVSDK-Proto. I will have a look on generation of on C++ code based on Proto.

@julianoes
Copy link
Collaborator

@rligocki there is a comment telling you that the file is auto-generated.
And please have a look at the docs: https://mavsdk.mavlink.io/main/en/cpp/contributing/plugins.html#generate-h-and-cpp-files

@rligocki
Copy link
Contributor Author

rligocki commented May 1, 2021

Now it looks like it might be ready for testing. What is best way to do it?

@JonasVautherin
Copy link
Collaborator

What is best way to do it?

You can write a small script that uses it, or directly go for an integration test (like one of the mission_*.cpp here). Maybe mission_action.cpp?

Also the style is wrong, please run ./tools/fix_style.sh ., and the "proto" CI test is failing because you did not update the proto submodule in this PR. Just make it point to your MAVSDK-Proto PR commit and it should be fine 👍.

@rligocki
Copy link
Contributor Author

rligocki commented May 2, 2021

It looks like, there is some change in MAVSDK-Proto in core.proto file. Connection state is missing value 1. In my MAVSDK-Proto PR there are only additional code with VehicleAction. MAVSDK PR there is one removed line with that value.

@JonasVautherin
Copy link
Collaborator

JonasVautherin commented May 2, 2021

Connection state is missing value 1.

Wasn't this resolved in #1420? Is your branch up to date?

Also you forgot to fix the style: ./tools/fix_style.sh .

Other than that, everything seems to build, so I'd say that the next step would be an integration test showing a mission for a VTOL, with transition waypoints 😊. Once we can verify that this works, I think that will be ready to be merged (first the mavsdk-proto PR, then you'll have to update this one to point to main of mavsdk-proto, and then we'll merge this one).

TL;DR: next up is the integration test 😉

@rligocki
Copy link
Contributor Author

rligocki commented May 2, 2021

Connection state is missing value 1.

Wasn't this resolved in #1420? Is your branch up to date?

https://github.com/mavlink/MAVSDK-Proto/blob/main/protos/core/core.proto - It looks like it is in main, so I was up to date.

Also you forgot to fix the style: ./tools/fix_style.sh .

On my mac I was not able to compile these tools. So I need to do fix_style on different computer at home.

@JonasVautherin
Copy link
Collaborator

It looks like it is in main, so I was up to date.

There two of them: the proto submodules, and then the MAVSDK branch itself. Both need to be up to date 👍. This said, the CI tests pass... where do you see the issue with the connection state? When building the integration tests? If yes, just update your branch to mavsdk:main 👍

@rligocki
Copy link
Contributor Author

rligocki commented May 5, 2021

Still don't understand that problem with MAVSDK-Proto. On main branch, there is removed one connection state. Fixed problem with style. Should I create PR for connection state error?

@JonasVautherin
Copy link
Collaborator

On main branch, there is removed one connection state. Fixed problem with style. Should I create PR for connection state error?

You have a fork of mavlink/MAVSDK, say ~/mavsdk, right? Inside of it, there is the proto submodule, ~/mavsdk/proto. Those are two different git repositories, but they are related.

You need ~/mavsdk/proto to point to the HEAD of mavlink/MAVSDK-Proto, and ~/mavsdk to point to the HEAD of mavlink/MAVSDK. The connection changes are both in the proto submodule (where the interface removes it) and in the mavsdk repo (where it is removed in the implementation)

Does that make sense?

@rligocki
Copy link
Contributor Author

rligocki commented May 5, 2021

You have a fork of mavlink/MAVSDK, say ~/mavsdk, right? Inside of it, there is the proto submodule, ~/mavsdk/proto. Those are two different git repositories, but they are related.

This is what I understand. I see no problem there.

You need ~/mavsdk/proto to point to the HEAD of mavlink/MAVSDK-Proto, and ~/mavsdk to point to the HEAD of mavlink/MAVSDK. The connection changes are both in the proto submodule (where the interface removes it) and in the mavsdk repo (where it is removed in the implementation)

But you said that ~/mavsdk/proto should point to MAVSDK-Proto PR. So you suggest to change proto git to point at mavlink/MAVSDK-Proto main branch?

@rligocki
Copy link
Contributor Author

rligocki commented May 5, 2021

I am really lost. I need help at this situation. Cannot find where exactly I made mistake and how to solve it. Tried to find solution, but unfortunately it is first time I contribute to public repository so I have no experience at this case.

@JonasVautherin JonasVautherin force-pushed the feature-extension-mission-item branch 2 times, most recently from fafd513 to 8cf92da Compare May 5, 2021 21:29
@JonasVautherin
Copy link
Collaborator

No worries, it can be tricky in the beginning 😉.

Should be fine now, both your branches were not up-to-date with upstream. Read about syncing with upstream e.g. here (it has to be done on both your mavsdk and mavsdk-proto forks until your proto is merged upstream).

@JonasVautherin JonasVautherin force-pushed the feature-extension-mission-item branch from 8cf92da to 8bf4b21 Compare May 5, 2021 21:39
@JonasVautherin
Copy link
Collaborator

The docs CI check is failing, I commented on the proto PR accordingly: mavlink/MAVSDK-Proto#226

Other than that, it would be nice if you could add an integration test. Note that the integration tests run on the iris SITL multicopter, so ideally use actions that work for a multicopter (i.e. takeoff and land), and maybe write a test that checks that the iris behaves correctly when you use VTOL actions (I don't know what PX4 is expected to do, but a test for it would be nice).

I won't be asking you to change the integration tests such that they can run a VTOL, but that would be a nice addition later 😊.

@rligocki
Copy link
Contributor Author

rligocki commented May 6, 2021

Thanks a lot for your help. I though, that you would give me some advice, but this was faster way.

Where are those integration tests located? I can check them and then create group of new tests for this purpose.

@julianoes
Copy link
Collaborator

Does this answer it? https://mavsdk.mavlink.io/main/en/cpp/guide/test.html

Copy link
Collaborator

@JonasVautherin JonasVautherin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the integration test prove that the takeoff action works? My feeling is that it would also takeoff without the takeoff action 🤔.

Could we make it such that it lands and takes off in the middle of a mission? That I am pretty sure is not yet working 😆

Mission::MissionPlan mission_plan{};
mission_plan.mission_items.push_back(new_item);

new_item.vehicle_action = Mission::MissionItem::VehicleAction::TransitionToFw;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the expected behavior when flying a multicopter? I guess it is ignored, isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess so. I was thinking, that if landing and takeoff would work, this action will provide that information.

@JonasVautherin JonasVautherin force-pushed the feature-extension-mission-item branch from aaab585 to 8c3802b Compare May 27, 2021 08:55
Copy link
Collaborator

@JonasVautherin JonasVautherin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but will need to be merged after the acceptance_radius PR (because it requires an update of the proto submodule)

@JonasVautherin JonasVautherin force-pushed the feature-extension-mission-item branch from 8c3802b to 3404dda Compare May 28, 2021 18:27
@JonasVautherin
Copy link
Collaborator

JonasVautherin commented May 28, 2021

@rligocki: I merged the proto PR and updated the branch here (don't forget to pull the changes). Once the integration tests are fixed, that can go in 👍

@JonasVautherin
Copy link
Collaborator

JonasVautherin commented Jun 3, 2021

@rligocki I removed the commits on mavsdk-proto:main and moved them to https://github.com/mavlink/MAVSDK-Proto/tree/add-vehicle-action until this is solved.

Hence you will have to update the proto submodule here to point to https://github.com/mavlink/MAVSDK-Proto/tree/add-vehicle-action when you get back to this PR

@rligocki
Copy link
Contributor Author

rligocki commented Jun 8, 2021

Now I was able to found some time for this problem. I will fix those tests so that they will pass.

@julianoes
Copy link
Collaborator

@rligocki what's the status here? Would be nice to get this in soon.

@julianoes julianoes marked this pull request as draft July 12, 2021 14:53
@rligocki
Copy link
Contributor Author

Cannot upload those vehicle mission item on PX4. There is an error.

@rligocki rligocki marked this pull request as ready for review August 25, 2021 13:13
@rligocki
Copy link
Contributor Author

Currently there should be no error during runtime. One last thing, that needs to be done is transition mission validation. Now there is no measurement if transition happened. Also I cannot find way to run transition test with gazebo_standard_vtol plane.

@rligocki rligocki closed this Sep 9, 2021
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.

3 participants