mb500
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
gps::MB500 Class Reference

#include <mb500.hh>

Inheritance diagram for gps::MB500:

Public Types

enum  CORRELATOR_MODE { EDGE_CORRELATOR, STROBE_CORRELATOR }
 
enum  Special { NONE = -1 }
 

Public Member Functions

 MB500 ()
 
 ~MB500 ()
 
bool openSerial (std::string const &device_name)
 
bool open (const std::string &device_name)
 
bool openBase (const std::string &device_name)
 
bool openRover (const std::string &device_name)
 
void close ()
 
bool setRTKBase (std::string port_name)
 
void stopRTKBase ()
 
bool setFastRTK (bool enable)
 
bool setRTKReset ()
 
bool setRTKInputPort (std::string const &port)
 
bool setCodeCorrelatorMode (CORRELATOR_MODE mode)
 
void reset (bool cold_start)
 
void dumpAlmanac ()
 
void dumpStatus ()
 
void dumpSatellites ()
 
bool setReceiverDynamics (MB500_DYNAMICS_MODEL mode)
 
bool setUserDynamics (int h_vel, int h_acc, int v_vec, int v_acc)
 
bool setKnownPointInit (double, std::string, double, std::string, double, double, double, double, std::string)
 
bool setProcessingRate (int rate)
 
bool resetStoredPosition ()
 
bool setPosition (double latitude, double longitude, double height)
 
bool setPositionFromCurrent ()
 
bool setFixThreshold (MB500_AMBIGUITY_THRESHOLD threshold)
 
void disableAllOutputs ()
 
bool setGLONASSTracking (bool)
 
bool setSBASTracking (bool)
 
bool setGNSSMode (MB500_GNSS_MODE mode)
 
bool setCodeMeasurementSmoothing (int, int, int)
 
bool setNMEA (std::string, std::string, bool, double=1)
 
bool setNMEALL (std::string, bool)
 
bool verifyAcknowledge (std::string const &cmd="")
 
std::string getBoardID ()
 
gps::Errors getGST (std::string msg)
 
gps::Position getGGA (std::string msg)
 
gps::SatelliteInfo getGSV (std::string msg)
 
bool setPeriodicData (std::string const &port, double rate)
 
void collectPeriodicData ()
 
bool stopPeriodicData ()
 
void writeCorrectionData (char const *data, size_t size, int timeout)
 
bool enableNtpdShm (int unit)
 

Static Public Member Functions

static std::ostream & displayHeader (std::ostream &io)
 
static std::ostream & display (std::ostream &io, gps::Position const &pos, gps::Errors const &errors, gps::SatelliteInfo const &info, gps::SolutionQuality const &quality)
 
static std::ostream & display (std::ostream &io, MB500 const &driver)
 

Public Attributes

gps::Position position
 
gps::Errors errors
 
gps::SatelliteInfo satellites
 
gps::SolutionQuality solutionQuality
 
base::Time cpu_time
 
base::Time real_time
 
double processing_latency
 

Protected Member Functions

bool waitForBoardReset ()
 
bool interpretQuality (std::string const &message)
 
void updateNtpdShm ()
 
std::string read (int timeout)
 
void write (const std::string &, int timeout)
 
int extractPacket (uint8_t const *buffer, size_t buffer_size) const
 

Static Protected Member Functions

static std::pair< base::Time, base::Time > interpretDateTime (std::string const &msg)
 
static gps::Errors interpretErrors (std::string const &msg)
 
static gps::Position interpretInfo (std::string const &msg)
 
static double interpretLatency (std::string const &message)
 
static bool interpretSatelliteInfo (gps::SatelliteInfo &data, std::string const &msg)
 
static double interpretAngle (std::string const &value, bool positive)
 
static base::Time interpretTime (std::string const &time)
 

Protected Attributes

float m_period
 
int m_acq_timeout
 
int ntp_shmid
 
void * ntp_shm
 
gps::SatelliteInfo tempSatellites
 
gps::SolutionQuality tempSolutionQuality
 

Detailed Description

Driver for the MB500 Magellan differential GPS

Member Enumeration Documentation

Enumerator
EDGE_CORRELATOR 
STROBE_CORRELATOR 
Enumerator
NONE 

Constructor & Destructor Documentation

MB500::MB500 ( )
MB500::~MB500 ( )

Member Function Documentation

void MB500::close ( )
void MB500::collectPeriodicData ( )

Reads available data and update the data structure. If this method returns true, then data has been updated with a new, synchronized set of information. Otherwise, call collectPeriodicData again.

void MB500::disableAllOutputs ( )
std::ostream & MB500::display ( std::ostream &  io,
gps::Position const &  pos,
gps::Errors const &  errors,
gps::SatelliteInfo const &  info,
gps::SolutionQuality const &  quality 
)
static
std::ostream & MB500::display ( std::ostream &  io,
MB500 const &  driver 
)
static
std::ostream & MB500::displayHeader ( std::ostream &  io)
static
void MB500::dumpAlmanac ( )

Dumps the almanac on stdout.

Do it right after open()

void MB500::dumpSatellites ( )
void MB500::dumpStatus ( )

Dumps the receiver status on stdout

Do it right after open()

bool MB500::enableNtpdShm ( int  unit)

Enable ntpd updates through its shm reference clock driver this needs a line like this in ntp.conf: server 127.127.28.unit where unit can be 0-3, with 0,1 being root-writable and 2,3 being world-writable

Returns
true if the shm area was found
int MB500::extractPacket ( uint8_t const *  buffer,
size_t  buffer_size 
) const
protected
std::string MB500::getBoardID ( )
Position MB500::getGGA ( std::string  msg)

Interprets a NMEA GGA message and returns the unmarshalled GGA structure

Errors MB500::getGST ( std::string  msg)

Interprets a NMEA GST message and returns the unmarshalled GST structure

SatelliteInfo MB500::getGSV ( std::string  msg)

Interprets a NMEA GSV message and returns the unmarshalled SatelliteInfo structure

double MB500::interpretAngle ( std::string const &  value,
bool  positive 
)
staticprotected
pair< base::Time, base::Time > MB500::interpretDateTime ( std::string const &  msg)
staticprotected
Errors MB500::interpretErrors ( std::string const &  msg)
staticprotected
Position MB500::interpretInfo ( std::string const &  msg)
staticprotected
double MB500::interpretLatency ( std::string const &  message)
staticprotected
bool MB500::interpretQuality ( std::string const &  message)
protected
bool MB500::interpretSatelliteInfo ( gps::SatelliteInfo data,
std::string const &  msg 
)
staticprotected
base::Time MB500::interpretTime ( std::string const &  time)
staticprotected
bool MB500::open ( const std::string &  device_name)
bool MB500::openBase ( const std::string &  device_name)
bool MB500::openRover ( const std::string &  device_name)
bool MB500::openSerial ( std::string const &  device_name)
string MB500::read ( int  timeout)
protected
void MB500::reset ( bool  cold_start)

Reset the board. If cold_start is true, reset all stored information about the GNSS constellations

bool MB500::resetStoredPosition ( )

Puts the receiver in moving mode, i.e. resets any stored position

bool MB500::setCodeCorrelatorMode ( CORRELATOR_MODE  mode)

Changes the code correlator, for multipath mitigation

bool MB500::setCodeMeasurementSmoothing ( int  d1,
int  d2,
int  d3 
)
bool MB500::setFastRTK ( bool  enable)

Enables or disables Fast-RTK

bool MB500::setFixThreshold ( MB500_AMBIGUITY_THRESHOLD  threshold)

Set the ambiguity threshold above which the RTK engine will switch to FIX

bool MB500::setGLONASSTracking ( bool  setting)

Enable/disable GLONASS tracking

bool MB500::setGNSSMode ( MB500_GNSS_MODE  mode)

Sets the acquisition mode

bool MB500::setKnownPointInit ( double  ,
std::string  ,
double  ,
std::string  ,
double  ,
double  ,
double  ,
double  ,
std::string   
)

Forces the receiver to perform PVT initialization on a point with known geographical coordinates (expressed in the ITRF model used).

bool MB500::setNMEA ( std::string  ,
std::string  ,
bool  ,
double  = 1 
)
bool MB500::setNMEALL ( std::string  ,
bool   
)
bool MB500::setPeriodicData ( std::string const &  port,
double  rate 
)

Ask for the GPS receiver to send data periodically. You then call collectPeriodicData() to read the data.

  • period { the update frequency in seconds. Can be one of 0.1, 0.2, 0.5, 1 and any integer greater than 1 }
See also
collectPeriodicData
bool MB500::setPosition ( double  latitude,
double  longitude,
double  height 
)

Sets the current receiver position. Required to go into RTK base mode.

bool MB500::setPositionFromCurrent ( )

Fixes the receiver position to the currently estimated one

bool MB500::setProcessingRate ( int  rate)
bool MB500::setReceiverDynamics ( MB500_DYNAMICS_MODEL  mode)

Select the type of receiver motion

bool MB500::setRTKBase ( std::string  port_name)

Make the base output RTCM 3.0 correction messages on the provided port

bool MB500::setRTKInputPort ( std::string const &  port)

Sets the port on which the RTK corrections will be received

bool MB500::setRTKReset ( )

Resets the RTK filter

bool MB500::setSBASTracking ( bool  setting)

Enable/disable SBAS tracking

bool MB500::setUserDynamics ( int  h_vel,
int  h_acc,
int  v_vec,
int  v_acc 
)

Sets the board's user dynamics parameters. You must call setReceiverDynamics(USER_DEFINED) explicitely afterwards to select this mode.

bool MB500::stopPeriodicData ( )

Make the receiver stop sending periodic data

void MB500::stopRTKBase ( )

Stop the output of any RTCM 3.0 messages

void MB500::updateNtpdShm ( )
protected
bool MB500::verifyAcknowledge ( std::string const &  cmd = "")
bool MB500::waitForBoardReset ( )
protected
void MB500::write ( const std::string &  ,
int  timeout 
)
protected
void MB500::writeCorrectionData ( char const *  data,
size_t  size,
int  timeout 
)

Member Data Documentation

base::Time gps::MB500::cpu_time
gps::Errors gps::MB500::errors
int gps::MB500::m_acq_timeout
protected
float gps::MB500::m_period
protected
void* gps::MB500::ntp_shm
protected
int gps::MB500::ntp_shmid
protected
gps::Position gps::MB500::position
double gps::MB500::processing_latency
base::Time gps::MB500::real_time
gps::SatelliteInfo gps::MB500::satellites
gps::SolutionQuality gps::MB500::solutionQuality
gps::SatelliteInfo gps::MB500::tempSatellites
protected
gps::SolutionQuality gps::MB500::tempSolutionQuality
protected

The documentation for this class was generated from the following files: