add the .yaml file to read target point
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
routh1:
|
||||
x: 1.0
|
||||
y: 1.5
|
||||
z: 0.0
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user