|
|
|
|
@ -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
|
|
|
|
|
|