From 6a0753b1d2b397980f32831a30ac3ffb5e44b6db Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Thu, 8 Dec 2022 08:15:59 +0300 Subject: [PATCH] Basic test for set_attitude --- clover/test/offboard.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/clover/test/offboard.py b/clover/test/offboard.py index dcb687ad..10e2d785 100755 --- a/clover/test/offboard.py +++ b/clover/test/offboard.py @@ -82,3 +82,14 @@ def test_offboard(node): assert state.xy_frame_id == 'map' assert state.z_frame_id == 'map' assert state.yaw_frame_id == 'map' + + # test set_attitude + res = set_attitude(roll=0.1, pitch=0.2, yaw=0.3, thrust=0.5) + assert res.success == True + state = get_state() + assert state.mode == State.MODE_ATTITUDE + assert state.yaw_mode == State.YAW_MODE_YAW + assert state.roll == approx(0.1) + assert state.pitch == approx(0.2) + assert state.yaw == approx(0.3) + assert state.thrust == approx(0.5)