Test with additional frame

This commit is contained in:
Oleg Kalachev
2022-12-15 18:39:49 +03:00
parent 86ad467460
commit c004165eb0
2 changed files with 16 additions and 0 deletions

View File

@@ -139,6 +139,20 @@ def test_offboard(node, tf_buffer):
assert state.z_frame_id == 'map'
assert state.yaw_frame_id == 'map'
# set xy in test frame
res = navigate(x=1, y=2, z=nan, frame_id='test')
assert res.success == True
state = get_state()
assert state.mode == State.MODE_NAVIGATE
assert state.yaw_mode == State.YAW_MODE_YAW
assert state.x == 1
assert state.y == 2
assert state.z == 4
assert state.yaw == 0
assert state.xy_frame_id == 'test'
assert state.z_frame_id == 'map'
assert state.yaw_frame_id == 'test'
# auto_arm should invalidate the setpoint
res = navigate(x=nan, y=nan, z=1, frame_id='map', auto_arm=True)
assert res.success == True

View File

@@ -1,6 +1,8 @@
<launch>
<node name="simple_offboard" pkg="clover" type="simple_offboard" required="true" output="screen"/>
<node pkg="tf2_ros" type="static_transform_publisher" name="test_frame" args="10 20 30 0 0 0 map test"/>
<param name="test_module" value="$(find clover)/test/offboard.py"/>
<test test-name="offboard_test" pkg="ros_pytest" type="ros_pytest_runner"/>
</launch>