Go to the documentation of this file.00001 #include <thread>
00002 #include <iostream>
00003
00004 #include <crazyflie_cpp/Crazyflie.h>
00005
00006 int main()
00007 {
00008
00009
00010
00011 std::thread t1([] {
00012 Crazyflie cf1("radio://0/100/2M/E7E7E7E701");
00013
00014 for (size_t i = 0; i < 100; ++i) {
00015 cf1.sendSetpoint(0, 0, 0, 0);
00016 }
00017 while (true) {
00018
00019 cf1.sendSetpoint(0, 0, 0, 10000);
00020 std::this_thread::sleep_for(std::chrono::milliseconds(10));
00021 }
00022 });
00023
00024
00025 std::thread t2([] {
00026 Crazyflie cf2("radio://0/100/2M/E7E7E7E702");
00027
00028 for (size_t i = 0; i < 100; ++i) {
00029 cf2.sendSetpoint(0, 0, 0, 0);
00030 }
00031 while (true) {
00032
00033 cf2.sendSetpoint(0, 0, 0, 20000);
00034 std::this_thread::sleep_for(std::chrono::milliseconds(10));
00035 }
00036 });
00037
00038 t1.join();
00039 t2.join();
00040
00041 return 0;
00042 }