The dynamic calibration lets the vehicle compensate for the variable magnetic fields generated by its eight thrusters.
- Kill the controller (rosnode kill /rise_6dof)
- Make sure the submarine is unkilled (by pressing 2)
- Lock the submarine in place (by pressing 3). This corresponds to holding the submarine still on the bottom of the pool.
- Run the dynamic compensation by running "rosrun thruster_driver do_all_calibration". Each thruster will successively go from 0 to full power forward to full power backward back to 0. The calibration script will record magnetic field data during that, do a least squares regression, and save the resulting configuration.
- The configuration files in subsim/launch should be updated with new values. You can verify this with "git diff launch" from within the subsim directory (roscd subsim). On the actual submarine, the files in sub_launch/launch would be updated.
The hard/soft calibration lets the vehicle compensate for hard and soft iron effects caused by metals in the submarine that generate magnetic fields and distort the external magnetic field.
- Kill the submarine (by pressing 1)
- Start recording raw magnetic data (rosbag record /imu/mag_raw)
- Rotate the submarine, sampling every possible rotation (look at subsim's README.md)
- Stop recording (press Ctrl-c on rosbag)
- Generate the calibration result (rosrun magnetic_hardsoft_compensation generate_config NAME_OF_THE_BAG_FILE_YOU_PRODUCED). Make sure that the points cover the entire sphere. If they don't, re-record the data. Close the window.
- Paste the generated configuration (the last 5 lines of output after closing the window) into sub_launch/launch/common.xml, replacing the similar 5 lines that are already there.
- Stop and restart the main "roslaunch subsim run.launch" process to load the new configuration.