5 int main(
int argc,
char *argv[]) {
6 const std::string device =
7 (argc > 1) ? std::string(argv[1]) :
"/dev/ttyUSB0";
8 const size_t baudrate = (argc > 2) ? std::stoul(argv[2]) : 115200;
13 client.
start(device, baudrate);
22 std::cerr <<
"unsupported: " << size_t(ident.
id()) << std::endl;
28 std::cerr <<
"unsupported: " << size_t(status.id()) << std::endl;
34 imu_raw, 512.0, 1.0 / 4.096, 0.92f / 10.0f, 9.80665f);
37 std::cerr <<
"unsupported: " << size_t(imu_raw.id()) << std::endl;
43 std::cerr <<
"unsupported: " << size_t(servo.id()) << std::endl;
49 std::cerr <<
"unsupported: " << size_t(motor.id()) << std::endl;
55 std::cerr <<
"unsupported: " << size_t(rc.id()) << std::endl;
59 std::cout << attitude;
61 std::cerr <<
"unsupported: " << size_t(attitude.id()) << std::endl;
65 std::cout << altitude;
67 std::cerr <<
"unsupported: " << size_t(altitude.id()) << std::endl;
73 std::cerr <<
"unsupported: " << size_t(analog.id()) << std::endl;
77 std::cout << rc_tuning;
79 std::cerr <<
"unsupported: " << size_t(rc_tuning.id()) << std::endl;
85 std::cerr <<
"unsupported: " << size_t(pid.id()) << std::endl;
91 std::cerr <<
"unsupported: " << size_t(box.id()) << std::endl;
97 std::cerr <<
"unsupported: " << size_t(misc.id()) << std::endl;
103 std::cerr <<
"unsupported: " << size_t(pins.id()) << std::endl;
107 std::cout << box_names;
109 std::cerr <<
"unsupported: " << size_t(box_names.id()) << std::endl;
113 std::cout << pid_names;
115 std::cerr <<
"unsupported: " << size_t(pid_names.id()) << std::endl;
119 std::cout << box_ids;
121 std::cerr <<
"unsupported: " << size_t(box_ids.id()) << std::endl;
125 std::cout << servo_conf;
127 std::cerr <<
"unsupported: " << size_t(servo_conf.id()) << std::endl;
133 std::cout <<
"#Debug message:" << std::endl;
134 std::cout << debug_msg.debug_msg << std::endl;
137 std::cerr <<
"unsupported: " << size_t(debug_msg.id()) << std::endl;
143 std::cerr <<
"unsupported: " << size_t(debug.id()) << std::endl;
146 std::cout <<
"PROGRAM COMPLETE" << std::endl;
bool start(const std::string &device, const size_t baudrate=115200)
Start communications with a flight controller.
virtual ID id() const override
get the ID of the message
void setLoggingLevel(const LoggingLevel &level)
Set the verbosity of the output.
bool stop()
Stop communications with a flight controller.
FirmwareVariant
Enum of firmware variants.
void setVariant(const FirmwareVariant &v)
Change the device path on the next connect.
int main(int argc, char *argv[])
bool sendMessage(msp::Message &message, const double &timeout=0)
Send a message to the connected flight controller. If the message sends data to the flight controller...