#ifndef _VNSENSORS_COMPOSITEDATA_H_ #define _VNSENSORS_COMPOSITEDATA_H_ #include #include "vn/export.h" #include "vn/packet.h" #include "vn/attitude.h" #include "vn/position.h" namespace vn { namespace sensors { /// \brief Composite structure of all data types available from VectorNav sensors. class vn_proglib_DLLEXPORT CompositeData { public: CompositeData(); CompositeData(const CompositeData& cd); ~CompositeData(); CompositeData& operator=(const CompositeData& RHS); /// \brief Parses a packet. /// /// \param[in] p The packet to parse. /// \return The data contained in the parsed packet. static CompositeData parse(protocol::uart::Packet& p); /// \brief Parses a packet. /// /// \param[in] p The packet to parse. /// \param[in/out] o The CompositeData structure to write the data to. static void parse(protocol::uart::Packet& p, CompositeData& o); /// \brief Parses a packet and updates multiple CompositeData objects. /// /// \param[in] p The packet to parse. /// \param[in] o The collection of CompositeData objects to update. static void parse(protocol::uart::Packet& p, std::vector& o); /// \brief Resets the data contained in the CompositeData object. void reset(); /// \brief Indicates if anyAttitude has valid data. /// \return true if anyAttitude has valid data; otherwise false. bool hasAnyAttitude(); /// \brief Gets and converts the latest attitude data regardless of the received /// underlying type. Based on which type of attitude data that was last received /// and processed, this value may be based on either received yaw, pitch, roll, /// quaternion, or direction cosine matrix data. /// /// \return The attitude data. /// \exception invalid_operation Thrown if there is no valid data. math::AttitudeF anyAttitude(); /// \brief Indicates if yawPitchRoll has valid data. /// \return true if yawPitchRoll has valid data; otherwise false. bool hasYawPitchRoll(); /// \brief Yaw, pitch, roll data. /// \return The yaw, pitch, roll data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f yawPitchRoll(); /// \brief Indicates if quaternion has valid data. /// \return true if quaternion has valid data; otherwise false. bool hasQuaternion(); /// \brief Quaternion data. /// \return Quaternion data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec4f quaternion(); /// \brief Indicates if directionCosineMatrix has valid data. /// \return true if directionCosineMatrix has valid data; otherwise false. bool hasDirectionCosineMatrix(); /// \brief Direction cosine matrix data. /// \return Direction cosine matrix data. /// \exception invalid_operation Thrown if there is not any valid data. math::mat3f directionCosineMatrix(); /// \brief Indicates if anyMagnetic has valid data. /// \return true if anyMagnetic has valid data; otherwise false. bool hasAnyMagnetic(); /// \brief Gets and converts the latest magnetic data regardless of the received /// underlying type. Based on which type of magnetic data that was last received /// and processed, this value may be based on either received magnetic or /// magneticUncompensated data. /// /// \return The magnetic data. /// \exception invalid_operation Thrown if there is no valid data. math::vec3f anyMagnetic(); /// \brief Indicates if magnetic has valid data. /// \return true if magnetic has valid data; otherwise false. bool hasMagnetic(); /// \brief Magnetic data. /// \return The magnetic data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f magnetic(); /// \brief Indicates if magneticUncompensated has valid data. /// \return true if magneticUncompensated has valid data; otherwise false. bool hasMagneticUncompensated(); /// \brief Magnetic uncompensated data. /// \return The magnetic uncompensated data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f magneticUncompensated(); /// \brief Indicates if magneticNed has valid data. /// \return true if magneticNed has valid data; otherwise false. bool hasMagneticNed(); /// \brief Magnetic NED data. /// \return The magnetic NED data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f magneticNed(); /// \brief Indicates if magneticEcef has valid data. /// \return true if magneticEcef has valid data; otherwise false. bool hasMagneticEcef(); /// \brief Magnetic ECEF data. /// \return The magnetic ECEF data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f magneticEcef(); /// \brief Indicates if anyAcceleration has valid data. /// \return true if anyAcceleration has valid data; otherwise false. bool hasAnyAcceleration(); /// \brief Gets and converts the latest acceleration data regardless of the received /// underlying type. /// /// \return The acceleration data. /// \exception invalid_operation Thrown if there is no valid data. math::vec3f anyAcceleration(); /// \brief Indicates if acceleration has valid data. /// \return true if acceleration has valid data; otherwise false. bool hasAcceleration(); /// \brief Acceleration data. /// \return The acceleration data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f acceleration(); /// \brief Indicates if accelerationLinearBody has valid data. /// \return true if accelerationLinearBody has valid data; otherwise false. bool hasAccelerationLinearBody(); /// \brief Acceleration linear body data. /// \return The acceleration linear body data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f accelerationLinearBody(); /// \brief Indicates if accelerationUncompensated has valid data. /// \return true if accelerationUncompensated has valid data; otherwise false. bool hasAccelerationUncompensated(); /// \brief Acceleration uncompensated data. /// \return The acceleration uncompensated data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f accelerationUncompensated(); /// \brief Indicates if accelerationLinearNed has valid data. /// \return true if accelerationLinearNed has valid data; otherwise false. bool hasAccelerationLinearNed(); /// \brief Acceleration linear NED data. /// \return The acceleration linear NED data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f accelerationLinearNed(); /// \brief Indicates if accelerationLinearEcef has valid data. /// \return true if accelerationLinearEcef has valid data; otherwise false. bool hasAccelerationLinearEcef(); /// \brief Acceleration linear ECEF data. /// \return The acceleration linear ECEF data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f accelerationLinearEcef(); /// \brief Indicates if accelerationNed has valid data. /// \return true if accelerationNed has valid data; otherwise false. bool hasAccelerationNed(); /// \brief Acceleration NED data. /// \return The acceleration NED data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f accelerationNed(); /// \brief Indicates if accelerationEcef has valid data. /// \return true if accelerationEcef has valid data; otherwise false. bool hasAccelerationEcef(); /// \brief Acceleration ECEF data. /// \return The acceleration ECEF data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f accelerationEcef(); /// \brief Indicates if anyAngularRate has valid data. /// \return true if anyAngularRate has valid data; otherwise false. bool hasAnyAngularRate(); /// \brief Gets and converts the latest angular rate data regardless of the received /// underlying type. /// /// \return The angular rate data. /// \exception invalid_operation Thrown if there is no valid data. math::vec3f anyAngularRate(); /// \brief Indicates if angularRate has valid data. /// \return true if angularRate has valid data; otherwise false. bool hasAngularRate(); /// \brief Angular rate data. /// \return The angular rate data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f angularRate(); /// \brief Indicates if angularRateUncompensated has valid data. /// \return true if angularRateUncompensated has valid data; otherwise false. bool hasAngularRateUncompensated(); /// \brief Angular rate uncompensated data. /// \return The angular rate uncompensated data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f angularRateUncompensated(); /// \brief Indicates if anyTemperature has valid data. /// \return true if anyTemperature has valid data; otherwise false. bool hasAnyTemperature(); /// \brief Gets and converts the latest temperature data regardless of the received /// underlying type. /// /// \return The tempature data. /// \exception invalid_operation Thrown if there is no valid data. float anyTemperature(); /// \brief Indicates if temperature has valid data. /// \return true if temperature has valid data; otherwise false. bool hasTemperature(); /// \brief Temperature data. /// \return The temperature data. /// \exception invalid_operation Thrown if there is not any valid data. float temperature(); /// \brief Indicates if anyPressure has valid data. /// \return true if anyPressure has valid data; otherwise false. bool hasAnyPressure(); /// \brief Gets and converts the latest pressure data regardless of the received /// underlying type. /// /// \return The pressure data. /// \exception invalid_operation Thrown if there is no valid data. float anyPressure(); /// \brief Indicates if pressure has valid data. /// \return true if pressure has valid data; otherwise false. bool hasPressure(); /// \brief Pressure data. /// \return The pressure data. /// \exception invalid_operation Thrown if there is not any valid data. float pressure(); /// \brief Indicates if anyPosition has valid data. /// \return true if anyPosition has valid data; otherwise false. bool hasAnyPosition(); /// \brief Gets the latest position data regardless of the received /// underlying type. /// /// \return The position data. /// \exception invalid_operation Thrown if there is no valid data. math::PositionD anyPosition(); /// \brief Indicates if positionGpsLla has valid data. /// \return true if positionGpsLla has valid data; otherwise false. bool hasPositionGpsLla(); /// \brief Indicates if positionGps2Lla has valid data. /// \return true if positionGps2Lla has valid data; otherwise false. bool hasPositionGps2Lla(); /// \brief Position GPS LLA data. /// \return The Position GPS LLA data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3d positionGpsLla(); /// \brief Position GPS2 LLA data. /// \return The Position GPS2 LLA data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3d positionGps2Lla(); /// \brief Indicates if positionGpsEcef has valid data. /// \return true if positionGpsEcef has valid data; otherwise false. bool hasPositionGpsEcef(); /// \brief Indicates if positionGps2Ecef has valid data. /// \return true if positionGps2Ecef has valid data; otherwise false. bool hasPositionGps2Ecef(); /// \brief Position GPS ECEF data. /// \return The Position GPS ECEF data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3d positionGpsEcef(); /// \brief Position GPS2 ECEF data. /// \return The Position GPS2 ECEF data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3d positionGps2Ecef(); /// \brief Indicates if positionEstimatedLla has valid data. /// \return true if positionEstimatedLla has valid data; otherwise false. bool hasPositionEstimatedLla(); /// \brief Position Estimated LLA data. /// \return The Position Estimated LLA data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3d positionEstimatedLla(); /// \brief Indicates if positionEstimatedEcef has valid data. /// \return true if positionEstimatedEcef has valid data; otherwise false. bool hasPositionEstimatedEcef(); /// \brief Position Estimated ECEF data. /// \return The Position Estimated ECEF data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3d positionEstimatedEcef(); /// \brief Indicates if anyVelocity has valid data. /// \return true if anyVelocity has valid data; otherwise false. bool hasAnyVelocity(); /// \brief Gets the latest velocity data regardless of the received /// underlying type. /// /// \return The velocity data. /// \exception invalid_operation Thrown if there is no valid data. math::vec3f anyVelocity(); /// \brief Indicates if velocityGpsNed has valid data. /// \return true if velocityGpsNed has valid data; otherwise false. bool hasVelocityGpsNed(); /// \brief Indicates if velocityGps2Ned has valid data. /// \return true if velocityGps2Ned has valid data; otherwise false. bool hasVelocityGps2Ned(); /// \brief Velocity GPS NED data. /// \return The velocity GPS NED data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f velocityGpsNed(); /// \brief Velocity GPS2 NED data. /// \return The velocity GPS2 NED data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f velocityGps2Ned(); /// \brief Indicates if velocityGpsEcef has valid data. /// \return true if velocityGpsEcef has valid data; otherwise false. bool hasVelocityGpsEcef(); /// \brief Indicates if velocityGps2Ecef has valid data. /// \return true if velocityGps2Ecef has valid data; otherwise false. bool hasVelocityGps2Ecef(); /// \brief Velocity GPS ECEF data. /// \return The velocity GPS ECEF data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f velocityGpsEcef(); /// \brief Velocity GPS2 ECEF data. /// \return The velocity GPS2 ECEF data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f velocityGps2Ecef(); /// \brief Indicates if velocityEstimatedNed has valid data. /// \return true if velocityEstimatedNed has valid data; otherwise false. bool hasVelocityEstimatedNed(); /// \brief Velocity Estimated NED data. /// \return The velocity estimated NED data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f velocityEstimatedNed(); /// \brief Indicates if velocityEstimatedEcef has valid data. /// \return true if velocityEstimatedEcef has valid data; otherwise false. bool hasVelocityEstimatedEcef(); /// \brief Velocity Estimated ECEF data. /// \return The velocity estimated ECEF data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f velocityEstimatedEcef(); /// \brief Indicates if velocityEstimatedBody has valid data. /// \return true if velocityEstimatedBody has valid data; otherwise false. bool hasVelocityEstimatedBody(); /// \brief Velocity Estimated Body data. /// \return The velocity estimated body data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f velocityEstimatedBody(); /// \brief Indicates if deltaTime has valid data. /// \return true if deltaTime has valid data; otherwise false. bool hasDeltaTime(); /// \brief Delta time data. /// \return The delta time data. /// \exception invalid_operation Thrown if there is not any valid data. float deltaTime(); /// \brief Indicates if deltaTheta has valid data. /// \return true if deltaTheta has valid data; otherwise false. bool hasDeltaTheta(); /// \brief Delta theta data. /// \return The delta theta data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f deltaTheta(); /// \brief Indicates if deltaVelocity has valid data. /// \return true if deltaVelocity has valid data; otherwise false. bool hasDeltaVelocity(); /// \brief Delta velocity data. /// \return The delta velocity data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f deltaVelocity(); /// \brief Indicates if timeStartup has valid data. /// \return true if timeStartup has valid data; otherwise false. bool hasTimeStartup(); /// \brief Time startup data. /// \return The time startup data. /// \exception invalid_operation Thrown if there is not any valid data. uint64_t timeStartup(); /// \brief Indicates if timeGps has valid data. /// \return true if timeGps has valid data; otherwise false. bool hasTimeGps(); /// \brief Indicates if timeGps2 has valid data. /// \return true if timeGps2 has valid data; otherwise false. bool hasTimeGps2(); /// \brief Time GPS data. /// \return The time GPS data. /// \exception invalid_operation Thrown if there is not any valid data. uint64_t timeGps(); /// \brief Time GPS2 data. /// \return The time GPS2 data. /// \exception invalid_operation Thrown if there is not any valid data. uint64_t timeGps2(); /// \brief Indicates if tow has valid data. /// \return true if tow has valid data; otherwise false. bool hasTow(); /// \brief GPS time of week data. /// \return The GPS time of week data. /// \exception invalid_operation Thrown if there is not any valid data. double tow(); /// \brief Indicates if week has valid data. /// \return true if week has valid data; otherwise false. bool hasWeek(); /// \brief Week data. /// \return The week data. /// \exception invalid_operation Thrown if there is not any valid data. uint16_t week(); /// \brief Indicates if numSats has valid data. /// \return true if numSats has valid data; otherwise false. bool hasNumSats(); /// \brief NumSats data. /// \return The numsats data. /// \exception invalid_operation Thrown if there is not any valid data. uint8_t numSats(); /// \brief Indicates if timeSyncIn has valid data. /// \return true if timeSyncIn has valid data; otherwise false. bool hasTimeSyncIn(); /// \brief TimeSyncIn data. /// \return The TimeSyncIn data. /// \exception invalid_operation Thrown if there is not any valid data. uint64_t timeSyncIn(); /// \brief Indicates if vpeStatus has valid data. /// \return true if vpeStatus has valid data; otherwise false. bool hasVpeStatus(); /// \brief VpeStatus data. /// \return The VpeStatus data. /// \exception invalid_operation Thrown if there is not any valid data. protocol::uart::VpeStatus vpeStatus(); /// \brief Indicates if insStatus has valid data. /// \return true if insStatus has valid data; otherwise false. bool hasInsStatus(); /// \brief InsStatus data. /// \return The InsStatus data. /// \exception invalid_operation Thrown if there is not any valid data. protocol::uart::InsStatus insStatus(); /// \brief Indicates if syncInCnt has valid data. /// \return true if syncInCnt has valid data; otherwise false. bool hasSyncInCnt(); /// \brief SyncInCnt data. /// \return The SyncInCnt data. /// \exception invalid_operation Thrown if there is not any valid data. uint32_t syncInCnt(); /// \brief Indicates if syncOutCnt has valid data. /// \return true if syncOutCnt has valid data; otherwise false. bool hasSyncOutCnt(); /// \brief SyncOutCnt data. /// \return The SyncOutCnt data. /// \exception invalid_operation Thrown if there is not any valid data. uint32_t syncOutCnt(); /// \brief Indicates if timeStatus has valid data. /// \return true if timeStatus has valid data; otherwise false. bool hasTimeStatus(); /// \brief TimeStatus data. /// \return The TimeStatus data. /// \exception invalid_operation Thrown if there is not any valid data. uint8_t timeStatus(); /// \brief Indicates if timeGpsPps has valid data. /// \return true if timeGpsPps has valid data; otherwise false. bool hasTimeGpsPps(); /// \brief Indicates if timeGps2Pps has valid data. /// \return true if timeGps2Pps has valid data; otherwise false. bool hasTimeGps2Pps(); /// \brief TimeGpsPps data. /// \return The TimeGpsPps data. /// \exception invalid_operation Thrown if there is not any valid data. uint64_t timeGpsPps(); /// \brief TimeGps2Pps data. /// \return The TimeGps2Pps data. /// \exception invalid_operation Thrown if there is not any valid data. uint64_t timeGps2Pps(); /// \brief Indicates if gpsTow has valid data. /// \return true if gpsTow has valid data; otherwise false. bool hasGpsTow(); /// \brief Indicates if gps2Tow has valid data. /// \return true if gps2Tow has valid data; otherwise false. bool hasGps2Tow(); /// \brief GpsTow data. /// \return The GpsTow data. /// \exception invalid_operation Thrown if there is not any valid data. uint64_t gpsTow(); /// \brief Gps2Tow data. /// \return The Gps2Tow data. /// \exception invalid_operation Thrown if there is not any valid data. uint64_t gps2Tow(); /// \brief Indicates if timeUtc has valid data. /// \return true if timeUtc has valid data; otherwise false. bool hasTimeUtc(); /// \brief TimeUtc data. /// \return The TimeUtc data. /// \exception invalid_operation Thrown if there is not any valid data. protocol::uart::TimeUtc timeUtc(); /// \brief Indicates if sensSat has valid data. /// \return true if sensSat has valid data; otherwise false. bool hasSensSat(); /// \brief SensSat data. /// \return The SensSat data. /// \exception invalid_operation Thrown if there is not any valid data. protocol::uart::SensSat sensSat(); /// \brief Indicates if fix has valid data. /// \return true if fix has valid data; otherwise false. bool hasFix(); /// \brief Indicates if fix2 has valid data. /// \return true if fix2 has valid data; otherwise false. bool hasFix2(); /// \brief GPS fix data. /// \return The GPS fix data. /// \exception invalid_operation Thrown if there is not any valid data. protocol::uart::GpsFix fix(); /// \brief GPS2 fix data. /// \return The GPS2 fix data. /// \exception invalid_operation Thrown if there is not any valid data. protocol::uart::GpsFix fix2(); /// \brief Indicates if anyPositionUncertainty has valid data. /// \return true if anyPositionUncertainty has valid data; otherwise false. bool hasAnyPositionUncertainty(); /// \brief Gets the latest position uncertainty data regardless of the received /// underlying type. /// /// \return The position uncertainty data. /// \exception invalid_operation Thrown if there is no valid data. math::vec3f anyPositionUncertainty(); /// \brief Indicates if positionUncertaintyGpsNed has valid data. /// \return true if positionUncertaintyGpsNed has valid data; otherwise false. bool hasPositionUncertaintyGpsNed(); /// \brief Indicates if positionUncertaintyGps2Ned has valid data. /// \return true if positionUncertaintyGps2Ned has valid data; otherwise false. bool hasPositionUncertaintyGps2Ned(); /// \brief GPS position uncertainty NED data. /// \return The GPS position uncertainty NED data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f positionUncertaintyGpsNed(); /// \brief GPS2 position uncertainty NED data. /// \return The GPS2 position uncertainty NED data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f positionUncertaintyGps2Ned(); /// \brief Indicates if positionUncertaintyGpsEcef has valid data. /// \return true if positionUncertaintyGpsEcef has valid data; otherwise false. bool hasPositionUncertaintyGpsEcef(); /// \brief Indicates if positionUncertaintyGps2Ecef has valid data. /// \return true if positionUncertaintyGps2Ecef has valid data; otherwise false. bool hasPositionUncertaintyGps2Ecef(); /// \brief GPS position uncertainty ECEF data. /// \return The GPS position uncertainty ECEF data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f positionUncertaintyGpsEcef(); /// \brief GPS2 position uncertainty ECEF data. /// \return The GPS2 position uncertainty ECEF data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f positionUncertaintyGps2Ecef(); /// \brief Indicates if positionUncertaintyEstimated has valid data. /// \return true if positionUncertaintyEstimated has valid data; otherwise false. bool hasPositionUncertaintyEstimated(); /// \brief Estimated position uncertainty data. /// \return The estimated position uncertainty data. /// \exception invalid_operation Thrown if there is not any valid data. float positionUncertaintyEstimated(); /// \brief Indicates if anyVelocityUncertainty has valid data. /// \return true if anyVelocityUncertainty has valid data; otherwise false. bool hasAnyVelocityUncertainty(); /// \brief Gets the latest velocity uncertainty data regardless of the received /// underlying type. /// /// \return The velocity uncertainty data. /// \exception invalid_operation Thrown if there is no valid data. float anyVelocityUncertainty(); /// \brief Indicates if velocityUncertaintyGps has valid data. /// \return true if velocityUncertaintyGps has valid data; otherwise false. bool hasVelocityUncertaintyGps(); /// \brief Indicates if velocityUncertaintyGps2 has valid data. /// \return true if velocityUncertaintyGps2 has valid data; otherwise false. bool hasVelocityUncertaintyGps2(); /// \brief GPS velocity uncertainty data. /// \return The GPS velocity uncertainty data. /// \exception invalid_operation Thrown if there is not any valid data. float velocityUncertaintyGps(); /// \brief GPS2 velocity uncertainty data. /// \return The GPS2 velocity uncertainty data. /// \exception invalid_operation Thrown if there is not any valid data. float velocityUncertaintyGps2(); /// \brief Indicates if velocityUncertaintyEstimated has valid data. /// \return true if velocityUncertaintyEstimated has valid data; otherwise false. bool hasVelocityUncertaintyEstimated(); /// \brief Estimated velocity uncertainty data. /// \return The estimated velocity uncertainty data. /// \exception invalid_operation Thrown if there is not any valid data. float velocityUncertaintyEstimated(); /// \brief Indicates if timeUncertainty has valid data. /// \return true if timeUncertainty has valid data; otherwise false. bool hasTimeUncertainty(); /// \brief Time uncertainty data. /// \return The time uncertainty data. /// \exception invalid_operation Thrown if there is not any valid data. uint32_t timeUncertainty(); /// \brief Indicates if attitudeUncertainty has valid data. /// \return true if attitudeUncertainty has valid data; otherwise false. bool hasAttitudeUncertainty(); /// \brief Attitude uncertainty data. /// \return The attitude uncertainty data. /// \exception invalid_operation Thrown if there is not any valid data. math::vec3f attitudeUncertainty(); /// \brief Indicates if courseOverGround has valid data. /// \return true if courseOverGround havs valid data; otherwise false. bool hasCourseOverGround(); /// \brief Computes the course over ground from any velocity data available. /// /// \return The computed course over ground. /// \exception invalid_operation Thrown if there is no valid data. float courseOverGround(); /// \brief Indicates if speedOverGround has valid data. /// \return true if speedOverGround havs valid data; otherwise false. bool hasSpeedOverGround(); /// \brief Computes the speed over ground from any velocity data available. /// /// \return The computed speed over ground. /// \exception invalid_operation Thrown if there is no valid data. float speedOverGround(); /// \brief Indicates if timeInfo has valid data. /// \return true if timeInfo havs valid data; otherwise false. bool hasTimeInfo(); /// \brief GPS Time Status and number of leap seconds. /// /// \return Current Time Info. /// \exception invalid_operation Thrown if there is no valid data. protocol::uart::TimeInfo timeInfo(); /// \brief GPS2 Time Status and number of leap seconds. /// /// \return Current Time Info. /// \exception invalid_operation Thrown if there is no valid data. protocol::uart::TimeInfo timeInfo2(); /// \brief Indicates if dop has valid data. /// \return true if dop havs valid data; otherwise false. bool hasDop(); /// \brief Dilution of precision data. /// /// \return Current DOP values. /// \exception invalid_operation Thrown if there is no valid data. protocol::uart::GnssDop dop(); private: static void parseBinary(protocol::uart::Packet& p, std::vector& o); static void parseAscii(protocol::uart::Packet& p, std::vector& o); static void parseBinaryPacketCommonGroup(protocol::uart::Packet& p, protocol::uart::CommonGroup gf, std::vector& o); static void parseBinaryPacketTimeGroup(protocol::uart::Packet& p, protocol::uart::TimeGroup gf, std::vector& o); static void parseBinaryPacketImuGroup(protocol::uart::Packet& p, protocol::uart::ImuGroup gf, std::vector& o); static void parseBinaryPacketGpsGroup(protocol::uart::Packet& p, protocol::uart::GpsGroup gf, std::vector& o); static void parseBinaryPacketAttitudeGroup(protocol::uart::Packet& p, protocol::uart::AttitudeGroup gf, std::vector& o); static void parseBinaryPacketInsGroup(protocol::uart::Packet& p, protocol::uart::InsGroup gf, std::vector& o); static void parseBinaryPacketGps2Group(protocol::uart::Packet& p, protocol::uart::GpsGroup gf, std::vector& o); private: struct Impl; Impl* _i; template static void setValues(T val, std::vector& o, void (Impl::* function)(T)) { for (std::vector::iterator i = o.begin(); i != o.end(); ++i) (*((*i)->_i).*function)(val); } }; } } #endif