navfilterex-pseudo.cpp

Pseudo-code example (minimal extra code) of how to use NavFilterMgr on GPS LNAV data.

//==============================================================================
//
// This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
//
// The GNSSTk is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation; either version 3.0 of the License, or
// any later version.
//
// The GNSSTk is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with GNSSTk; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
//
// This software was developed by Applied Research Laboratories at the
// University of Texas at Austin.
// Copyright 2004-2022, The Board of Regents of The University of Texas System
//
//==============================================================================
//==============================================================================
//
// This software was developed by Applied Research Laboratories at the
// University of Texas at Austin, under contract to an agency or agencies
// within the U.S. Department of Defense. The U.S. Government retains all
// rights to use, duplicate, distribute, disclose, or release this software.
//
// Pursuant to DoD Directive 523024
//
// DISTRIBUTION STATEMENT A: This software has been approved for public
// release, distribution is unlimited.
//
//==============================================================================
void filterEX()
{
// Filter manager, where the work is done
// Individual filters being applied
// Data being passed to the filter
// Generic LNAV message storage
std::vector<uint32_t> subframe(10,0);
// Tell the manager what filters to use
mgr.addFilter(&filtCook);
mgr.addFilter(&filtParity);
// Point the filter data to the LNAV message
navFiltData.sf = &subframe[0];
// validate the subframe
gnsstk::NavFilter::NavMsgList l = mgr.validate(&navFiltData);
// process the results
gnsstk::NavFilter::NavMsgList::const_iterator nmli;
for (nmli = l.begin(); nmli != l.end(); nmli++)
{
gnsstk::LNavFilterData *fd = dynamic_cast<gnsstk::LNavFilterData*>(*nmli);
// do something with fd (nav message that passed the filters)
}
}
gnsstk::LNavParityFilter
Definition: LNavParityFilter.hpp:53
gnsstk::LNavCookFilter
Definition: LNavCookFilter.hpp:54
filterEX
void filterEX()
Definition: navfilterex-pseudo.cpp:42
gnsstk::NavFilterMgr
Definition: NavFilterMgr.hpp:170
gnsstk::NavFilterMgr::addFilter
void addFilter(NavFilter *filt)
Definition: NavFilterMgr.cpp:50
gnsstk::NavFilterMgr::validate
NavFilter::NavMsgList validate(NavFilterKey *msgBits)
Definition: NavFilterMgr.cpp:57
gnsstk::LNavFilterData
Definition: LNavFilterData.hpp:52
gnsstk::NavFilter::NavMsgList
std::list< NavFilterKey * > NavMsgList
Definition: NavFilter.hpp:58
gnsstk::LNavFilterData::sf
uint32_t * sf
Definition: LNavFilterData.hpp:68


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:38