mag_calibration_test_data.h 16.9 KB
/****************************************************************************
 *
 *   Copyright (C) 2021 PX4 Development Team. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 * 3. Neither the name PX4 nor the names of its contributors may be
 *    used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 ****************************************************************************/

/**
 * Test data for the Magnetometer calibration unit tests
 */

static constexpr float mag_data1_x[231] = {-0.4820142686367035f, -0.49314647912979126f, -0.48948222398757935f, -0.4931904077529907f, -0.47832345962524414f, -0.4709412157535553f, -0.4264504015445709f, -0.3745213747024536f, -0.3448501527309418f, -0.3077530264854431f, -0.27809011936187744f, -0.22989600896835327f, -0.20765912532806396f, -0.15944115817546844f, -0.12978695333003998f, -0.08528247475624084f, -0.01854165457189083f, 0.011124793440103531f, 0.037078678607940674f, 0.05191200226545334f, 0.05932694301009178f, 0.06674399971961975f, 0.059328000992536545f, 0.0556190088391304f, 0.04820830374956131f, 0.02595600113272667f, -0.022249983623623848f, -0.04079090803861618f, -0.059328000992536545f, -0.09640628844499588f, -0.1260720044374466f, -0.17798399925231934f, -0.2113559991121292f, -0.25585201382637024f, -0.2780950367450714f, -0.32633310556411743f, -0.37086614966392517f, -0.31892216205596924f, -0.27442631125450134f, -0.21510623395442963f, -0.14833854138851166f, -0.1260945051908493f, -0.07417456805706024f, -0.051917560398578644f, 0.003708463627845049f, 0.05563092231750488f, 0.07788468152284622f, 0.09271159023046494f, 0.10383698344230652f, 0.10012851655483246f, 0.09271159023046494f, 0.05563092231750488f, 0.007417456246912479f, -0.07046583294868469f, -0.15204700827598572f, -0.17802532017230988f, -0.22992472350597382f, -0.25961098074913025f, -0.28554657101631165f, -0.33008861541748047f, -0.35229772329330444f, -0.3893955945968628f, -0.4339211881160736f, -0.43760645389556885f, -0.4524325430393219f, -0.4636075794696808f, -0.4450235366821289f, -0.4339057207107544f, -0.4116835296154022f, -0.29668235778808594f, -0.2595970332622528f, -0.22251969575881958f, -0.1965731382369995f, -0.18172118067741394f, -0.3931955397129059f, -0.4228706657886505f, -0.4562224745750427f, -0.4710506200790405f, -0.48222094774246216f, -0.48221227526664734f, -0.47846877574920654f, -0.47476813197135925f, -0.4599316418170929f, -0.44880422949790955f, -0.43399885296821594f, -0.4080331027507782f, -0.3931955397129059f, -0.35606977343559265f, -0.3338213264942169f, -0.29673540592193604f, -0.2781844437122345f, -0.2522251009941101f, -0.20771105587482452f, -0.14836770296096802f, -0.12983104586601257f, -0.0964355617761612f, -0.07047339528799057f, -0.04080038517713547f, 0.01854562945663929f, 0.05564187467098236f, 0.07418385148048401f, 0.08531142771244049f, 0.11128374934196472f, 0.10014640539884567f, 0.10385739058256149f, 0.10386482626199722f, 0.10386482626199722f, 0.08902062475681305f, 0.07789862155914307f, 0.07047970592975616f, 0.0482238233089447f, 0.029673539102077484f, 0.0f, 0.029676198959350586f, 0.014838632196187973f, 0.014838099479675293f, 0.0f, 0.0074191829189658165f, -0.0037095914594829082f, -0.011129574850201607f, -0.0037099244073033333f, -0.0074191829189658165f, -0.014839697629213333f, -0.007419581990689039f, -0.003709858050569892f, 0.011128774844110012f, 0.01854928955435753f, 0.025967607274651527f, 0.025967607274651527f, 0.03338632360100746f, 0.04451829940080643f, 0.04822901636362076f, 0.04451509937644005f, 0.05193427950143814f, 0.05935346335172653f, 0.055644869804382324f, 0.05935879051685333f, 0.06677983701229095f, 0.06306418776512146f, 0.07048476487398148f, 0.07420115172863007f, 0.07048856467008591f, 0.07048982381820679f, 0.05935879051685333f, 0.04451989009976387f, 0.037099242210388184f, 0.04080624133348465f, 0.03338751941919327f, 0.03338751941919327f, 0.022259945049881935f, 0.0f, -0.3969832956790924f, -0.4155339002609253f, -0.44155243039131165f, -0.45636165142059326f, -0.46747565269470215f, -0.4712366461753845f, -0.4675261080265045f, -0.4489411413669586f, -0.44893312454223633f, -0.4304364025592804f, -0.4192892611026764f, -0.3932802379131317f, -0.34507253766059875f, -0.3228156566619873f, -0.26716259121894836f, -0.2077707052230835f, -0.18179936707019806f, -0.14469745755195618f, -0.11502417922019958f, -0.08162566274404526f, -0.029683660715818405f, -0.014840764924883842f, 0.011130573228001595f, 0.03339231759309769f, 0.1075974628329277f, 0.11873892694711685f, 0.12986135482788086f, 0.11501797288656235f, 0.09275642782449722f, 0.048236820846796036f, -0.018553292378783226f, -0.07049616426229477f, -0.1410050243139267f, -0.20406784117221832f, -0.2263297736644745f, -0.2708536982536316f, -0.2931472957134247f, -0.3710324466228485f, -0.3970118761062622f, -0.4081430435180664f, -0.4601631164550781f, -0.46012163162231445f, -0.45270034670829773f, -0.44527098536491394f, -0.43414703011512756f, -0.41930443048477173f, -0.40077269077301025f, -0.378493994474411f, -0.37107253074645996f, -0.3562360405921936f, -0.3562617301940918f, -0.3376820683479309f, -0.3339712917804718f, -0.3191280961036682f, -0.31170654296875f, -0.31170654296875f, -0.31916263699531555f, -0.31170654296875f, -0.3079957365989685f, -0.3154173195362091f, -0.3079957365989685f, -0.31170654296875f, -0.3154173195362091f, -0.3265555500984192f, -0.3785075545310974f, -0.3970547318458557f, -0.4007583260536194f, -0.42674872279167175f, -0.4379129409790039f, -0.4415842294692993f, -0.44533517956733704f, -0.46015480160713196f, -0.46389082074165344f, -0.46015480160713196f, -0.4601631164550781f, -0.4601631164550781f, -0.460146427154541f, -0.45272472500801086f, -0.4416400194168091f, -0.4304751753807068f};

static constexpr float mag_data1_y[231] = {0.15201987326145172f, 0.10752817988395691f, 0.08528856933116913f, 0.04820658266544342f, 0.0037079339381307364f, -0.025957390666007996f, -0.08158181607723236f, -0.12978464365005493f, -0.13349038362503052f, -0.152022585272789f, -0.1557304561138153f, -0.16685999929904938f, -0.15574434399604797f, -0.15202529728412628f, -0.13349515199661255f, -0.11865388602018356f, -0.07787495106458664f, -0.05191570147871971f, -0.0037078680470585823f, 0.014832000248134136f, 0.06303487718105316f, 0.11865600198507309f, 0.14461199939250946f, 0.18168875575065613f, 0.19654153287410736f, 0.23360399901866913f, 0.28924980759620667f, 0.304077684879303f, 0.32630401849746704f, 0.3411298990249634f, 0.3596760034561157f, 0.3596760034561157f, 0.3670920133590698f, 0.3670920133590698f, 0.3559616804122925f, 0.344874769449234f, 0.2558976411819458f, 0.25587940216064453f, 0.24475860595703125f, 0.23735859990119934f, 0.23734167218208313f, 0.22622837126255035f, 0.23364987969398499f, 0.22992061078548431f, 0.22250781953334808f, 0.22252368927001953f, 0.22994525730609894f, 0.22621627151966095f, 0.22992472350597382f, 0.21879935264587402f, 0.22621627151966095f, 0.23735859990119934f, 0.2484847903251648f, 0.2633197009563446f, 0.2707178294658661f, 0.2744556963443756f, 0.2781347632408142f, 0.2855720520019531f, 0.28925496339797974f, 0.2818734347820282f, 0.28183817863464355f, 0.27813971042633057f, 0.2781546115875244f, 0.2818482220172882f, 0.2707178294658661f, 0.2670379877090454f, 0.2707226574420929f, 0.2596017122268677f, 0.2707468271255493f, 0.26330557465553284f, 0.2595970332622528f, 0.2707323133945465f, 0.25220704078674316f, 0.25218451023101807f, -0.09644418209791183f, -0.10386297106742859f, -0.1224011555314064f, -0.11868992447853088f, -0.1372475028038025f, -0.14837302267551422f, -0.14094428718090057f, -0.14836503565311432f, -0.16320154070854187f, -0.17061978578567505f, -0.1669226437807083f, -0.17805080115795135f, -0.17805080115795135f, -0.1965802013874054f, -0.20400193333625793f, -0.1965871900320053f, -0.2114201933145523f, -0.21142396330833435f, -0.21883843839168549f, -0.21884234249591827f, -0.2040202021598816f, -0.21512550115585327f, -0.2151293158531189f, -0.20771105587482452f, -0.20400193333625793f, -0.1891823709011078f, -0.1780412495136261f, -0.1780412495136261f, -0.16692562401294708f, -0.1557832956314087f, -0.15207688510417938f, -0.13724996149539948f, -0.13354049623012543f, -0.12982173264026642f, -0.11870266497135162f, -0.11128374934196472f, -0.1112857386469841f, -0.10385739058256149f, -0.0964476466178894f, -0.1743476688861847f, -0.1632249653339386f, -0.12241432070732117f, -0.055647868663072586f, 0.0037095914594829082f, 0.048224691301584244f, 0.1038760244846344f, 0.12613743543624878f, 0.14838366210460663f, 0.1854962259531021f, 0.20774829387664795f, 0.3079182207584381f, 0.30789607763290405f, 0.32646751403808594f, 0.32274025678634644f, 0.31161126494407654f, 0.30047690868377686f, 0.2633999288082123f, 0.25227487087249756f, 0.22257548570632935f, 0.21886590123176575f, 0.1706412136554718f, 0.1520959883928299f, 0.10387788712978363f, 0.07048982381820679f, 0.04080624133348465f, -0.007419448811560869f, -0.06307098269462585f, -0.09274811297655106f, -0.1335596740245819f, -0.20775577425956726f, -0.21888945996761322f, -0.21888555586338043f, -0.21516016125679016f, -0.2077445685863495f, -0.18919594585895538f, -0.07790981233119965f, -0.02226034551858902f, -0.15582521259784698f, -0.12985433638095856f, -0.1038946881890297f, -0.04452308639883995f, -0.0f, 0.05936839431524277f, 0.08163154125213623f, 0.11501797288656235f, 0.14098726212978363f, 0.1744009554386139f, 0.19665780663490295f, 0.2300318479537964f, 0.25602155923843384f, 0.26344725489616394f, 0.2857155501842499f, 0.30423566699028015f, 0.31165605783462524f, 0.2931050956249237f, 0.30796799063682556f, 0.29311034083366394f, 0.26715296506881714f, 0.25971338152885437f, 0.24487261474132538f, 0.2300359457731247f, 0.12985900044441223f, 0.07792241871356964f, 0.011130972765386105f, -0.05194360017776489f, -0.11130772531032562f, -0.16697360575199127f, -0.2152182012796402f, -0.24117109179496765f, -0.2560354471206665f, -0.2560123801231384f, -0.23746076226234436f, -0.23746076226234436f, -0.23006495833396912f, -0.15583361685276031f, -0.13728447258472443f, -0.11131174117326736f, 0.007421985734254122f, -0.014842634089291096f, -0.05937053635716438f, -0.11502832919359207f, -0.13729436695575714f, -0.1744009554386139f, -0.21151892840862274f, -0.2263542264699936f, -0.24861860275268555f, -0.2449122816324234f, -0.2449299395084381f, -0.2263583093881607f, -0.230069100856781f, -0.1781180202960968f, -0.1447208821773529f, -0.1001913845539093f, -0.08164625614881516f, -0.01855395920574665f, 0.01113237626850605f, 0.0519510880112648f, 0.0816374197602272f, 0.1187453418970108f, 0.1521424800157547f, 0.19296464323997498f, 0.285736083984375f, 0.3154173195362091f, 0.31541162729263306f, 0.31913381814956665f, 0.31544575095176697f, 0.3042849600315094f, 0.3006012737751007f, 0.24492110311985016f, 0.19668971002101898f, 0.17070259153842926f, 0.12246276438236237f, 0.09648581594228745f, 0.07421717047691345f, 0.02968686819076538f, -0.04082386568188667f, -0.18554963171482086f};

static constexpr float mag_data1_z[231] = {-0.40708473324775696f, -0.3992324769496918f, -0.38762804865837097f, -0.37180647253990173f, -0.35184505581855774f, -0.34016337990760803f, -0.3085607588291168f, -0.29266035556793213f, -0.29262199997901917f, -0.264837384223938f, -0.2806485593318939f, -0.2490914911031723f, -0.25314486026763916f, -0.25301215052604675f, -0.24523405730724335f, -0.2451055347919464f, -0.23342911899089813f, -0.24922214448451996f, -0.24902619421482086f, -0.26095297932624817f, -0.27277871966362f, -0.30444514751434326f, -0.308398962020874f, -0.3320784568786621f, -0.35212188959121704f, -0.35584497451782227f, -0.3798168897628784f, -0.3955906927585602f, -0.40724480152130127f, -0.42300471663475037f, -0.4230601489543915f, -0.44282928109169006f, -0.4388754665851593f, -0.4665523171424866f, -0.46253785490989685f, -0.454988956451416f, -0.803681492805481f, -0.830958366394043f, -0.8627271056175232f, -0.879018247127533f, -0.8706420660018921f, -0.8630667924880981f, -0.855260968208313f, -0.834915280342102f, -0.7994077205657959f, -0.7443938255310059f, -0.6692503690719604f, -0.6292367577552795f, -0.5777897238731384f, -0.5461300015449524f, -0.4907255470752716f, -0.4236709475517273f, -0.36031830310821533f, -0.3128037750720978f, -0.30076727271080017f, -0.30100417137145996f, -0.32055458426475525f, -0.32468241453170776f, -0.3482111394405365f, -0.36437347531318665f, -0.3759097158908844f, -0.42350417375564575f, -0.5028617978096008f, -0.5343277454376221f, -0.5817471742630005f, -0.6059688925743103f, -0.6688991189002991f, -0.688779354095459f, -0.7445892691612244f, -0.8311764597892761f, -0.8470083475112915f, -0.8591077923774719f, -0.8595589399337769f, -0.8787875175476074f, -0.3330386281013489f, -0.38061556220054626f, -0.43193021416664124f, -0.4675327241420746f, -0.5035226941108704f, -0.5549914240837097f, -0.5824348330497742f, -0.6340259909629822f, -0.6538393497467041f, -0.6815779805183411f, -0.7176189422607422f, -0.7453721165657043f, -0.765195906162262f, -0.7963905334472656f, -0.7925325036048889f, -0.8084893822669983f, -0.8202711343765259f, -0.820378839969635f, -0.8281964659690857f, -0.8362315893173218f, -0.8208101391792297f, -0.8201633095741272f, -0.8083831667900085f, -0.7925325036048889f, -0.74498051404953f, -0.6978869438171387f, -0.6777042746543884f, -0.6380724310874939f, -0.6106510162353516f, -0.5864740610122681f, -0.5588088035583496f, -0.5353109836578369f, -0.47979724407196045f, -0.45576605200767517f, -0.4004919230937958f, -0.37273505330085754f, -0.34105777740478516f, -0.3249810039997101f, -0.29743412137031555f, -0.392613023519516f, -0.36494842171669006f, -0.34105777740478516f, -0.2976297438144684f, -0.2736753523349762f, -0.2657427489757538f, -0.26588255167007446f, -0.2778243124485016f, -0.2974731922149658f, -0.3095756471157074f, -0.3293335735797882f, -0.4722391664981842f, -0.527519166469574f, -0.5555754899978638f, -0.6029582619667053f, -0.6664276123046875f, -0.6861714720726013f, -0.742090106010437f, -0.766001284122467f, -0.7813629508018494f, -0.8091270923614502f, -0.8249923586845398f, -0.8489018082618713f, -0.8453795909881592f, -0.8534297943115234f, -0.8608022928237915f, -0.8410787582397461f, -0.8098725080490112f, -0.7779080271720886f, -0.7581631541252136f, -0.6350269317626953f, -0.619232714176178f, -0.5556486248970032f, -0.5275884866714478f, -0.49195173382759094f, -0.43640878796577454f, -0.30167749524116516f, -0.2818673849105835f, -0.7861561179161072f, -0.790126621723175f, -0.7986983060836792f, -0.8062208294868469f, -0.8218905329704285f, -0.8384345769882202f, -0.8463818430900574f, -0.845936119556427f, -0.8577378392219543f, -0.8664782643318176f, -0.858302652835846f, -0.8656798601150513f, -0.8581897020339966f, -0.858302652835846f, -0.8663641214370728f, -0.877592921257019f, -0.8696508407592773f, -0.8617088794708252f, -0.8581897020339966f, -0.8578507304191589f, -0.8542165756225586f, -0.8339117765426636f, -0.8339117765426636f, -0.8300500512123108f, -0.8181354403495789f, -0.8067519068717957f, -0.7824946641921997f, -0.7625340223312378f, -0.7506194114685059f, -0.7629356980323792f, -0.7512127757072449f, -0.7427741289138794f, -0.747238039970398f, -0.7546902298927307f, -0.7507182359695435f, -0.7626343369483948f, -0.7672125101089478f, -0.8063269853591919f, -0.8104057908058167f, -0.8183509111404419f, -0.3221605718135834f, -0.3139989972114563f, -0.34182170033454895f, -0.36562156677246094f, -0.373619019985199f, -0.4173404276371002f, -0.4731728732585907f, -0.548576831817627f, -0.5724279880523682f, -0.6241878271102905f, -0.6523617506027222f, -0.6997264623641968f, -0.7315322160720825f, -0.7991194128990173f, -0.8508037328720093f, -0.8786337971687317f, -0.8952445983886719f, -0.9064638614654541f, -0.9263424277305603f, -0.9263424277305603f, -0.9342938661575317f, -0.9104394912719727f, -0.9144152402877808f, -0.8747733235359192f, -0.7833197712898254f, -0.7355079650878906f, -0.6996342539787292f, -0.6282463073730469f, -0.5689026713371277f, -0.5486491918563843f, -0.49331414699554443f, -0.42153728008270264f, -0.37396395206451416f, -0.36586251854896545f, -0.32613787055015564f, -0.3301151692867279f, -0.31809940934181213f, -0.32207563519477844f, -0.3223305940628052f, -0.43750202655792236f};