You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.3 KiB
C++
54 lines
1.3 KiB
C++
/*Follow the leader in a fixed formation */
|
|
#ifndef FOLLOWER_H
|
|
#define FOLLOWER_H
|
|
|
|
#include <ros/ros.h>
|
|
#include "class_model/sensor.h"
|
|
#include "class_model/mode.h"
|
|
#include "class_model/control.h"
|
|
#include "class_model/command.h"
|
|
#include "class_model/requestData.h"
|
|
#include "class_model/DroneStatus.h"
|
|
|
|
|
|
class FollowerClass {
|
|
public:
|
|
FollowerClass();
|
|
virtual ~FollowerClass();
|
|
//ClassObject
|
|
ThreadGPSClass GPS_object;
|
|
ModeClass mode_object;
|
|
ControlClass control_object;
|
|
CommandClass command_object;
|
|
RequestClass request_object;
|
|
DroneStatus drone1;
|
|
DroneStatus drone2;
|
|
DroneStatus drone3;
|
|
DroneStatus self;
|
|
DroneStatus samePlane[3];
|
|
|
|
void follower();
|
|
|
|
float lon[3],lat[3];
|
|
|
|
|
|
private:
|
|
// ROS NodeHandle
|
|
ros::NodeHandle node_handle_;
|
|
|
|
global_location target_location;
|
|
global_location follower_location;
|
|
global_location leader_location;
|
|
global_location leader_drone;
|
|
DroneStatus memberDrone[];
|
|
|
|
void calculate_position(float k,float theta);
|
|
void plane(global_location target, global_location leader, global_location follower);
|
|
void find_ref_drone(global_location data[], size_t index, int leaderID);
|
|
void choose_leader();
|
|
void follow();
|
|
void get_location();
|
|
|
|
};
|
|
|
|
#endif // FOLLOWER_H
|