int main(int argc, char* argv[]) { ArgumentParser argParser; if(!argParser.parseArgs(argc, argv)) { Logger::ERROR("Invalid arguments provided!"); Logger::ERROR(argParser.getUsage()); return 1; } Config* config = Config::getConfig(); config->testnodePrioritySwitcher = new PrioritySwitcher(0, config->fifoScheduling); if(!setProcessPriority()) { Logger::ERROR("Couldn't set priority appropriately, maybe not running as root?"); return 1; } ros::init(argc, argv, "oneshot_timer_tests"); config->nodeHandle = new ros::NodeHandle; Logger::INFO("Performing ROS Timer latency measurements..."); OneShotLatencyMeasurer* measurer; if(config->busyMode) { Logger::INFO("Running in busy mode"); measurer = new BusyOneShotLatencyMeasurer(); } else { Logger::INFO("Running in default mode"); measurer = new IdleOneShotLatencyMeasurer(); } measurer->measure(); measurer->printMeasurementResults(); measurer->saveMeasuredLatencyGnuplotData(); return 0; }
int main(int argc, char **argv) { initArgs(); args.parseArgs(argc, argv); TypeVec types = getTypes(); SquareSelector<double> coordCutoffs = getCoordCutoffs(types); Atom *atoms; if (args.getStandaloneCount() != 1) { cerr << "no input file. See --help for help" << endl; exit(1); } const char *filename = args.getCStandalone(0); const double globalCutoff = args.getDouble("cutoff"); double *spaceSize = NULL; int numatoms = readFile(filename, &types, &atoms, &spaceSize); saveAtomTypes(types); writeInteratomics(atoms, numatoms, globalCutoff, types, spaceSize, coordCutoffs); if (spaceSize) { delete[] spaceSize; spaceSize = NULL; } return 0; }
int main(int argc, char* argv[]) { Config* config = Config::getConfig(); ArgumentParser argParser; if(!argParser.parseArgs(argc, argv)) { argParser.printUsage(); return 1; } if(config->rtPrio) { PrioritySwitcher prioSwitcher(config->fifoScheduling); if(prioSwitcher.switchToRealtimePriority() != 0) { Logger::ERROR("Switching to realtime priority failed, maybe not running as root?"); return 1; } } ros::init(argc, argv, "communication_tests_subscriber"); config->nodeHandle = new ros::NodeHandle(); Subscriber subscriber("communication_tests"); subscriber.startMeasurement(); subscriber.printMeasurementResults(); subscriber.saveGnuplotData(); return 0; }