本文整理汇总了C++中LogReader::set_gyro_mask方法的典型用法代码示例。如果您正苦于以下问题:C++ LogReader::set_gyro_mask方法的具体用法?C++ LogReader::set_gyro_mask怎么用?C++ LogReader::set_gyro_mask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogReader
的用法示例。
在下文中一共展示了LogReader::set_gyro_mask方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _parse_command_line
void Replay::_parse_command_line(uint8_t argc, char * const argv[])
{
const struct GetOptLong::option options[] = {
{"parm", true, 0, 'p'},
{"param", true, 0, 'p'},
{"help", false, 0, 'h'},
{"accel-mask", true, 0, 'a'},
{"gyro-mask", true, 0, 'g'},
{"arm-time", true, 0, 'A'},
{"no-imt", false, 0, 'n'},
{"check-generate", false, 0, OPT_CHECK_GENERATE},
{"check", false, 0, OPT_CHECK},
{"tolerance-euler", true, 0, OPT_TOLERANCE_EULER},
{"tolerance-pos", true, 0, OPT_TOLERANCE_POS},
{"tolerance-vel", true, 0, OPT_TOLERANCE_VEL},
{"nottypes", true, 0, OPT_NOTTYPES},
{"downsample", true, 0, OPT_DOWNSAMPLE},
{"logmatch", false, 0, OPT_LOGMATCH},
{"no-params", false, 0, OPT_NOPARAMS},
{0, false, 0, 0}
};
GetOptLong gopt(argc, argv, "r:p:ha:g:A:", options);
int opt;
while ((opt = gopt.getoption()) != -1) {
switch (opt) {
case 'g':
logreader.set_gyro_mask(strtol(gopt.optarg, NULL, 0));
break;
case 'a':
logreader.set_accel_mask(strtol(gopt.optarg, NULL, 0));
break;
case 'A':
arm_time_ms = strtol(gopt.optarg, NULL, 0);
break;
case 'n':
use_imt = false;
logreader.set_use_imt(use_imt);
break;
case 'p': {
const char *eq = strchr(gopt.optarg, '=');
if (eq == NULL) {
::printf("Usage: -p NAME=VALUE\n");
exit(1);
}
memset(user_parameters[num_user_parameters].name, '\0', 16);
strncpy(user_parameters[num_user_parameters].name, gopt.optarg, eq-gopt.optarg);
user_parameters[num_user_parameters].value = atof(eq+1);
num_user_parameters++;
if (num_user_parameters >= ARRAY_SIZE(user_parameters)) {
::printf("Too many user parameters\n");
exit(1);
}
break;
}
case OPT_CHECK_GENERATE:
check_generate = true;
break;
case OPT_CHECK:
check_solution = true;
break;
case OPT_TOLERANCE_EULER:
tolerance_euler = atof(gopt.optarg);
break;
case OPT_TOLERANCE_POS:
tolerance_pos = atof(gopt.optarg);
break;
case OPT_TOLERANCE_VEL:
tolerance_vel = atof(gopt.optarg);
break;
case OPT_NOTTYPES:
nottypes = parse_list_from_string(gopt.optarg);
break;
case OPT_DOWNSAMPLE:
downsample = atoi(gopt.optarg);
break;
case OPT_LOGMATCH:
logmatch = true;
break;
case OPT_NOPARAMS:
globals.no_params = true;
break;
case 'h':
default:
usage();
//.........这里部分代码省略.........