ArduPilot / ardupilot

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

ROVER?: Compass Calibration silently fails if enabled compass is not present #13257

Open jmachuca77 opened 4 years ago

jmachuca77 commented 4 years ago

Bug report

Issue details When using only a UAVCAN compass (USE_COMPASS 0, USE_COMPASS2 0, USE_COMPASS3 1, COMPASS_PRIMARY 3), and the compass is not detected, Mag Calibration does not start, but there is no indication anything failed.

Version ROVER 4.0.0 release

Platform Not sure if this is only on Rover, might be on other platforms too. [ ] All [ ] AntennaTracker [ ? ] Copter [ ? ] Plane [ X ] Rover [ ? ] Submarine

Hardware type Tested using Here2 on UAVCAN with CubeBlack and CubeOrange

jmachuca77 commented 4 years ago

Upon further testing this happens also if the only compass enabled is an external compass. Even if it is on I2C and it is correctly detected.

jmachuca77 commented 4 years ago

This TLOG shows an attempt to start compass calibration with only the external compass enabled.

2020-01-13 12-24-43.tlog.zip

WickedShell commented 4 years ago

We just need to send a NACK here: https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_Compass/AP_Compass_Calibration.cpp#L116 if no calibrations were started, as well as NACK here: https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_Compass/AP_Compass_Calibration.cpp#L99

jmachuca77 commented 4 years ago

This TLOG shows how after enabling an internal compass and starting calibration it starts correctly.

2020-01-13 12-29-13.tlog.zip

tridge commented 4 years ago

note that in these logs COMPASS_ENABLE=0

rmackay9 commented 4 years ago

maybe we don't display a message to the user when they try to do a compass calibration when compass-enable = 0.