Commit Graph

64 Commits

Author SHA1 Message Date
Peter Barker 462ac255a3 autotest: start MAVProxy only as needed for testing 2021-03-19 09:46:45 +11:00
Peter Barker 4aed767fe9 autotest: add test for MAV_CMD_DO_SET_MISSION_CURRENT 2021-03-04 11:59:33 +11:00
Peter Barker cc83562add autotest: tidy fence handling 2021-03-02 16:54:06 +11:00
Peter Barker 10007e2e42 autotest: load missions natively rather than using MAVProxy 2021-03-02 14:24:36 +11:00
Peter Barker 993d87469c autotest: move mission upload functions from rover to common 2021-03-02 14:24:36 +11:00
Peter Barker 0daa1a63d3 autotest: remove pointless fetch_parameters call
And the entire method, replace with equivalent test
2021-03-01 17:27:52 +11:00
Peter Barker 1f47698076 autotest: use change_mode in place of mavproxy.send 2021-03-01 13:10:09 +11:00
Peter Barker 9120882e9e autotest: print name of open dataflash log when test exception caught
The stack trace is already extremely useful... but mapping back to the
relevant dataflash log is a bit of a pain.

Adding more stuff to this method in the future might be good, too.
2021-02-21 21:35:35 +11:00
Peter Barker c13d229877 autotest: use self.set_current_waypoint rather than "wp set" to set current wp 2021-02-19 12:25:40 +11:00
Peter Barker 726f54e37f autotest: flake8 compliance for rover.py 2021-02-18 10:43:05 +11:00
Peter Barker a292fe1b8b autotest: use wait_statustext rather than mavproxy.expect
This is important when running under Valgrind as the text can be
significantly delayed.  wait_statustext times out in simulation time,
whereas mavproxy.expect has a flat 60s timeout
2021-02-17 18:16:04 +11:00
Peter Barker 1ca0998f32 Tools: take MAV_CMD_DO_SPRAYER as a mavlink command 2021-02-16 22:36:43 +11:00
Peter Barker b14dcf4bae Tools: add mission command to turn sprayer on and off 2021-02-16 22:36:43 +11:00
Pierre Kancir c02dfd1214 Autotest: add EndMissionBehavior Test for rover 2021-01-27 08:23:52 +09:00
Andrew Tridgell d47afb2406 autotest: added AHRSTrim test and add trim to accel cal test
this ensures the handling of AHRS trim is correct
2021-01-25 16:24:50 +11:00
Peter Barker ad2ab333f9 Tools: autotest: allow autotest to connect directly to SITL 2021-01-24 09:25:45 +11:00
Andrew Tridgell c396d15890 Revert "autotest: ensure defaults files don't set already-default-values"
This reverts commit 3d431cd4f1.

It breaks MissionPlanner SITL. We can re-apply once MissionPlanner
copes with external_model.
2021-01-20 08:54:43 +11:00
Peter Barker 04a52835c0 autotest: correct Rover set-position-target-global-int test
The vehicles doesn't send us set messages!
2021-01-19 21:16:39 +11:00
Peter Barker 3d431cd4f1 autotest: ensure defaults files don't set already-default-values
autotest: mark some vehicles as having external physics models

autotest: add default_params_filename to some vehicle info
2021-01-19 10:34:00 +11:00
Peter Barker cd8a393ac2 autotest: create own RC thread to handle setting of RC overrides
autotest: prevent method-on-undef problem in case of early test failure

autotest: plumb MAVProxy rc input back in for switch test

autotest: close off rc thread in case of timeout
2021-01-15 20:56:30 +11:00
Peter Barker 47aea5f44c autotest: print stack traces for caught exceptions 2021-01-13 19:46:13 +11:00
Peter Barker e85e6d3375 autotest: use new set_parameters in place of many set_parameter calls
autotest: use set_parameters for applying from parameter file

autotest: use set_parameters in place of many set_parameter calls
2021-01-13 15:09:29 +11:00
Peter Barker f478666700 autotest: correct scripting test for missing message
The message could pass us by
2021-01-13 12:24:17 +11:00
Peter Barker 2240a60e20 autotest: add trivial test for set-position-target-local-ned 2021-01-05 08:13:02 +09:00
Peter Barker 53336595e1 autotest: add simple test for Rover set_attitude_target handling 2021-01-05 08:13:02 +09:00
Peter Barker 65cffdad5a autotest: print stack traces when exceptions caught 2020-12-31 17:43:23 +11:00
Peter Barker d31f676c33 autotest: don't use MAVProxy for uploading using fencepoint protocol 2020-12-31 17:42:50 +11:00
Peter Barker 12505c4c28 autotest: add tests for new higher-channel override semantics 2020-12-29 15:03:34 +11:00
Peter Barker 0a5eedb05a autotest: wipe and reinitialise parameters when resetting SITL commandline
Should fix this scenario:
 - Plane soaring test uses different defaults file
 - soaring test sets a parameter away from default value
 - context pop sets it back to the value in the defaults file
 - it is now in permanent storage with the default found in the
different defaults file used by the soaring test
 - we finish running the soaring test an reset the SITL command line
back to default, with the old defaults file
 - we go on to running the next test.  At this point the value for that
parameter is the default in the defaults file used by the soaring test.

Something similar applies in the Callisto test.
2020-12-25 12:18:01 +11:00
Pierre Kancir 67533c3284 Autotest: add setpoint_target tests on rover 2020-12-24 00:22:52 +11:00
Pierre Kancir 7a2a60e65c Tools: rover: correct test_setting_modes_via_mavproxy_switch for RTL and AUTO 2020-12-16 17:27:07 +09:00
Pierre Kancir e4707c20ea Tools: rover: add initial_mode_switch_mode 2020-12-16 17:27:07 +09:00
Pierre Kancir 7d88d104b8 Tools: put Rover SlewRate test on disable list for now 2020-12-16 08:25:52 +11:00
Peter Barker 17f806cdb9 autotest: add test for execution of button-bound functions 2020-12-01 10:06:57 +11:00
Pierre Kancir 07ffac429b Tools: rover: add test for slew rate 2020-11-25 17:49:20 +09:00
Peter Barker 49fd762f26 autotest: fix and re-enable button test
A recent commit to fix the setting-of-pullup-resistors in SITL makes it
possible to re-enable this.

Closes #15259
2020-10-15 08:34:08 +11:00
Peter Barker 0f5f040380 autotest: send all progress messages to autopilot
These will be logged into dataflash and into the telemetry log
2020-09-09 23:47:28 +10:00
Peter Barker f3866e5f39 autotest: disable button test 2020-09-08 12:31:15 +10:00
Peter Barker cafc5b01f4 autotest: fix race condition in Rover RTL test 2020-08-30 08:38:35 +10:00
Peter Barker b7641345e1 autotest: set and get parameters directly using mavlink message 2020-08-30 08:38:35 +10:00
Pierre Kancir 5b72de25e0 Autotest: update wait_distance_to_home
Autotest: copter: allow to pass min_distance for RTL

Autotest: rover: allow to pass min distance for RTL
2020-08-29 10:44:19 +10:00
Peter Barker a190490b64 autotest: do not rely on MAVProxy for sending banner request 2020-08-24 15:26:57 +10:00
Pierre Kancir 0c3e9bbd4b Autotest: fix mavlink_time_boot format: should be int 2020-08-18 08:33:08 +10:00
Peter Barker c69908e7ea autotest: add proximity sensor readinds as if from depth camera 2020-08-17 11:20:12 +10:00
Peter Barker ea5aa594a3 autotest: add test for AP_Proximity_MAV 2020-08-17 11:20:12 +10:00
Pierre Kancir 52ae087fb5 Autotest: rover: remove some raw mavproxy cmd for rc 2020-08-15 09:16:24 +10:00
Peter Barker f0482935cc autotest: slow down simulation to avoid receiving re-request of item
# avoid a timeout race condition where ArduPilot re-requests a
        # fence point before we receive and respond to the first one.
        # Since ArduPilot has a 1s timeout on re-requesting, This only
        # requires a round-trip delay of 1/speedup seconds to trigger
        # - and that has been seen in practise on Travis

AT-0417.0: Sending item with seq=0
AT-0417.2: Got (MISSION_REQUEST {target_system : 243, target_component : 250, seq : 0, mission_type : 1})
AT-0417.2: Got (MISSION_REQUEST {target_system : 243, target_component : 250, seq : 0, mission_type : 1})
AT-0417.2: Exception caught: Traceback (most recent call last):
  File "/home/travis/build/ArduPilot/ardupilot/Tools/autotest/common.py", line 3950, in run_one_test
    test_function()
  File "/home/travis/build/ArduPilot/ardupilot/Tools/autotest/rover.py", line 4216, in test_poly_fence
    self.test_fence_upload_timeouts()
  File "/home/travis/build/ArduPilot/ardupilot/Tools/autotest/rover.py", line 4057, in test_fence_upload_timeouts
    target_component=target_component)
  File "/home/travis/build/ArduPilot/ardupilot/Tools/autotest/rover.py", line 4010, in test_fence_upload_timeouts_2
    self.expect_request_for_item(item)
  File "/home/travis/build/ArduPilot/ardupilot/Tools/autotest/rover.py", line 3958, in expect_request_for_item
    raise NotAchievedException("Expected request for seq=%u" % item.seq)
NotAchievedException: Expected request for seq=1

The "AT" timestamps there are wallclock time.  Since speedup for Rover
is 8 by default, that could be as much as 1.6 seconds meaning a
re-request from ArduPilot would be legitimate.

I've added some debug, too - we now emit "Sending item with seq=1"
between those two "Got" lines.  That should make the problem clearer -
we've received a re-request rather than a request for the item after the
one we've already sent.
2020-08-09 20:13:27 +10:00
Peter Barker b9dc7118d4 autotest: add do_timesync_roundtrip to do a timesync against SITL
On the assumption that ArduPilot processes mavlink packets
synchronously (or at least in order), after we have run a timesync
roundtrip we can reasonably expect any mavlink command we have sent
prior to the roundtrip to have been processed, and we should be able to
see the results in the mavlink stream.
2020-08-05 13:24:15 +10:00
Peter Barker f5a928ae26 autotest: remove debug to reduce CI log sizes 2020-07-24 12:39:17 +10:00
Peter Barker babb3fef54 autotest: remove incorrect use of get_sim_time_cached
These could instantly time out
2020-07-21 14:10:16 +10:00