Compass get_field

hello everyone, where to find the defination of the get_field() funciton in the AP_compass.cpp, thank you,hope for your help.

Why do you need this? You can simply run arducopter software and look for the raw values of compasses in you preferred GCS.

BrunoBagarini:
Thank you for your reply, I want to know whether the compass values have been calibrated in the function(multiply by the scale factor and make offset correction)。
Another question is that if I calibrate the accelerometer and compass on the ground station, will the calibration parameters remain in the register after the firmware is uploaded next time, or need to be calibrated again. thank you.

You can trust Ardupilot firmware, it will really do what is intended.

As soon as you do not shift between vehicles types, like having a FC with ArduCopter loaded and then loading a ArduPlane firmware, it shouldn’t erase the parameters.
Even though, I always recommend as a good practice to save your parameters to a file using Mission Planner before any SW update, and then after updating double check if your parameters are still correct.
But in the case your calibration parameters are lost, you should see messages alerting that your compasses are not calibrated anyway…

BrunoBagarini:
I have an idea. First, upload the Arducopter firmware. After the accelerometer and geomagnetic calibration is completed, upload the modified ahrs_test program (used as an inertial navigation device in other places). At this time, whether the calibration parameters have been erased? Thank you very much.

I really don’t know, never tested this procedure.