00001 00012 #include <iostream> 00013 #include <cstdio> 00014 #include <cstring> 00015 #include <cmath> 00016 #include <dji_sdk/dji_sdk_node.h> 00017 00018 DJI::onboardSDK::ROSAdapter *rosAdapter; 00019 00020 int main(int argc, char **argv) { 00021 ros::init(argc, argv, "dji_sdk"); 00022 ros::NodeHandle nh; 00023 ros::NodeHandle nh_private("~"); 00024 00025 //new an object of adapter 00026 rosAdapter = new DJI::onboardSDK::ROSAdapter; 00027 00028 DJISDKNode* dji_sdk_node = new DJISDKNode(nh, nh_private); 00029 00030 ros::AsyncSpinner spinner(4); // Use 4 threads 00031 spinner.start(); 00032 ros::waitForShutdown(); 00033 00034 //clear 00035 delete rosAdapter; 00036 rosAdapter = NULL; 00037 delete dji_sdk_node; 00038 dji_sdk_node = NULL; 00039 00040 return 0; 00041 }