PI control problem
This commit is contained in:
@@ -40,6 +40,7 @@ public:
|
||||
int find_ref_drone(global_location** data, size_t index, int leaderID);
|
||||
|
||||
float lon[3],lat[3];
|
||||
global_location vector_LT,vector_SM;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -127,11 +127,13 @@ void FollowerClass::plane(global_location* target, global_location* leader, glob
|
||||
|
||||
int FollowerClass::direct(global_location* target, global_location* leader, DroneStatus self, DroneStatus member){
|
||||
|
||||
global_location vector_LT,vector_SM;
|
||||
float m,n,k,cosTheta;
|
||||
|
||||
if(flag == 0){
|
||||
vector_LT.lon = target->lon - leader->lon; //vector_LT (leader->target)
|
||||
vector_LT.lat = target->lat - leader->lat;
|
||||
flag = 1;
|
||||
}
|
||||
vector_SM.lon = member.init_location.lon - self.init_location.lon; //vector_SM (self->member)
|
||||
vector_SM.lat = member.init_location.lat - self.init_location.lat;
|
||||
k = (vector_LT.lon*vector_SM.lon)+(vector_LT.lat*vector_SM.lat); //k = vector_LT dot vector_SM
|
||||
|
||||
Reference in New Issue
Block a user