Skip to content
Snippets Groups Projects
  • Matthew Lloyd's avatar
    AP_Compass: avoid division by zero if we haven't received any mag reports · 49ddb3e0
    Matthew Lloyd authored
    Otherwise, get_field() will return NaNs after once every few calls to
    read() during compassmot on PX4 platforms, which causes compassmot to fail.
    
    This is a quick hack around the deeper issue, which could be something
    like the PX4 mag driver experiencing starvation and skipping mag reports,
    buffer overrun or something else that causes mag reports to be dropped.
    Or perhaps we should never expect in the first place that we will always
    receive at least one mag report between calls to read().
    49ddb3e0
AP_Compass_PX4.cpp 4.46 KiB