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] robag <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"
120 "Extract (som) non-ROS data from the .fpl logfile\n"
122 " fpltool [-vqpP] extract <fpl-file>\n"
127 " Create a some.bag from a some.fpl logfile:\n"
129 " fpltool rosbag some.fpl\n"
131 " Create a compressed another.bag with 2 minutes of data starting 60 seconds into some.fpl logfile:\n"
133 " fpltool rosbag some.fpl -c -c -o another.bag -S 60 -D 120\n"
136 " Show meta data of some.fpl:\n"
138 " fpltool meta some.fpl\n"
140 " Trim a verylong.fpl into a shorter one:\n"
142 " fpltool trim some.fpl -S 3600 -D 1800\n"
144 " Extract data from some.fpl:\n"
146 " fpltool extract some.fpl\n"
148 " This results in various data files suitable for further processing. For example, the input/output\n"
149 " messages received/sent by the sensor can be processed by the parsertool:\n"
151 " parsertool some_userio.raw\n"
160 switch (option.flag) {
172 progress_set_ =
true;
176 progress_set_ =
true;
203 if (args.size() > 0) {
218 WARNING(
"Missing command or wrong arguments");
223 for (std::size_t ix = 1; ix < args.size(); ix++) {
228 if (!progress_set_ && (isatty(fileno(stdin)) == 1)) {
234 for (std::size_t ix = 0; ix <
inputs_.size(); ix++) {
235 DEBUG(
"inputs_[%" PRIuMAX
"] = '%s'", ix,
inputs_[ix].c_str());
249 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 WARNING(...)
Print a warning message.
#define DEBUG(...)
Print a debug message.
bool StrToValue(const std::string &str, int8_t &value)
Convert string to value (int8_t)