MAGYC-BFG
Proposed method for the full calibration of a three-axis magnetometer using magnetic field and angular rate measurements. This particular approach is based on a factor graph processing all the data in a batch manner.
In particular MAGYC-BFG embeds the volume constraint for the soft-iron into a reparametrization for the Cholesky decomposition of the soft-iron matrix, allowing for the use of half the factors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
magnetic_field |
ndarray or list
|
Magnetic field measurements in a 3xN or Nx3 numpy array or list. |
required |
angular_rate |
ndarray or list
|
Angular rate measurements in a 3xN or Nx3 numpy array or list. |
required |
time |
ndarray or list
|
Time stamps of the measurements. |
required |
measurements_window |
int
|
Window size for the measurements. |
25
|
optimizer |
str
|
Optimization algorithm to use. Options are "dogleg" or "lm" for the Dogleg and Levenberg-Marquardt optimizers respectively. |
'dogleg'
|
relative_error_tol |
float
|
Relative error tolerance for the optimizer. Default is 1.00e-07 |
1e-07
|
absolute_error_tol |
float
|
Absolute error tolerance for the optimizer. Default is 1.00e-07 |
1e-07
|
max_iter |
int
|
Maximum number of iterations for the optimizer. Default is 1000 |
1000
|
Returns:
Name | Type | Description |
---|---|---|
hard_iron |
ndarray
|
Hard iron bias. |
soft_iron |
ndarray
|
Soft iron matrix. |
gyro_bias |
ndarray
|
Gyroscope bias. |
calibrated_magnetic_field |
ndarray
|
Calibrated magnetic field measurements. |
calibrated_angular_rate |
ndarray
|
Calibrated angular rate measurements. |
optimization_status |
Dict[str, Union[List[float], int]]
|
Dictionary with the optimization status. The keys are "error" and "iterations". |
Raises:
Type | Description |
---|---|
TypeError
|
If the magnetic field, angular rate, and time are not numpy arrays or lists. |
ValueError
|
If the magnetic field and angular rate are not 3xN or Nx3 numpy arrays, or if the time is not a 1D numpy array. |
ValueError
|
If the optimizer is not a string or not "dogleg" or "lm" |
TypeError
|
If the relative error tolerance is not a float |
TypeError
|
If the absolute error tolerance is not a float |
ValueError
|
If the maximum number of iterations is not a positive integer |
ValueError
|
If the measurements window is not a positive integer |
Source code in magyc/methods/magyc.py
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 |
|