18#ifndef __FPSDK_COMMON_FPL_HPP__
19#define __FPSDK_COMMON_FPL_HPP__
29#include <boost/iostreams/filtering_stream.hpp>
30#include <boost/iostreams/stream.hpp>
89 int Parse(
const uint8_t* data,
const uint32_t size);
96 const std::vector<uint8_t>&
Raw()
const;
146 void SetBlob(
const uint8_t* data,
const uint32_t size);
149 static constexpr uint16_t MAGIC = 0x55aa;
150 static constexpr uint32_t HEADER_SIZE = 8;
152 uint32_t payload_size_;
153 std::vector<uint8_t> message_;
176 bool Add(
const uint8_t* data,
const std::size_t size);
196 std::vector<uint8_t> buf_;
199 std::size_t file_pos_;
200 std::size_t file_seq_;
221 bool Open(
const std::string& path);
244 std::unique_ptr<std::istream> fh_;
246 std::vector<uint8_t> buf_;
251 double last_progress_;
Read log messages from logfile.
bool Next(FplMessage &log_msg)
Get next log message.
bool GetProgress(double &progress, double &rate)
Get progress report.
bool Open(const std::string &path)
Open logfile.
const std::vector< uint8_t > & Raw() const
Get message.
const uint8_t * RawData() const
Get message data.
int Parse(const uint8_t *data, const uint32_t size)
Parse message from buffer.
void SetBlob(const uint8_t *data, const uint32_t size)
Make message a BLOB.
uint64_t file_size_
Size in the logfile of the log message.
static constexpr std::size_t MAX_NAME_LEN
Maximum length of (file, topic, ...) names.
uint32_t PayloadSize() const
Get payload size.
uint64_t file_seq_
Message sequence counter in logfile.
const uint8_t * PayloadData() const
Get payload data.
uint32_t RawSize() const
Get message size.
uint64_t file_pos_
Offset in logfile of the log message.
FplType PayloadType() const
Get payload (log) type.
static constexpr std::uint32_t MAX_SIZE
Maximum message size.
bool Process(FplMessage &log_msg)
Process data in parser, return message.
bool Add(const uint8_t *data, const std::size_t size)
Add data to parser.
void Reset()
Reset parser.
@ INT_X
Fixposition internal use only.
@ BLOB
Arbitrary data, not FplMessage framing.
@ LOGSTATUS
Logging status.
@ ROSMSGBIN
Serialised ROS message with timestamp.
@ ROSMSGDEF
Message definition for a topic (a.k.a. "connection header" in rosbag speak)
@ LOGMETA
Logfile meta data.
@ INT_F
Fixposition internal use only.
@ INT_D
Fixposition internal use only.
@ STREAMMSG
Stream message raw data with timestamp.
const char * FplTypeStr(const FplType type)
Stringify type.
Helper for extracting recording status data.
static constexpr int8_t POS_SOURCE_GNSS
Position source is GNSS.
std::string state_
Logging state: "stopped", "logging", "stopping".
bool valid_
Data valid, successfully extracted from message.
static constexpr int8_t POS_SOURCE_FUSION
Position source is Fusion.
uint32_t queue_size_
Queue size.
uint32_t log_count_
Number of logged messages.
std::string yaml_
Raw status data YAML.
uint32_t queue_peak_
Queue peak size.
uint32_t queue_skip_
Number of skipped messages (queue full)
static constexpr int8_t POS_SOURCE_UNKNOWN
Position source unknown resp. not available.
int8_t pos_source_
Approximate sensor position source (see POS_SOURCE_... below)
uint32_t log_duration_
Duration of logging [s].
uint64_t log_size_
Total size of logged messages [bytes].
std::string info_
Stringification of (some of the) data, for debugging.
int8_t pos_fix_type_
Approximate sensor position fix type (see fpsdk::common::types::GnssFixType)
LogStatus(const FplMessage &log_msg)
Constructor.
double pos_height_
Approximate sensor position height [m].
uint32_t log_errors_
Number of messages failed to log (failed to write/send)
double pos_lon_
Approximate sensor position longitude [deg].
uint32_t log_time_posix_
Approximate time.
std::string log_time_iso_
Approximate time.
double pos_lat_
Approximate sensor position latitude [deg].
Helper for extracting a serialised ROS message.
std::string topic_name_
The topic name.
std::string info_
Stringification of (some of the) data, for debugging.
RosTime rec_time_
Recording timestamp.
std::vector< uint8_t > msg_data_
Serialised ROS message data.
bool valid_
Data valid, successfully extracted from message.
RosMsgBin(const FplMessage &log_msg)
Constructor.
Helper for extracting ROS message definition (the relevant fields from the "connection header")
RosMsgDef(const FplMessage &log_msg)
Constructor.
std::string info_
Stringification of (some of the) data, for debugging.
std::string msg_name_
The message name (a.k.a. data type)
bool valid_
Data valid, successfully extracted from message.
std::string msg_md5_
The message definition MD5 sum.
std::string topic_name_
The topic name.
std::string msg_def_
The message definition (the .msg file and also the defs for all the types)
Helper for extracting data of a stream message (NMEA, RTCM3, etc.)
bool valid_
Data valid, successfully extracted from message.
std::string stream_name_
Stream name.
std::string info_
Stringification of (some of the) data, for debugging.
StreamMsg(const FplMessage &log_msg)
Constructor.
std::vector< uint8_t > msg_data_
Message data.
RosTime rec_time_
Recording timestamp.
Minimal ros::Time() / rplcpp::Time implementation (that doesn't throw)
Fixposition SDK: Time utilities.