5 #include <boost/program_options.hpp> 6 #include <crazyflie_cpp/Crazyflie.h> 25 int main(
int argc,
char **argv)
29 std::string defaultUri(
"radio://0/80/2M/E7E7E7E7E7");
32 namespace po = boost::program_options;
34 po::options_description desc(
"Allowed options");
36 (
"help",
"produce help message")
37 (
"uri", po::value<std::string>(&uri)->default_value(defaultUri),
"unique ressource identifier")
38 (
"external", po::value<bool>(&external)->default_value(
false),
"measure external voltage")
44 po::store(po::parse_command_line(argc, argv, desc), vm);
47 if (vm.count(
"help")) {
48 std::cout << desc <<
"\n";
54 std::cerr << e.what() << std::endl << std::endl;
55 std::cerr << desc << std::endl;
64 std::cout << cf.
vbat() << std::endl;
69 std::unique_ptr<LogBlock<struct log> > logBlock;
70 std::function<void(uint32_t, struct log*)> cb = std::bind(&
onLogData, std::placeholders::_1, std::placeholders::_2);
83 std::this_thread::sleep_for(std::chrono::milliseconds(10));
89 catch(std::exception& e)
91 std::cerr << e.what() << std::endl;
void requestLogToc(bool forceNoCache=false)
void onLogData(uint32_t, struct log *data)
int main(int argc, char **argv)
struct log __attribute__((packed))