ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

Rover: reject position targets if acceleration supplied

Open peterbarker opened this issue 1 year ago • 3 comments

Replaces https://github.com/ArduPilot/ardupilot/pull/26955/files which simply factored the check out.

This both factors the check out and stops us accepting the position target if acceleration is set.

We should probably also reject if other bits and pieces are set.

peterbarker avatar Sep 11 '24 02:09 peterbarker

Thanks @peterbarker for this. I guess this has been tested in some way?

rmackay9 avatar Sep 11 '24 02:09 rmackay9

Board                    AP_Periph  blimp  bootloader  copter  heli  iofirmware  plane  rover  sub
CubeOrange-periph-heavy  *                                                                     
Durandal                            *      *           *       *                 *      -24    *
Hitec-Airspeed           *                                                                     
KakuteH7-bdshot                     *      *           *       *                 *      8      *
MatekF405                           *      *           *       *                 *      0      *
Pixhawk1-1M-bdshot                  *                  *       *                 *      0      *
f103-QiotekPeriph        *                                                                     
f303-Universal           *                                                                     
iomcu                                                                *                         
revo-mini                           *      *           *       *                 *      0      *
skyviper-v2450                                         *                                       

peterbarker avatar Sep 11 '24 02:09 peterbarker

Tested in SITL with these commands:

# this one should move the vehicle:
# message set_position_target_local_ned 0 1 1 1 0b1111111111111000 10 10 0 0 0 0 0 0 0 0 0

# this one should be ignored as acceleration is supplied along with position:
# message set_position_target_local_ned 0 1 1 1 0b1111111000111000 10 10 0 0 0 0 0 0 0 0 0

# should work:
# message set_position_target_global_int 0 1 1 0 0b1111111111111000 -353630399 1491652946 0 0 0 0 0 0 0 0 0 

# acceleration not ignored:
# message set_position_target_global_int 0 1 1 0 0b1111111000111000 -353630399 1491652946 0 0 0 0 0 0 0 0 0 

(and gdb and breakpoints)

peterbarker avatar Sep 11 '24 02:09 peterbarker

Relates to #23430 which has the same inability to share errors back to users for silently dropping invalid commands

Ryanf55 avatar Sep 17 '24 00:09 Ryanf55

As requested:

GUIDED> message set_position_target_global_int 0 1 1 0 0b1111111000111000 -353630399 1491652946 0 0 0 0 0 0 0 0 0 
GUIDED> AP: Ignoring SET_POSITION_TARGET_GLOBAL_INT; set ACC_IGNORE in mask

peterbarker avatar Sep 17 '24 11:09 peterbarker