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

integration_tests: add checks to takeoff/land test #98

Closed
wants to merge 7 commits into from

Conversation

julianoes
Copy link
Collaborator

@julianoes julianoes commented Sep 26, 2017

This adds some checks to the ActionSimpleHover tests to actually check
what PX4 SITL is executing rather than just checking if we get the
correct responses.

This could be an example for CI tests for PX4 using DroneCore.

@dagar have a look

To test this:

  • Start PX4 SITL
  • Then start the test:
    make && build/default/integration_tests_runner --gtest_filter="SitlTest.ActionSimpleHover*"
    

Or if you have Firmware and DroneCore next to each other in a folder:

make && AUTOSTART_SITL=1 build/default/integration_tests_runner --gtest_filter="SitlTest.ActionSimpleHover*"


Device &device = dc.device();

while (!device.telemetry().health_all_ok()) {
for (int i = 0; ; ++i) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just FMI, why not a while loop? Seem odd to see an infinite for loop :-)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ignore that, I see you want to count out 10 seconds.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yer it's a bit ugly but I haven't found a prettier way yet.

An alternative is to use the async interface and then do a wait_for on the promise.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not prettier, but perhaps a little more intuitive

int itter=0;
while (!device.telemetry().health_all_ok()) {
   std::cout << "waiting for device to be ready" << std::endl;
   std::this_thread::sleep_for(std::chrono::seconds(1));
   ASSERT_LT(++itter, 10);
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yer, you're right. That's nicer. I'll change it.

hamishwillee and others added 7 commits September 27, 2017 10:16
Old debug info text had typo ("success, not "sucess") but in any case was not useful because there was no information about the context of the success.
This adds a sync interface for the connection status of a device. It is
basically the same information as also covered by the async methods
on_discover and on_timeout.
This adds some checks to the ActionSimpleHover tests to actually check
what PX4 SITL is executing rather than just checking if we get the
correct responses.

This could be an example for CI tests for PX4 using DroneCore.
@julianoes
Copy link
Collaborator Author

Replaced by #110.

@julianoes julianoes closed this Sep 29, 2017
@julianoes julianoes deleted the sitl-test branch September 29, 2017 13:40
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.

2 participants