Browse Source

SITL: enable failure command (SYS_FAILURE_EN=1)

main
Beat Küng 3 years ago
parent
commit
8bf18e31be
  1. 2
      ROMFS/px4fmu_common/init.d-posix/rcS
  2. 5
      test/mavsdk_tests/autopilot_tester.h
  3. 1
      test/mavsdk_tests/test_multicopter_failure_injection.cpp

2
ROMFS/px4fmu_common/init.d-posix/rcS

@ -154,6 +154,8 @@ param set-default SDLOG_DIRS_MAX 7 @@ -154,6 +154,8 @@ param set-default SDLOG_DIRS_MAX 7
param set-default TRIG_INTERFACE 3
param set-default SYS_FAILURE_EN 1
# Adapt timeout parameters if simulation runs faster or slower than realtime.
if [ -n "$PX4_SIM_SPEED_FACTOR" ]; then
COM_DL_LOSS_T_LONGER=$(echo "$PX4_SIM_SPEED_FACTOR * 10" | bc)

5
test/mavsdk_tests/autopilot_tester.h

@ -139,6 +139,11 @@ public: @@ -139,6 +139,11 @@ public:
// Blocking call to get the drone's current position in NED frame
std::array<float, 3> get_current_position_ned();
void set_param_int(const std::string &param, int32_t value)
{
CHECK(_param->set_param_int(param, value) == Param::Result::Success);
}
protected:
mavsdk::Param *getParams() const { return _param.get();}
mavsdk::Telemetry *getTelemetry() const { return _telemetry.get();}

1
test/mavsdk_tests/test_multicopter_failure_injection.cpp

@ -41,6 +41,7 @@ TEST_CASE("Failure Injection - Reject mid-air when it is disabled", "[multicopte @@ -41,6 +41,7 @@ TEST_CASE("Failure Injection - Reject mid-air when it is disabled", "[multicopte
AutopilotTesterFailure tester;
tester.connect(connection_url);
tester.wait_until_ready();
tester.set_param_int("SYS_FAILURE_EN", 0);
tester.arm();
tester.takeoff();
tester.wait_until_hovering();

Loading…
Cancel
Save