I am attempting to do the compass power calibration, and have made a log I want to analyze. I download the script mag_compensation.py from Github, but when I run it I get an error:
File “C:\mag_compensation.py”, line 73
PX4-Autopilot/mag_compensation.py at release/1.13 · PX4/PX4-Autopilot
^
SyntaxError: invalid character ‘·’ (U+00B7)
Am I missing some Python dependencies? I am not able to find out.
Now I am starting to get the real challenges. It appears my logs don’t have the same topics as the older logs that this script is based on. Instead of “sensor_mag.00.x”, it uses the format “vehicle_magnetometer.00.magnetometer_ga.00” and so on. I tried changing the topic name and variable names but it appears it doesn’t get the data from the magnetometers (it doesn’t go into the if statements starting at line 116).
I get no error message, but the output is:
←[91m
current-based compensation: ←[0m
param set CAL_MAG_COMP_TYP 2
The the scripts exits.
The same thing happens for thrust-based compensation (except that CAL_MAG_COMP_TYP 1 is stated). I suspect it may have something to do with the variable “timestamp” that I am not able to find in most topics and it appears the script is looking for it, but I am not sure.