12 imu, 512.0, 1.0 / 4.096, 0.92f / 10.0f, 9.80665f);
22 std::cout << attitude;
26 std::cout << altitude;
32 std::cout << rc_tuning;
42 std::cout << motor_pins;
46 std::cout << box_names;
50 std::cout << pid_names;
56 std::cout << servo_conf;
60 std::cout <<
"#Debug message:" << std::endl;
61 std::cout << debug_msg.
debug_msg << std::endl;
71 int main(
int argc,
char* argv[]) {
72 const std::string device =
73 (argc > 1) ? std::string(argv[1]) :
"/dev/ttyUSB0";
74 const size_t baudrate = (argc > 2) ? std::stoul(argv[2]) : 115200;
79 client.
start(device, baudrate);
82 const std::function<void(const msp::msg::RawImu&)> imu_cb2 =
86 imu, 512.0, 1.0 / 4.096, 0.92f / 10.0f, 9.80665f);
115 std::cout <<
"DONE" << std::endl;
Value< std::string > debug_msg
bool start(const std::string &device, const size_t baudrate=115200)
Start communications with a flight controller.
void onServo(const msp::msg::Servo &servo)
void onBox(const msp::msg::ActiveBoxes &box)
void onAltitude(const msp::msg::Altitude &altitude)
void onRcTuning(const msp::msg::RcTuning &rc_tuning)
void onServoConf(const msp::msg::ServoConf &servo_conf)
void onStatus(const msp::msg::Status &status)
void onRc(const msp::msg::Rc &rc)
void onPID(const msp::msg::Pid &pid)
void onMisc(const msp::msg::Misc &misc)
void onAttitude(const msp::msg::Attitude &attitude)
bool stop()
Stop communications with a flight controller.
void onDebug(const msp::msg::Debug &debug)
void onDebugMessage(const msp::msg::DebugMessage &debug_msg)
void onMotor(const msp::msg::Motor &motor)
void onBoxIds(const msp::msg::BoxIds &box_ids)
void onImu(const msp::msg::RawImu &imu)
void onBoxNames(const msp::msg::BoxNames &box_names)
int main(int argc, char *argv[])
std::shared_ptr< SubscriptionBase > subscribe(void(C::*callback)(const T &), C *context, const double &tp)
Register callback function that is called when a message of matching ID is received.
void onMotorPins(const msp::msg::MotorPins &motor_pins)
void onPidNames(const msp::msg::PidNames &pid_names)
void onAnalog(const msp::msg::Analog &analog)
void onIdent(const msp::msg::Ident &ident)