Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fpsdk_common/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ SOFTWARE.

--------------------------------------------------------------------------------

Parts of fpcommon are based on ROS code (see the source files for details):
Parts of fpsdk_common are based on ROS code (see the source files for details):

Copyright (c) 2008, Willow Garage, Inc.
All rights reserved.
Expand Down Expand Up @@ -58,7 +58,7 @@ POSSIBILITY OF SUCH DAMAGE.

--------------------------------------------------------------------------------

Parts of fpcommon are based on NovAtel code:
Parts of fpsdk_common are based on NovAtel code:

Copyright (c) 2020 NovAtel Inc.

Expand Down
2 changes: 1 addition & 1 deletion fpsdk_common/include/fpsdk_common/app.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class ProgramOptions
" -V, --version -- Print program, version and license information, and exit\n"
" -v, --verbose -- Increase logging verbosity, multiple flags accumulate\n"
" -q, --quiet -- Decrease logging verbosity, multiple flags accumulate\n"
" -J, --journal -- Use systemd journal logging markers instead of colours\n"; // clang-format on
" -J, --journal -- Use systemd journal logging markers instead of colours (default: auto)\n"; // clang-format on

std::string app_name_; //!< App name
logging::LoggingParams logging_params_; //!< Logging params
Expand Down
2 changes: 1 addition & 1 deletion fpsdk_common/include/fpsdk_common/parser/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ struct ParserMsg
*/
struct ParserStats
{
uint64_t n_msgs_ = 0; //!< Number of messages parsed
uint64_t n_msgs_ = 0; //!< Total number of messages parsed
uint64_t s_msgs_ = 0; //!< Total size of messages parsed
uint64_t n_fpa_ = 0; //!< Number of Protocol::FP_A messages
uint64_t s_fpa_ = 0; //!< Total size of Protocol::FP_A messages
Expand Down
32 changes: 32 additions & 0 deletions fpsdk_common/include/fpsdk_common/to_json/parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,38 @@ inline void to_json(nlohmann::json& j, const ParserMsg& m)
}
}

// ---------------------------------------------------------------------------------------------------------------------

inline void to_json(nlohmann::json& j, const ParserStats s)
{
j = nlohmann::json::object({
{ "n_msgs", s.n_msgs_ },
{ "s_msgs", s.s_msgs_ },
{ "n_fpa", s.n_fpa_ },
{ "s_fpa", s.s_fpa_ },
{ "n_fpb", s.n_fpb_ },
{ "s_fpb", s.s_fpb_ },
{ "n_nmea", s.n_nmea_ },
{ "s_nmea", s.s_nmea_ },
{ "n_ubx", s.n_ubx_ },
{ "s_ubx", s.s_ubx_ },
{ "n_rtcm3", s.n_rtcm3_ },
{ "s_rtcm3", s.s_rtcm3_ },
{ "n_unib", s.n_unib_ },
{ "s_unib", s.s_unib_ },
{ "n_novb", s.n_novb_ },
{ "s_novb", s.s_novb_ },
{ "n_sbf", s.n_sbf_ },
{ "s_sbf", s.s_sbf_ },
{ "n_qgc", s.n_qgc_ },
{ "s_qgc", s.s_qgc_ },
{ "n_spartn", s.n_spartn_ },
{ "s_spartn", s.s_spartn_ },
{ "n_other", s.n_other_ },
{ "s_other", s.s_other_ },
});
}

} // namespace fpsdk::common::parser
/* ****************************************************************************************************************** */
#endif // !_DOXYGEN_
Expand Down
6 changes: 4 additions & 2 deletions fpsdk_common/src/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ void LoggingDefaultWriteFn(const LoggingParams& params, const LoggingLevel level
}
}

// Colours come after the timestamp (unlike the journal markers, see above)
if ((params.colour_ != LoggingColour::JOURNAL) && (prefix != NULL)) {
len += std::snprintf(&output[len], sizeof(output) - len, "%s", prefix);
}
Expand Down Expand Up @@ -250,9 +251,10 @@ LoggingParams::LoggingParams(
s_defaults_init = true;
}

// User wants us to decide...
// User wants us to decide. INVOCATION_ID is set by systemd and part of every unit's environment.
if (colour_ == LoggingColour::AUTO) {
colour_ = (isatty(fileno(stderr)) == 1 ? LoggingColour::YES : LoggingColour::NO);
colour_ = (isatty(fileno(stderr)) == 1 ? LoggingColour::YES : // clang-format off
(std::getenv("INVOCATION_ID") != nullptr ? LoggingColour::JOURNAL : LoggingColour::NO)); // clang-format on
}
}

Expand Down
2 changes: 1 addition & 1 deletion fpsdk_common/src/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void Parser::Reset()
{
size_ = 0;
offs_ = 0;
stats_ = ParserStats();
stats_ = {};
}

// ---------------------------------------------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions fpsdk_common/src/time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -748,11 +748,11 @@ static constexpr int TAI_OFFS = 10; // offset of CLOCK_TAI to our atomic time
// TODO: consider making some CI that uses the IERS bulletins or https://data.iana.org/time-zones/data/leap-seconds.list
// to check, and possibly update, this table.

// See IERS "Bulletin C" #70 July 2025 (https://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat)
// See IERS "Bulletin C" #71 January 2026 (https://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat)
// See also https://data.iana.org/time-zones/data/leap-seconds.list
// See also /usr/share/zoneinfo/{leapseconds,leap-seconds.list}
// The earliest time there can be a change is approximately:
static constexpr uint32_t max_ts = 1782820800; // TZ=UTC date --date "2026-06-30 12:00:00" +%s
static constexpr uint32_t max_ts = 1798718400; // TZ=UTC date --date "2026-12-31 12:00:00" +%s
static constexpr uint32_t NUM_LEAPS = 27;
static constexpr std::array<std::array<uint32_t, 2>, NUM_LEAPS> LEAPSECONDS = { {
// clang-format off
Expand Down
Loading