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");
12 namespace po = boost::program_options;
14 po::options_description desc(
"Allowed options");
16 (
"help",
"produce help message")
17 (
"uri", po::value<std::string>(&uri)->default_value(defaultUri),
"unique ressource identifier")
23 po::store(po::parse_command_line(argc, argv, desc), vm);
26 if (vm.count(
"help")) {
27 std::cout << desc <<
"\n";
33 std::cerr << e.what() << std::endl << std::endl;
34 std::cerr << desc << std::endl;
46 std::cout << entry.group <<
"." << entry.name <<
" (";
55 std::cout <<
"uint16";
61 std::cout <<
"uint32";
71 std::cout <<
", readonly";
73 std::cout <<
") value: ";
77 std::cout << (int)cf.
getParam<uint8_t>(entry.id);
80 std::cout << (int)cf.
getParam<int8_t>(entry.id);
83 std::cout << cf.
getParam<uint16_t>(entry.id);
86 std::cout << cf.
getParam<int16_t>(entry.id);
89 std::cout << cf.
getParam<uint32_t>(entry.id);
92 std::cout << cf.
getParam<int32_t>(entry.id);
95 std::cout << cf.
getParam<
float>(entry.id);
99 std::cout << std::endl;
105 catch(std::exception& e)
107 std::cerr << e.what() << std::endl;
void requestParamToc(bool forceNoCache=false)
std::vector< ParamTocEntry >::const_iterator paramsBegin() const
std::vector< ParamTocEntry >::const_iterator paramsEnd() const
int main(int argc, char **argv)
T getParam(uint16_t id) const