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

fix examples to work with 0.34.0 #1250

Merged
merged 2 commits into from
Nov 5, 2020

Conversation

yashomdighe
Copy link
Contributor

@yashomdighe yashomdighe commented Nov 5, 2020

In examples/fly_multiple_drones/fly_multiple_drones.cpp and examples/multiple_drones/multiple_drones.cpp
if (systems.size() < num_systems_discovered) should be if (systems.size() > num_systems_discovered) otherwise
if (num_systems_discovered != total_ports_used) is always evaluated true and code aborts.

    for (auto system : mavsdk.systems()) {
        std::thread t(&takeoff_and_land, std::ref(system));
        threads.push_back(std::move(t));
        sleep_for(seconds(1));
    }

If there is no time interval between thread creation it seems that the first vehicle rejects the initial command sent to it and the thread aborts resulting in only one vehicle executing the example.

In examples/takeoff_land/takeoff_and_land.cpp access vehicle after discovering it.

In examples/follow_me/follow_me.cpp target location is incorrectly reported as vehicle location. Fixed that and added a reporting vehicle location using telemetry

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.

Thanks! CI is failing because of the style check. Mind running ./tools/fix_style.sh .? 😊

@yashomdighe
Copy link
Contributor Author

Thanks! CI is failing because of the style check. Mind running ./tools/fix_style.sh .? 😊

I just tried that. Brew only lets me install clang-format-11/8 and the docker has 9 while MAVSDK wants 10. How do I get around this?

@JonasVautherin JonasVautherin merged commit 60d23a1 into mavlink:develop Nov 5, 2020
@yashomdighe yashomdighe deleted the fix_examples branch November 5, 2020 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants