13#ifndef __FPSDK_APPS_FPLTOOL_FPLTOOL_ARGS_HPP__
14#define __FPSDK_APPS_FPLTOOL_FPLTOOL_ARGS_HPP__
42 :
ProgramOptions(
"fpltool", { {
'x',
false }, {
's',
false } }) {};
75 "Tool for .fpl logfiles\n"
79 " parsertool [flags] <input> [<input> ...]\n"
83 " fpltool [<flags>] <command> [...]\n"
85 "Where (availability of flags depends on <command>, see below):\n"
89 " -p / -P -- Show / don't show progress (default: automatic)\n"
90 " -f -- Force overwrite output (default: refuse to overwrite existing output files)\n"
91 " -c -- Compress output (e.g. ROS bags), -c -c to compress more\n"
92 " -x -- Add extra output, multiple -x can be given\n"
93 " -o <out> -- Output to <out>\n"
94 " -S <sec> -- Skip <sec> seconds from start of log (approximate!) (default: 0, i.e. no skip)\n"
95 " -D <sec> -- Process <sec> seconds of log (approximate!) (default: everything)\n"
97 "Print information about the data in a .fpl logfile, along with status and meta data\n"
99 " fpltool [-vqpPx] dump <fpl-file>\n"
101 "Print the meta data from a .fpl logfile (as YAML)\n"
103 " fpltool [-vqpP] meta <fpl-file>\n"
106 "Generate a ROS bag from a .fpl logfile\n"
108 " fpltool [-vqpPfoSD] <fpl-file>\n"
111 "Trim start and/or end of .fpl logfile, i.e. extract a portion of the file. Note that this process is\n"
112 "inaccurate and the effective start time and duration of the resulting file may be off by 30 to 60 seconds.\n"
113 "Therefore, both the start time (-S) and the duration (-D) must be at least 60 seconds.\n"
115 " fpltool [-vqpPfo] -S <sec> -D <sec> <fpl-file>\n"
120 " Create a some.bag from a some.fpl logfile:\n"
122 " fpltool rosbag some.fpl\n"
124 " Create a compressed another.bag with 2 minutes of data starting 60 seconds into some.fpl logfile:\n"
126 " fpltool rosbag some.fpl -c -c -o another.bag -S 60 -D 120\n"
129 " Show meta data of some.fpl:\n"
131 " fpltool meta some.fpl\n"
133 " Trim a verylong.fpl into a shorter one:\n"
135 " fpltool trim some.fpl -S 3600 -D 1800\n"
143 switch (option.flag) {
155 progress_set_ =
true;
159 progress_set_ =
true;
186 if (args.size() > 0) {
200 WARNING(
"Missing command or wrong arguments. Try 'fpltool -h'...");
205 for (std::size_t ix = 1; ix < args.size(); ix++) {
210 if (!progress_set_ && (isatty(fileno(stdin)) == 1)) {
216 for (std::size_t ix = 0; ix <
inputs_.size(); ix++) {
217 DEBUG(
"inputs_[%" PRIuMAX
"] = '%s'", ix,
inputs_[ix].c_str());
231 bool progress_set_ =
false;
Fixposition SDK: Utilities for apps.
ProgramOptions(const std::string &app_name, const std::vector< Option > &options)
Constructor.
static constexpr const char * COMMON_FLAGS_HELP
Help screen for common options.
Fixposition SDK: Logging.
#define DEBUG(fmt,...)
Print a debug message.
#define WARNING(fmt,...)
Print a warning message.
bool StrToValue(const std::string &str, int8_t &value)
Convert string to value (int8_t)