13#ifndef __FPSDK_APPS_FPLTOOL_FPLTOOL_ARGS_HPP__
14#define __FPSDK_APPS_FPLTOOL_FPLTOOL_ARGS_HPP__
43 {
'f',
false }, {
'o',
true }, {
'x',
false }, {
'p',
false },
44 {
'P',
false }, {
'c',
false }, {
'S',
true }, {
'D',
true } }) {};
78 "Tool for .fpl logfiles\n"
82 " parsertool [flags] <input> [<input> ...]\n"
86 " fpltool [<flags>] <command> [...]\n"
88 "Where (availability of flags depends on <command>, see below):\n"
92 " -p / -P -- Show / don't show progress (default: automatic)\n"
93 " -f -- Force overwrite output (default: refuse to overwrite existing output files)\n"
94 " -c -- Compress output (e.g. ROS bags), -c -c to compress more\n"
95 " -x -- Add extra output, multiple -x can be given\n"
96 " -o <out> -- Output to <out>\n"
97 " -S <sec> -- Skip <sec> seconds from start of log (approximate!) (default: 0, i.e. no skip)\n"
98 " -D <sec> -- Process <sec> seconds of log (approximate!) (default: everything)\n"
100 "Print information about the data in a .fpl logfile, along with status and meta data\n"
102 " fpltool [-vqpPx] dump <fpl-file>\n"
104 "Print the meta data from a .fpl logfile (as YAML)\n"
106 " fpltool [-vqpP] meta <fpl-file>\n"
109 "Generate a ROS bag from a .fpl logfile\n"
111 " fpltool [-vqpPfoSD] <fpl-file>\n"
114 "Trim start and/or end of .fpl logfile, i.e. extract a portion of the file. Note that this process is\n"
115 "inaccurate and the effective start time and duration of the resulting file may be off by 30 to 60 seconds.\n"
116 "Therefore, both the start time (-S) and the duration (-D) must be at least 60 seconds.\n"
118 " fpltool [-vqpPfo] -S <sec> -D <sec> <fpl-file>\n"
123 " Create a some.bag from a some.fpl logfile:\n"
125 " fpltool rosbag some.fpl\n"
127 " Create a compressed another.bag with 2 minutes of data starting 60 seconds into some.fpl logfile:\n"
129 " fpltool rosbag some.fpl -c -c -o another.bag -S 60 -D 120\n"
132 " Show meta data of some.fpl:\n"
134 " fpltool meta some.fpl\n"
136 " Trim a verylong.fpl into a shorter one:\n"
138 " fpltool trim some.fpl -S 3600 -D 1800\n"
140 " Extract data from some.fpl:\n"
142 " fpltool output some.fpl\n"
144 " This results in various data files suitable for further processing. For example, the input/output\n"
145 " messages received/sent by the sensor can be processed by the parsertool:\n"
147 " parsertool some_userio.raw\n"
156 switch (option.flag) {
168 progress_set_ =
true;
172 progress_set_ =
true;
199 if (args.size() > 0) {
214 WARNING(
"Missing command or wrong arguments");
219 for (std::size_t ix = 1; ix < args.size(); ix++) {
224 if (!progress_set_ && (isatty(fileno(stdin)) == 1)) {
230 for (std::size_t ix = 0; ix <
inputs_.size(); ix++) {
231 DEBUG(
"inputs_[%" PRIuMAX
"] = '%s'", ix,
inputs_[ix].c_str());
245 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)