3 #include <boost/program_options.hpp> 4 #include <crazyflie_cpp/Crazyflie.h> 6 int main(
int argc,
char **argv)
10 std::string defaultUri(
"radio://0/80/2M/E7E7E7E7E7");
13 namespace po = boost::program_options;
15 po::options_description desc(
"Allowed options");
17 (
"help",
"produce help message")
18 (
"uri", po::value<std::string>(&uri)->default_value(defaultUri),
"unique ressource identifier")
19 (
"verbose,v",
"verbose output")
25 po::store(po::parse_command_line(argc, argv, desc), vm);
28 if (vm.count(
"help")) {
29 std::cout << desc <<
"\n";
32 verbose = vm.count(
"verbose");
36 std::cerr << e.what() << std::endl << std::endl;
37 std::cerr << desc << std::endl;
49 if (bcUSD && logging) {
51 std::cerr <<
"USD deck is not initialized!" << std::endl;
55 std::cout <<
"Logging still enabled. Disabling logging." << std::endl;
60 std::cerr <<
"Could not find USD deck logging variables! Are you using the latest firmware?" << std::endl;
69 for (;iter != end; ++iter) {
71 std::cout <<
"File is " << iter->size <<
" bytes." << std::endl;
77 std::vector<uint8_t>
data;
79 auto start = std::chrono::high_resolution_clock::now();
81 auto end = std::chrono::high_resolution_clock::now();
84 std::chrono::duration<double>
duration = end-start;
85 double t = duration.count();
87 std::cout <<
"read " << data.size() <<
" in " << t <<
" s. (" << data.size() / t <<
" B/s)." << std::endl;
90 std::cout <<
"read " << data.size() << std::endl;
92 std::ofstream out(
"output.log", std::ios::binary);
93 out.write(reinterpret_cast<const char*>(data.data()), data.size());
97 catch(std::exception& e)
99 std::cerr << e.what() << std::endl;
std::vector< MemoryTocEntry >::const_iterator memoriesBegin() const
const ParamTocEntry * getParamTocEntry(const std::string &group, const std::string &name) const
void requestParamToc(bool forceNoCache=false)
int main(int argc, char **argv)
std::vector< MemoryTocEntry >::const_iterator memoriesEnd() const
void setParam(uint16_t id, const T &value)
void readUSDLogFile(std::vector< uint8_t > &data)
T getParam(uint16_t id) const