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

gimbal: implement angular rate setpoints #1308

Merged
merged 3 commits into from
Feb 4, 2021
Merged
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
23 changes: 20 additions & 3 deletions src/integration_tests/gimbal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ void send_gimbal_roi_location(
void receive_gimbal_result(Gimbal::Result result);
void receive_gimbal_attitude_euler_angles(Telemetry::EulerAngle euler_angle);

// Note, this test does not work in SITL because the gimbal does not move
// unless it is armed.
TEST(SitlTestGimbal, GimbalMove)
{
Mavsdk mavsdk;
Expand All @@ -48,7 +46,26 @@ TEST(SitlTestGimbal, GimbalMove)

EXPECT_EQ(gimbal->set_mode(Gimbal::GimbalMode::YawFollow), Gimbal::Result::Success);

gimbal_pattern(gimbal);
LogInfo() << "Pitch down for a bit";
EXPECT_EQ(gimbal->set_pitch_rate_and_yaw_rate(-10.0f, 0.0f), Gimbal::Result::Success);
std::this_thread::sleep_for(std::chrono::seconds(2));

LogInfo() << "Pitch up for a bit";
EXPECT_EQ(gimbal->set_pitch_rate_and_yaw_rate(10.0f, 0.0f), Gimbal::Result::Success);
std::this_thread::sleep_for(std::chrono::seconds(2));

LogInfo() << "Yaw right for a bit";
EXPECT_EQ(gimbal->set_pitch_rate_and_yaw_rate(0.0f, 10.0f), Gimbal::Result::Success);
std::this_thread::sleep_for(std::chrono::seconds(2));

LogInfo() << "Yaw left for a bit";
EXPECT_EQ(gimbal->set_pitch_rate_and_yaw_rate(0.0f, -10.0f), Gimbal::Result::Success);
std::this_thread::sleep_for(std::chrono::seconds(2));

LogInfo() << "Reset back to 0,0";
EXPECT_EQ(gimbal->set_pitch_and_yaw(0.0f, 0.0f), Gimbal::Result::Success);

std::this_thread::sleep_for(std::chrono::seconds(1));
}

TEST(SitlTestGimbal, GimbalAngles)
Expand Down
48 changes: 45 additions & 3 deletions src/mavsdk_server/src/generated/gimbal/gimbal.grpc.pb.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading