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

Add custom action plugin #1581

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion proto
6 changes: 6 additions & 0 deletions src/integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Required for custom_action plugin testing
find_package(Python3 COMPONENTS Interpreter)

# SYSTEM because we don't want warnings for gtest headers.
include_directories(
SYSTEM ${PROJECT_SOURCE_DIR}/third_party/gtest/googletest/include
Expand Down Expand Up @@ -38,6 +41,8 @@ add_executable(integration_tests_runner
camera_format.cpp
camera_test_helpers.cpp
connection.cpp
custom_action.cpp
custom_action_mission.cpp
follow_me.cpp
geofence_inclusion.cpp
gimbal.cpp
Expand Down Expand Up @@ -82,6 +87,7 @@ target_link_libraries(integration_tests_runner
mavsdk
mavsdk_telemetry
mavsdk_action
mavsdk_custom_action
mavsdk_mission
mavsdk_mission_raw
mavsdk_offboard
Expand Down
8 changes: 6 additions & 2 deletions src/integration_tests/action_goto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ TEST_F(SitlTest, ActionGoto)
ASSERT_LT(++iteration, 10);
}

// Get the home position so the Go To items are set with respect
// to the home position instead of being hardcoded.
auto home = telemetry->home();

auto action = std::make_shared<Action>(system);
Action::Result action_ret = action->arm();
EXPECT_EQ(action_ret, Action::Result::Success);
Expand All @@ -49,11 +53,11 @@ TEST_F(SitlTest, ActionGoto)
std::this_thread::sleep_for(std::chrono::seconds(2));

// Go somewhere
action->goto_location(47.398000, 8.545592, NAN, NAN);
action->goto_location(home.latitude_deg + 0.0002493, home.longitude_deg - 0.0000154, NAN, NAN);
std::this_thread::sleep_for(std::chrono::seconds(10));

// And back
action->goto_location(47.3977233, 8.545592, NAN, NAN);
action->goto_location(home.latitude_deg, home.longitude_deg, NAN, NAN);
std::this_thread::sleep_for(std::chrono::seconds(10));

action_ret = action->land();
Expand Down
Loading