ver4
This commit is contained in:
+6
-4
@@ -1,6 +1,6 @@
|
||||
/*Get Drone's Parameter*/
|
||||
#ifndef GETPARAM_H
|
||||
#define GETPARAM_H
|
||||
/*Get/SET Drone's Parameter*/
|
||||
#ifndef PARAM_H
|
||||
#define PARAM_H
|
||||
|
||||
#include <ros/ros.h>
|
||||
|
||||
@@ -9,6 +9,8 @@ public:
|
||||
ParamClass();
|
||||
virtual ~ParamClass();
|
||||
int getID();
|
||||
int setParam(std::string ParamName , int value);
|
||||
int getParam(std::string ParamName);
|
||||
|
||||
private:
|
||||
// ROS NodeHandle
|
||||
@@ -25,4 +27,4 @@ private:
|
||||
|
||||
};
|
||||
|
||||
#endif // GETPARAM_H
|
||||
#endif // PARAM_H
|
||||
@@ -0,0 +1,22 @@
|
||||
// choose a leader , other drones set as follower
|
||||
#ifndef CHOOSE_LEADER_H
|
||||
#define CHOOSE_LEADER_H
|
||||
|
||||
#include <ros/ros.h>
|
||||
#include "class_model/Param.h"
|
||||
|
||||
class SelectionClass{
|
||||
public:
|
||||
SelectionClass();
|
||||
virtual ~SelectionClass();
|
||||
|
||||
ParamClass param_object;
|
||||
void choose_leader();
|
||||
|
||||
private:
|
||||
// ROS NodeHandle
|
||||
ros::NodeHandle node_handle_;
|
||||
int ID;
|
||||
|
||||
};
|
||||
#endif //CHOOSE_LEADER_H
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "class_model/receiver.h"
|
||||
#include "class_model/formation.h"
|
||||
#include "class_model/getParam.h"
|
||||
#include "class_model/Param.h"
|
||||
#include "class_model/select.h"
|
||||
|
||||
class MissionClass {
|
||||
@@ -20,6 +20,9 @@ public:
|
||||
void fly2target(float x=0 ,float y=0);
|
||||
void cruise(float x ,float y);
|
||||
void snake(float x ,float y);
|
||||
void start();
|
||||
void set_mission();
|
||||
|
||||
private:
|
||||
// ROS NodeHandle
|
||||
ros::NodeHandle node_handle_;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <string>
|
||||
#include <class_model/gps_location.h>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include "rapidjson/document.h"
|
||||
// #include "rapidjson/document.h"
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
@@ -32,7 +32,7 @@ private:
|
||||
void StringToJson(std::string data);
|
||||
float heading;
|
||||
global_location leader_position;
|
||||
rapidjson::Document document;
|
||||
// rapidjson::Document document;
|
||||
json j_data;
|
||||
|
||||
// SUBSCRIBE
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "class_model/receiver.h"
|
||||
#include "class_model/formation.h"
|
||||
#include "class_model/getParam.h"
|
||||
#include "class_model/Param.h"
|
||||
|
||||
class SelectClass {
|
||||
public:
|
||||
@@ -22,12 +22,14 @@ public:
|
||||
void goose_formation(float x=0,float y=0);
|
||||
void protect_formation(float x=0,float y=0);
|
||||
void Hex_formation(float x=0,float y=0);
|
||||
void start_formation();
|
||||
void stop();
|
||||
|
||||
private:
|
||||
// ROS NodeHandle
|
||||
ros::NodeHandle node_handle_;
|
||||
int counter;
|
||||
int JobNumber;
|
||||
};
|
||||
|
||||
#endif // SELECT_H
|
||||
Reference in New Issue
Block a user