add the .yaml file to read target point

This commit is contained in:
2022-12-27 23:45:40 +08:00
parent 26dcb8d9e9
commit bfe4da4912
42 changed files with 3913 additions and 2 deletions
+4
View File
@@ -0,0 +1,4 @@
routh1:
x: 1.0
y: 1.5
z: 0.0
+3 -1
View File
@@ -1,6 +1,7 @@
#include "class_model/mission.h"
#include "class_model/choose_leader.h"
#include "class_model/PubInfo.h"
#include "yaml-cpp/yaml.h"
int main(int argc, char **argv) {
@@ -21,7 +22,8 @@ int main(int argc, char **argv) {
// SelectionClass selection_object;
YAML::Node config = YAML::LoadFile("/home/dodo/ardupilot_ws/src/class_model/src/config.yaml"); //reading yaml parameter(target point)
mode_object.set_Mode("GUIDED");
control_object.arm();
control_object.takeoff(4.5);
+15
View File
@@ -0,0 +1,15 @@
#include <iostream>
#include "yaml-cpp/yaml.h"
using namespace std;
int main(int argc,char** argv){
YAML::Node config = YAML::LoadFile("/home/dodo/ardupilot_ws/src/class_model/src/config.yaml");
cout <<"x:"<<config["routh1"]["x"].as<float>()<<endl;
cout <<"y:"<<config["routh1"]["y"].as<float>()<<endl;
return 0;
}