(leads to double publishing on the console when a new link is established, but this is the best compromise between fixing and completely restructuring)
This resolves a bug where a takeoff would go sideways instead of
straight up. What happened was that the position setpoint got shifted
around even though there was actually no real setpoint set but only a
setpoint of type IDLE. This then lead to a position setpoint far away
from the takeoff point and therefore scary takeoffs.
This fix prevents the part of the position controller which
moves/integrates the position setpoint from running in the case of an
idle setpoint.
This bug could be reproduced by switching the vehicle to mission mode
without a valid mission, then switch to hold mode, and then send the arm
and takeoff command.
This way user can set aftwards any other AUTOSTART value and it will
not be overwritten.
Also move the block up and set SYS_AUTOCONFIG, this way if air frame
configuration was reset in ground station it will wipe the parameters
before load new ones.
A large buffer on the heap was not deallocated when parameters were saved,
but there were no changes to the parameters. In that case
parameter_flashfs_write() was not called, which was previously responsible
for freeing the buffer.
This patch moves the responsibility of freeing the buffer to the calling
side, which already explicitly allocates the buffer.
The mapping of PX4_SPIDEV_ACCEL_MAG to PX4_SPIDEV_ICM is not
a clean approach and the PX4_SPIDEV_MPU is already used by the
mpu9250 leaving the only (and the correct) option to the use
PX4_SPIDEV_ICM and make it map to the reused ACCEL_MAG_CS PC15
as 206080D_CS
AeroFC is updated by Aero board using the UART between AeroFC
and Aero board.
This script will copy firmware and px_uploader.py to Aero board and run
px_uploader.py with the correct paremeters. User only needs to have a
network connection (Ethernet over USB or WiFi) with Aero board to update
AeroFC firmware. The IP/hostname can be given by AERO_HOSTNAME
environment variable.
Right now it's only possible to use ttyS2 as the UART for connecting a
companion computer. Add a variable that can be set so other boards may
be better supported.
As ASC use a non-standard UART for mavlink it is necessary check for
the board name and set SYS_AUTOSTART to initialize mavlink on the
right interface otherwise there is no way to change the SYS_AUTOSTART.