ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
10.82k stars 17.28k forks source link

Sub: SITL using Speeup > 3 Control_Guided Creates Internal_Error on arm #18744

Open hendjoshsr71 opened 3 years ago

hendjoshsr71 commented 3 years ago

When using Sub SITL with speedup > 3 guided mode will trigger the internal error below upon arming. The error comes from AC_PosControl::update_xy_controller() because the xy_control in considered in-active. However, the xy_controller appears to be kept initialized in pos_control_run() while disarmed here.

https://github.com/ArduPilot/ardupilot/blob/f0efc1300eb0f00524505594f5c2e491436dd029/ArduSub/control_guided.cpp#L284-L293

See Forum Discussion here

Replication Below

./Tools/autotest/sim_vehicle.py -v ArduSub --console -l 40.56925361003828,-73.96715920716407,0,0 -D --speedup=3

Mavproxy Replication 'set heartbeat 3' (or whatever your speedup amount is) mode guided arm throttle Get an internal error

image

Version Master

Platform [ ] All [ ] AntennaTracker [ ] Copter [ ] Plane [ ] Rover [x ] Submarine dumpstack.sh_ardusub.2301.out.txt

hendjoshsr71 commented 3 years ago

Note the PR #18719 changed the disarmed initialization to use wp_nav.wp_and_spline_init(); the same as guided_pos_control_start(). However, this doesn't resolve the issue as the xy_controller was already being kept initialized.

hendjoshsr71 commented 1 year ago

This might be fixed by, https://github.com/ArduPilot/ardupilot/pull/22298 ??