diff --git a/.ci/Jenkinsfile-hardware b/.ci/Jenkinsfile-hardware index 5c4c0c9b7e..2e0450affb 100644 --- a/.ci/Jenkinsfile-hardware +++ b/.ci/Jenkinsfile-hardware @@ -917,7 +917,6 @@ void printTopics() { sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "listener system_power" || true' sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "listener task_stack_info" || true' sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "listener telemetry_status" || true' - sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "listener test_motor" || true' sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "listener trajectory_setpoint" || true' sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "listener tune_control" || true' sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "listener vehicle_acceleration" || true' diff --git a/boards/airmind/mindpx-v2/default.px4board b/boards/airmind/mindpx-v2/default.px4board index 57b202a3ea..9f8e046e95 100644 --- a/boards/airmind/mindpx-v2/default.px4board +++ b/boards/airmind/mindpx-v2/default.px4board @@ -84,7 +84,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/atl/mantis-edu/default.px4board b/boards/atl/mantis-edu/default.px4board index 514d8c2366..56c6edb520 100644 --- a/boards/atl/mantis-edu/default.px4board +++ b/boards/atl/mantis-edu/default.px4board @@ -38,7 +38,6 @@ CONFIG_SYSTEMCMDS_DMESG=y CONFIG_SYSTEMCMDS_DUMPFILE=y CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y CONFIG_SYSTEMCMDS_REBOOT=y diff --git a/boards/av/x-v1/default.px4board b/boards/av/x-v1/default.px4board index 0665aa8b06..07145b2da0 100644 --- a/boards/av/x-v1/default.px4board +++ b/boards/av/x-v1/default.px4board @@ -81,7 +81,6 @@ CONFIG_SYSTEMCMDS_GPIO=y CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_NETMAN=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/beaglebone/blue/default.px4board b/boards/beaglebone/blue/default.px4board index 5a16050b54..2402af9720 100644 --- a/boards/beaglebone/blue/default.px4board +++ b/boards/beaglebone/blue/default.px4board @@ -60,7 +60,6 @@ CONFIG_MODULES_GIMBAL=y CONFIG_MODULES_VTOL_ATT_CONTROL=y CONFIG_SYSTEMCMDS_DYN=y CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/cuav/nora/default.px4board b/boards/cuav/nora/default.px4board index d37ee80107..dcadb3dcdc 100644 --- a/boards/cuav/nora/default.px4board +++ b/boards/cuav/nora/default.px4board @@ -87,7 +87,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/cuav/x7pro/default.px4board b/boards/cuav/x7pro/default.px4board index e2d2002b1f..4fbd38af3e 100644 --- a/boards/cuav/x7pro/default.px4board +++ b/boards/cuav/x7pro/default.px4board @@ -88,7 +88,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/cubepilot/cubeorange/default.px4board b/boards/cubepilot/cubeorange/default.px4board index 8671d375d6..cd635858f9 100644 --- a/boards/cubepilot/cubeorange/default.px4board +++ b/boards/cubepilot/cubeorange/default.px4board @@ -82,7 +82,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/cubepilot/cubeyellow/default.px4board b/boards/cubepilot/cubeyellow/default.px4board index a42ef27c38..7cb000376e 100644 --- a/boards/cubepilot/cubeyellow/default.px4board +++ b/boards/cubepilot/cubeyellow/default.px4board @@ -85,7 +85,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/emlid/navio2/default.px4board b/boards/emlid/navio2/default.px4board index ecd456c352..52144cb2ce 100644 --- a/boards/emlid/navio2/default.px4board +++ b/boards/emlid/navio2/default.px4board @@ -62,7 +62,6 @@ CONFIG_MODULES_GIMBAL=y CONFIG_MODULES_VTOL_ATT_CONTROL=y CONFIG_SYSTEMCMDS_DYN=y CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/holybro/durandal-v1/default.px4board b/boards/holybro/durandal-v1/default.px4board index 227a57e913..fa19e9072e 100644 --- a/boards/holybro/durandal-v1/default.px4board +++ b/boards/holybro/durandal-v1/default.px4board @@ -80,7 +80,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/holybro/kakuteh7/default.px4board b/boards/holybro/kakuteh7/default.px4board index c1e3ace14c..9039d60130 100644 --- a/boards/holybro/kakuteh7/default.px4board +++ b/boards/holybro/kakuteh7/default.px4board @@ -74,7 +74,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y diff --git a/boards/holybro/pix32v5/default.px4board b/boards/holybro/pix32v5/default.px4board index 7b007055f5..269152e92f 100644 --- a/boards/holybro/pix32v5/default.px4board +++ b/boards/holybro/pix32v5/default.px4board @@ -90,7 +90,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/modalai/fc-v1/default.px4board b/boards/modalai/fc-v1/default.px4board index 16f863844e..21b73b2671 100644 --- a/boards/modalai/fc-v1/default.px4board +++ b/boards/modalai/fc-v1/default.px4board @@ -86,7 +86,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/modalai/fc-v2/default.px4board b/boards/modalai/fc-v2/default.px4board index 164fc9fbcf..0fe97f5591 100644 --- a/boards/modalai/fc-v2/default.px4board +++ b/boards/modalai/fc-v2/default.px4board @@ -81,7 +81,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/mro/ctrl-zero-classic/default.px4board b/boards/mro/ctrl-zero-classic/default.px4board index 5da6d75bf0..3973f9958d 100644 --- a/boards/mro/ctrl-zero-classic/default.px4board +++ b/boards/mro/ctrl-zero-classic/default.px4board @@ -82,7 +82,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/mro/ctrl-zero-f7-oem/default.px4board b/boards/mro/ctrl-zero-f7-oem/default.px4board index 815b3903cf..65f344836b 100644 --- a/boards/mro/ctrl-zero-f7-oem/default.px4board +++ b/boards/mro/ctrl-zero-f7-oem/default.px4board @@ -83,7 +83,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/mro/ctrl-zero-f7/default.px4board b/boards/mro/ctrl-zero-f7/default.px4board index 5e0733f474..411a6b7b58 100644 --- a/boards/mro/ctrl-zero-f7/default.px4board +++ b/boards/mro/ctrl-zero-f7/default.px4board @@ -83,7 +83,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/mro/ctrl-zero-h7-oem/default.px4board b/boards/mro/ctrl-zero-h7-oem/default.px4board index 5da6d75bf0..3973f9958d 100644 --- a/boards/mro/ctrl-zero-h7-oem/default.px4board +++ b/boards/mro/ctrl-zero-h7-oem/default.px4board @@ -82,7 +82,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/mro/ctrl-zero-h7/default.px4board b/boards/mro/ctrl-zero-h7/default.px4board index a80c4608b5..5641eb1e50 100644 --- a/boards/mro/ctrl-zero-h7/default.px4board +++ b/boards/mro/ctrl-zero-h7/default.px4board @@ -83,7 +83,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/mro/pixracerpro/default.px4board b/boards/mro/pixracerpro/default.px4board index 9eb74db5fe..f290bb2dd4 100644 --- a/boards/mro/pixracerpro/default.px4board +++ b/boards/mro/pixracerpro/default.px4board @@ -82,7 +82,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/mro/x21-777/default.px4board b/boards/mro/x21-777/default.px4board index a4fdf02fc0..d94ac1a131 100644 --- a/boards/mro/x21-777/default.px4board +++ b/boards/mro/x21-777/default.px4board @@ -84,7 +84,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/mro/x21/default.px4board b/boards/mro/x21/default.px4board index 95fa5e3b05..beeb786225 100644 --- a/boards/mro/x21/default.px4board +++ b/boards/mro/x21/default.px4board @@ -84,7 +84,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/nxp/fmuk66-e/default.px4board b/boards/nxp/fmuk66-e/default.px4board index 575deb5601..b24af86d0c 100644 --- a/boards/nxp/fmuk66-e/default.px4board +++ b/boards/nxp/fmuk66-e/default.px4board @@ -78,7 +78,6 @@ CONFIG_SYSTEMCMDS_DUMPFILE=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/nxp/fmuk66-v3/default.px4board b/boards/nxp/fmuk66-v3/default.px4board index 417bc2ba8b..27101b7e37 100644 --- a/boards/nxp/fmuk66-v3/default.px4board +++ b/boards/nxp/fmuk66-v3/default.px4board @@ -83,7 +83,6 @@ CONFIG_SYSTEMCMDS_DUMPFILE=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/nxp/fmurt1062-v1/default.px4board b/boards/nxp/fmurt1062-v1/default.px4board index 5c82e73ea3..18e4b227d8 100644 --- a/boards/nxp/fmurt1062-v1/default.px4board +++ b/boards/nxp/fmurt1062-v1/default.px4board @@ -55,7 +55,6 @@ CONFIG_SYSTEMCMDS_DUMPFILE=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/px4/fmu-v3/default.px4board b/boards/px4/fmu-v3/default.px4board index 3786cea4a1..ce45aeeb4d 100644 --- a/boards/px4/fmu-v3/default.px4board +++ b/boards/px4/fmu-v3/default.px4board @@ -87,7 +87,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/px4/fmu-v4/default.px4board b/boards/px4/fmu-v4/default.px4board index 5de0f6f91c..547fbb636a 100644 --- a/boards/px4/fmu-v4/default.px4board +++ b/boards/px4/fmu-v4/default.px4board @@ -88,7 +88,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/px4/fmu-v4pro/default.px4board b/boards/px4/fmu-v4pro/default.px4board index e3944b69a5..606a268dc7 100644 --- a/boards/px4/fmu-v4pro/default.px4board +++ b/boards/px4/fmu-v4pro/default.px4board @@ -85,7 +85,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/px4/fmu-v5/default.px4board b/boards/px4/fmu-v5/default.px4board index 8eaf2bcd00..1fd07821af 100644 --- a/boards/px4/fmu-v5/default.px4board +++ b/boards/px4/fmu-v5/default.px4board @@ -91,7 +91,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/px4/fmu-v5x/default.px4board b/boards/px4/fmu-v5x/default.px4board index 51205b6bfa..7447404a5a 100644 --- a/boards/px4/fmu-v5x/default.px4board +++ b/boards/px4/fmu-v5x/default.px4board @@ -93,7 +93,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NETMAN=y CONFIG_SYSTEMCMDS_NSHTERM=y diff --git a/boards/px4/fmu-v6c/default.px4board b/boards/px4/fmu-v6c/default.px4board index 6e0d2ef9a2..9f550cf3c0 100644 --- a/boards/px4/fmu-v6c/default.px4board +++ b/boards/px4/fmu-v6c/default.px4board @@ -72,7 +72,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/px4/fmu-v6u/default.px4board b/boards/px4/fmu-v6u/default.px4board index 5d02c8c249..f3f61597db 100644 --- a/boards/px4/fmu-v6u/default.px4board +++ b/boards/px4/fmu-v6u/default.px4board @@ -83,7 +83,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/boards/px4/fmu-v6x/default.px4board b/boards/px4/fmu-v6x/default.px4board index 3d16e4505e..0e6e697ee3 100644 --- a/boards/px4/fmu-v6x/default.px4board +++ b/boards/px4/fmu-v6x/default.px4board @@ -78,7 +78,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NETMAN=y CONFIG_SYSTEMCMDS_NSHTERM=y diff --git a/boards/px4/raspberrypi/default.px4board b/boards/px4/raspberrypi/default.px4board index 1b266a0550..22755b17ff 100644 --- a/boards/px4/raspberrypi/default.px4board +++ b/boards/px4/raspberrypi/default.px4board @@ -59,7 +59,6 @@ CONFIG_MODULES_GIMBAL=y CONFIG_MODULES_VTOL_ATT_CONTROL=y CONFIG_SYSTEMCMDS_DYN=y CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/px4/sitl/default.px4board b/boards/px4/sitl/default.px4board index 6c10810f53..70b7fe34bf 100644 --- a/boards/px4/sitl/default.px4board +++ b/boards/px4/sitl/default.px4board @@ -48,7 +48,6 @@ CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y CONFIG_SYSTEMCMDS_DYN=y CONFIG_SYSTEMCMDS_FAILURE=y CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y CONFIG_SYSTEMCMDS_SD_BENCH=y diff --git a/boards/raspberrypi/pico/default.px4board b/boards/raspberrypi/pico/default.px4board index 3fda4b16f8..a9e96e815f 100644 --- a/boards/raspberrypi/pico/default.px4board +++ b/boards/raspberrypi/pico/default.px4board @@ -37,7 +37,6 @@ CONFIG_SYSTEMCMDS_DMESG=y CONFIG_SYSTEMCMDS_DUMPFILE=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y diff --git a/boards/sky-drones/smartap-airlink/default.px4board b/boards/sky-drones/smartap-airlink/default.px4board index 164884a010..128fe9a709 100644 --- a/boards/sky-drones/smartap-airlink/default.px4board +++ b/boards/sky-drones/smartap-airlink/default.px4board @@ -85,7 +85,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NETMAN=y CONFIG_SYSTEMCMDS_NSHTERM=y diff --git a/boards/spracing/h7extreme/default.px4board b/boards/spracing/h7extreme/default.px4board index d0286f373e..34fbe07a3b 100644 --- a/boards/spracing/h7extreme/default.px4board +++ b/boards/spracing/h7extreme/default.px4board @@ -47,7 +47,6 @@ CONFIG_SYSTEMCMDS_DUMPFILE=y CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y CONFIG_SYSTEMCMDS_PERF=y diff --git a/boards/uvify/core/default.px4board b/boards/uvify/core/default.px4board index 7dc5db41a9..f52451ae4a 100644 --- a/boards/uvify/core/default.px4board +++ b/boards/uvify/core/default.px4board @@ -69,7 +69,6 @@ CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y CONFIG_SYSTEMCMDS_I2CDETECT=y CONFIG_SYSTEMCMDS_LED_CONTROL=y CONFIG_SYSTEMCMDS_MFT=y -CONFIG_SYSTEMCMDS_MOTOR_TEST=y CONFIG_SYSTEMCMDS_MTD=y CONFIG_SYSTEMCMDS_NSHTERM=y CONFIG_SYSTEMCMDS_PARAM=y diff --git a/msg/CMakeLists.txt b/msg/CMakeLists.txt index 8b10457b95..8ad5e81dbd 100644 --- a/msg/CMakeLists.txt +++ b/msg/CMakeLists.txt @@ -165,7 +165,6 @@ set(msg_files task_stack_info.msg tecs_status.msg telemetry_status.msg - test_motor.msg timesync.msg timesync_status.msg trajectory_bezier.msg diff --git a/msg/test_motor.msg b/msg/test_motor.msg deleted file mode 100644 index 2dc6174996..0000000000 --- a/msg/test_motor.msg +++ /dev/null @@ -1,14 +0,0 @@ -uint64 timestamp # time since system start (microseconds) -uint8 NUM_MOTOR_OUTPUTS = 8 - -uint8 ACTION_STOP = 0 # stop all motors (disable motor test mode) -uint8 ACTION_RUN = 1 # run motor(s) (enable motor test mode) - -uint8 action # one of ACTION_* (applies to all motors) -uint32 motor_number # number of motor to spin [0..N-1] -float32 value # output power, range [0..1], -1 to stop individual motor -uint32 timeout_ms # timeout in ms after which to exit test mode (if 0, do not time out) - -uint8 driver_instance # select output driver (for boards with multiple outputs, like IO+FMU) - -uint8 ORB_QUEUE_LENGTH = 4 diff --git a/src/lib/mixer_module/mixer_module.cpp b/src/lib/mixer_module/mixer_module.cpp index e6fd6e41e5..49d37d50f4 100644 --- a/src/lib/mixer_module/mixer_module.cpp +++ b/src/lib/mixer_module/mixer_module.cpp @@ -401,68 +401,6 @@ void MixingOutput::unregister() } } -unsigned MixingOutput::motorTest() -{ - test_motor_s test_motor; - bool had_update = false; - - while (_motor_test.test_motor_sub.update(&test_motor)) { - if (test_motor.driver_instance != 0 || - test_motor.timestamp == 0 || - hrt_elapsed_time(&test_motor.timestamp) > 100_ms) { - continue; - } - - bool in_test_mode = test_motor.action == test_motor_s::ACTION_RUN; - - if (in_test_mode != _motor_test.in_test_mode) { - // reset all outputs to disarmed on state change - for (int i = 0; i < MAX_ACTUATORS; ++i) { - _current_output_value[i] = _disarmed_value[i]; - } - } - - if (in_test_mode) { - int idx = test_motor.motor_number; - - if (idx < MAX_ACTUATORS) { - if (test_motor.value < 0.f) { - _current_output_value[idx] = _disarmed_value[idx]; - - } else { - _current_output_value[idx] = - math::constrain(_min_value[idx] + (uint16_t)((_max_value[idx] - _min_value[idx]) * test_motor.value), - _min_value[idx], _max_value[idx]); - } - } - - if (test_motor.timeout_ms > 0) { - _motor_test.timeout = test_motor.timestamp + test_motor.timeout_ms * 1000; - - } else { - _motor_test.timeout = 0; - } - } - - _motor_test.in_test_mode = in_test_mode; - had_update = true; - } - - // check for timeouts - if (_motor_test.timeout != 0 && hrt_absolute_time() > _motor_test.timeout) { - _motor_test.in_test_mode = false; - _motor_test.timeout = 0; - - for (int i = 0; i < MAX_ACTUATORS; ++i) { - _current_output_value[i] = _disarmed_value[i]; - } - - had_update = true; - } - - return (_motor_test.in_test_mode || had_update) ? _max_num_outputs : 0; -} - bool MixingOutput::update() { // check arming state diff --git a/src/lib/mixer_module/mixer_module.hpp b/src/lib/mixer_module/mixer_module.hpp index 0f642d3bdd..1e84003374 100644 --- a/src/lib/mixer_module/mixer_module.hpp +++ b/src/lib/mixer_module/mixer_module.hpp @@ -58,7 +58,6 @@ #include #include #include -#include using namespace time_literals; @@ -213,8 +212,6 @@ private: return (_armed.prearmed && !_armed.armed) || _armed.in_esc_calibration_mode; } - unsigned motorTest(); - void setAndPublishActuatorOutputs(unsigned num_outputs, actuator_outputs_s &actuator_outputs); void publishMixerStatus(const actuator_outputs_s &actuator_outputs); void updateLatencyPerfCounter(const actuator_outputs_s &actuator_outputs); @@ -276,13 +273,6 @@ private: bool _wq_switched{false}; uint8_t _max_num_outputs; - struct MotorTest { - uORB::Subscription test_motor_sub{ORB_ID(test_motor)}; - bool in_test_mode{false}; - hrt_abstime timeout{0}; - }; - MotorTest _motor_test; - OutputModuleInterface &_interface; perf_counter_t _control_latency_perf; diff --git a/src/modules/commander/Commander.cpp b/src/modules/commander/Commander.cpp index a6e92fb567..1adec0521b 100644 --- a/src/modules/commander/Commander.cpp +++ b/src/modules/commander/Commander.cpp @@ -1228,10 +1228,6 @@ Commander::handle_command(const vehicle_command_s &cmd) break; - case vehicle_command_s::VEHICLE_CMD_DO_MOTOR_TEST: - cmd_result = handle_command_motor_test(cmd); - break; - case vehicle_command_s::VEHICLE_CMD_ACTUATOR_TEST: cmd_result = handle_command_actuator_test(cmd); break; @@ -1538,54 +1534,6 @@ Commander::handle_command(const vehicle_command_s &cmd) return true; } -unsigned -Commander::handle_command_motor_test(const vehicle_command_s &cmd) -{ - if (_arm_state_machine.isArmed() || (_safety.isButtonAvailable() && !_safety.isSafetyOff())) { - return vehicle_command_ack_s::VEHICLE_CMD_RESULT_DENIED; - } - - if (_param_com_mot_test_en.get() != 1) { - return vehicle_command_ack_s::VEHICLE_CMD_RESULT_DENIED; - } - - test_motor_s test_motor{}; - test_motor.timestamp = hrt_absolute_time(); - test_motor.motor_number = (int)(cmd.param1 + 0.5f) - 1; - - int throttle_type = (int)(cmd.param2 + 0.5f); - - if (throttle_type != 0) { // 0: MOTOR_TEST_THROTTLE_PERCENT - return vehicle_command_ack_s::VEHICLE_CMD_RESULT_UNSUPPORTED; - } - - int motor_count = (int)(cmd.param5 + 0.5); - - if (motor_count > 1) { - return vehicle_command_ack_s::VEHICLE_CMD_RESULT_UNSUPPORTED; - } - - test_motor.action = test_motor_s::ACTION_RUN; - test_motor.value = math::constrain(cmd.param3 / 100.f, 0.f, 1.f); - - if (test_motor.value < FLT_EPSILON) { - // the message spec is not clear on whether 0 means stop, but it should be closer to what a user expects - test_motor.value = -1.f; - } - - test_motor.timeout_ms = (int)(cmd.param4 * 1000.f + 0.5f); - - // enforce a timeout and a maximum limit - if (test_motor.timeout_ms == 0 || test_motor.timeout_ms > 3000) { - test_motor.timeout_ms = 3000; - } - - test_motor.driver_instance = 0; // the mavlink command does not allow to specify the instance, so set to 0 for now - _test_motor_pub.publish(test_motor); - - return vehicle_command_ack_s::VEHICLE_CMD_RESULT_ACCEPTED; -} - unsigned Commander::handle_command_actuator_test(const vehicle_command_s &cmd) { diff --git a/src/modules/commander/Commander.hpp b/src/modules/commander/Commander.hpp index 0b0e715dea..78fa26971c 100644 --- a/src/modules/commander/Commander.hpp +++ b/src/modules/commander/Commander.hpp @@ -54,7 +54,6 @@ #include #include #include -#include #include #include #include @@ -147,7 +146,6 @@ private: */ bool handle_command(const vehicle_command_s &cmd); - unsigned handle_command_motor_test(const vehicle_command_s &cmd); unsigned handle_command_actuator_test(const vehicle_command_s &cmd); void executeActionRequest(const action_request_s &action_request); @@ -380,7 +378,6 @@ private: uORB::Publication _actuator_armed_pub{ORB_ID(actuator_armed)}; uORB::Publication _commander_state_pub{ORB_ID(commander_state)}; uORB::Publication _failure_detector_status_pub{ORB_ID(failure_detector_status)}; - uORB::Publication _test_motor_pub{ORB_ID(test_motor)}; uORB::Publication _actuator_test_pub{ORB_ID(actuator_test)}; uORB::Publication _vehicle_control_mode_pub{ORB_ID(vehicle_control_mode)}; uORB::Publication _vehicle_status_flags_pub{ORB_ID(vehicle_status_flags)}; diff --git a/src/modules/logger/logged_topics.cpp b/src/modules/logger/logged_topics.cpp index cb6cbad299..ca02b74aff 100644 --- a/src/modules/logger/logged_topics.cpp +++ b/src/modules/logger/logged_topics.cpp @@ -315,7 +315,7 @@ void LoggedTopics::add_debug_topics() add_topic_multi("satellite_info", 1000, 2); add_topic("mag_worker_data"); add_topic("sensor_preflight_mag", 500); - add_topic("test_motor", 500); + add_topic("actuator_test", 500); } void LoggedTopics::add_estimator_replay_topics() diff --git a/src/systemcmds/motor_test/CMakeLists.txt b/src/systemcmds/motor_test/CMakeLists.txt deleted file mode 100644 index d2937e6a01..0000000000 --- a/src/systemcmds/motor_test/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -############################################################################ -# -# Copyright (c) 2015 PX4 Development Team. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name PX4 nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################ -px4_add_module( - MODULE systemcmds__motor_test - MAIN motor_test - STACK_MAIN 4096 - COMPILE_FLAGS - SRCS - motor_test.cpp - DEPENDS - ) - diff --git a/src/systemcmds/motor_test/Kconfig b/src/systemcmds/motor_test/Kconfig deleted file mode 100644 index 98ee1cd193..0000000000 --- a/src/systemcmds/motor_test/Kconfig +++ /dev/null @@ -1,12 +0,0 @@ -menuconfig SYSTEMCMDS_MOTOR_TEST - bool "motor_test" - default n - ---help--- - Enable support for motor_test - -menuconfig USER_MOTOR_TEST - bool "motor_test running as userspace module" - default y - depends on BOARD_PROTECTED && SYSTEMCMDS_MOTOR_TEST - ---help--- - Put motor_test in userspace memory diff --git a/src/systemcmds/motor_test/motor_test.cpp b/src/systemcmds/motor_test/motor_test.cpp deleted file mode 100644 index af7d3858a8..0000000000 --- a/src/systemcmds/motor_test/motor_test.cpp +++ /dev/null @@ -1,190 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014 PX4 Development Team. All rights reserved. - * Author: Holger Steinhaus - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name PX4 nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/** - * @file motor_test.c - * - * Tool for drive testing - */ - -#include -#include -#include -#include -#include -#include -#include - -extern "C" __EXPORT int motor_test_main(int argc, char *argv[]); - -static void motor_test(unsigned channel, float value, uint8_t driver_instance, int timeout_ms); -static void usage(const char *reason); - -void motor_test(unsigned channel, float value, uint8_t driver_instance, int timeout_ms) -{ - test_motor_s test_motor{}; - test_motor.timestamp = hrt_absolute_time(); - test_motor.motor_number = channel; - test_motor.value = value; - test_motor.action = value >= 0.f ? test_motor_s::ACTION_RUN : test_motor_s::ACTION_STOP; - test_motor.driver_instance = driver_instance; - test_motor.timeout_ms = timeout_ms; - - uORB::Publication test_motor_pub{ORB_ID(test_motor)}; - test_motor_pub.publish(test_motor); - - if (test_motor.action == test_motor_s::ACTION_STOP) { - PX4_INFO("motors stop command sent"); - - } else { - /* Adjust for 1-based motor indexing */ - PX4_INFO("motor %d set to %.2f", channel + 1, (double)value); - } -} - -static void usage(const char *reason) -{ - if (reason != nullptr) { - PX4_WARN("%s", reason); - } - - PRINT_MODULE_DESCRIPTION( - R"DESCR_STR( -Utility to test motors. - -WARNING: remove all props before using this command. -)DESCR_STR"); - - PRINT_MODULE_USAGE_NAME("motor_test", "command"); - PRINT_MODULE_USAGE_COMMAND_DESCR("test", "Set motor(s) to a specific output value"); - PRINT_MODULE_USAGE_PARAM_INT('m', -1, 1, 8, "Motor to test (1...8, all if not specified)", true); - PRINT_MODULE_USAGE_PARAM_INT('p', 0, 0, 100, "Power (0...100)", true); - PRINT_MODULE_USAGE_PARAM_INT('t', 0, 0, 100, "Timeout in seconds (default=no timeout)", true); - PRINT_MODULE_USAGE_PARAM_INT('i', 0, 0, 4, "driver instance", true); - PRINT_MODULE_USAGE_COMMAND_DESCR("stop", "Stop all motors"); - PRINT_MODULE_USAGE_COMMAND_DESCR("iterate", "Iterate all motors starting and stopping one after the other"); - -} - -int motor_test_main(int argc, char *argv[]) -{ - int channel = -1; //default to all channels - unsigned long lval; - float value = 0.0f; - uint8_t driver_instance = 0; - int ch; - int timeout_ms = 0; - - int myoptind = 1; - const char *myoptarg = nullptr; - - while ((ch = px4_getopt(argc, argv, "i:m:p:t:", &myoptind, &myoptarg)) != EOF) { - switch (ch) { - - case 'i': - driver_instance = (uint8_t)strtol(myoptarg, nullptr, 0); - break; - - case 'm': - /* Read in motor number and adjust for 1-based indexing */ - channel = (int)strtol(myoptarg, nullptr, 0) - 1; - break; - - case 'p': - /* Read in power value */ - lval = strtoul(myoptarg, nullptr, 0); - - if (lval > 100) { - usage("value invalid"); - return 1; - } - - value = ((float)lval) / 100.f; - break; - - case 't': - timeout_ms = strtol(myoptarg, nullptr, 0) * 1000; - break; - - default: - usage(nullptr); - return 1; - } - } - - bool run_test = true; - - if (myoptind >= 0 && myoptind < argc) { - if (strcmp("stop", argv[myoptind]) == 0) { - channel = 0; - value = -1.f; - - } else if (strcmp("iterate", argv[myoptind]) == 0) { - value = 0.15f; - - for (int i = 0; i < 8; ++i) { - motor_test(i, value, driver_instance, 0); - px4_usleep(500000); - motor_test(i, -1.f, driver_instance, 0); - px4_usleep(10000); - } - - run_test = false; - - } else if (strcmp("test", argv[myoptind]) == 0) { - // nothing to do - } else { - usage(nullptr); - return 0; - } - - } else { - usage(nullptr); - return 0; - } - - if (run_test) { - if (channel < 0) { - for (int i = 0; i < 8; ++i) { - motor_test(i, value, driver_instance, timeout_ms); - px4_usleep(10000); - } - - } else { - motor_test(channel, value, driver_instance, timeout_ms); - } - } - - return 0; -}