Browse Source
* workflows: remove unneeded pip dep and comments * mavsdk_tests: simple test using flow/offboard This adds a first proof of concept of a test using flow and offboard. * Flow MAVSDK test: check against ground truth * CleanUp * workflows: use latest docker image with psutil * mavsdk_tests: fix PEP8 issues * Add VTOL CI tests back * switch to non-rendering flow mockup * workflows: install mavsdk from GitHub release .deb * Add vision test and disable VTOL temporarlly * Fist draft of combining test coverage and test in one workflow * Add VTOL mavsdk tests back in CI Co-authored-by: Julian Oes <julian@oes.ch> Co-authored-by: kritz <kritz@ethz.ch>sbg
Lorenz Meier
5 years ago
committed by
GitHub
7 changed files with 209 additions and 69 deletions
@ -1,52 +0,0 @@
@@ -1,52 +0,0 @@
|
||||
name: SITL Tests (Code Coverage) |
||||
|
||||
on: |
||||
push: |
||||
branches: |
||||
- 'master' |
||||
pull_request: |
||||
branches: |
||||
- '*' |
||||
|
||||
jobs: |
||||
build: |
||||
runs-on: ubuntu-latest |
||||
container: px4io/px4-dev-simulation-bionic:2020-01-13 |
||||
steps: |
||||
- uses: actions/checkout@v1 |
||||
with: |
||||
token: ${{ secrets.ACCESS_TOKEN }} |
||||
# see https://github.com/actions/checkout/issues/14 |
||||
- name: disable the keychain credential helper |
||||
run: git config --global credential.helper "" |
||||
- name: enable the local store credential helper |
||||
run: git config --global --add credential.helper store |
||||
- name: add credential |
||||
run: echo "https://x-access-token:${{ secrets.ACCESS_TOKEN }}@github.com" >> ~/.git-credentials |
||||
- name: tell git to use https instead of ssh whenever it encounters it |
||||
run: 'git config --global url."https://github.com/".insteadof git@github.com:' |
||||
- name: get submodules |
||||
run: 'git submodule update --init --recursive' |
||||
- name: Set Python 3 as default |
||||
run: update-alternatives --install /usr/bin/python python /usr/bin/python3 10 |
||||
- name: Install psutil |
||||
run: pip3 install psutil |
||||
# - name: Download newer mavsdk |
||||
# run: git clone https://github.com/mavlink/MAVSDK.git && cd MAVSDK && git submodule init && git submodule update && mkdir -p build/default |
||||
# - name: Build newer mavsdk |
||||
# run: mkdir -p MAVSDK/build/default && cd MAVSDK/build/default && cmake ../.. && make -j4 && make install |
||||
- name: Run Coverage Tests |
||||
run: make tests_integration_coverage |
||||
# We are not actively using coveralls, but we keep the config |
||||
# in case the service should be re-enabled later |
||||
# - name: Upload coverage information to Coveralls |
||||
# uses: coverallsapp/github-action@master |
||||
# with: |
||||
# path-to-lcov: coverage/lcov.info |
||||
# github-token: ${{ secrets.GITHUB_TOKEN }} |
||||
- name: Upload coverage information to Codecov |
||||
uses: codecov/codecov-action@v1 |
||||
with: |
||||
token: ${{ secrets.CODECOV_TOKEN }} |
||||
flags: mavsdk |
||||
file: coverage/lcov.info |
@ -0,0 +1,49 @@
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// Multicopter mission test.
|
||||
//
|
||||
// Author: Julian Oes <julian@oes.ch>
|
||||
|
||||
#include <mavsdk/mavsdk.h> |
||||
#include <mavsdk/plugins/action/action.h> |
||||
#include <mavsdk/plugins/telemetry/telemetry.h> |
||||
#include <iostream> |
||||
#include <string> |
||||
#include "autopilot_tester.h" |
||||
|
||||
|
||||
TEST_CASE("Takeoff and Land (Multicopter offboard)", "[multicopter_offboard]") |
||||
{ |
||||
AutopilotTester tester; |
||||
Offboard::PositionNEDYaw takeoff_position {0.0f, 0.0f, -2.0f, 0.0f}; |
||||
tester.connect(connection_url); |
||||
tester.wait_until_ready_local_position_only(); |
||||
tester.request_ground_truth(); |
||||
Telemetry::GroundTruth home = tester.get_ground_truth_position(); |
||||
tester.arm(); |
||||
tester.offboard_goto(takeoff_position, 0.5f); |
||||
tester.offboard_land(); |
||||
tester.wait_until_disarmed(); |
||||
REQUIRE(tester.ground_truth_horizontal_position_close_to(home, 0.5f)); |
||||
} |
||||
|
||||
TEST_CASE("Mission (Multicopter offboard )", "[multicopter_offboard]") |
||||
{ |
||||
AutopilotTester tester; |
||||
Offboard::PositionNEDYaw takeoff_position {0.0f, 0.0f, -2.0f, 0.0f}; |
||||
Offboard::PositionNEDYaw setpoint_1 {0.0f, 5.0f, -2.0f, 180.0f}; |
||||
Offboard::PositionNEDYaw setpoint_2 {5.0f, 5.0f, -4.0f, 180.0f}; |
||||
Offboard::PositionNEDYaw setpoint_3 {5.0f, 0.0f, -4.0f, 90.0f}; |
||||
tester.connect(connection_url); |
||||
tester.wait_until_ready_local_position_only(); |
||||
tester.request_ground_truth(); |
||||
Telemetry::GroundTruth home = tester.get_ground_truth_position(); |
||||
tester.arm(); |
||||
tester.offboard_goto(takeoff_position, 0.5f); |
||||
tester.offboard_goto(setpoint_1, 1.0f); |
||||
tester.offboard_goto(setpoint_2, 1.0f); |
||||
tester.offboard_goto(setpoint_3, 1.0f); |
||||
tester.offboard_goto(takeoff_position, 0.2f); |
||||
tester.offboard_land(); |
||||
tester.wait_until_disarmed(); |
||||
REQUIRE(tester.ground_truth_horizontal_position_close_to(home, 1.0f)); |
||||
} |
Loading…
Reference in new issue