Hi,
I'm trying to modify the UAV Package Delivery project such as it allows multiple waypoints while avoiding obstacles, using QGroundConrol. Until now I have done these:
-modified replaced FollowWaypoints with the guidance from FullGuidanceLogic
However, MissionData input must be bus signal "uavPathManagerBus"
Currently, the MissionData comes from the function that contains the OA algorithm:
function [y, DTD, needHover] = computeLPWaypoints(mission, Steer,UAVState)
Wp1 = [mission(1).position' mission(1).params(4)];
Wp2x = mission(2).position(1);
Wp2y = mission(2).position(2);
if (~any(isnan(Steer)) && (UAVState.z < -5))
LAP_local = 6*Steer(2:4)';
LAP = [LAP_local yaw] + [UAVState.x, UAVState.y, UAVState.z, 0];
y = [ Wp1(1,:) ; LAP ; Wp2x , Wp2y , 0 , LAP(4) ];
DTD = norm([Wp2x Wp2y] - LAP(1:2));
y = [ Wp1(1,:) ; UAVState.x, UAVState.y, UAVState.z Steer(1); Wp2x , Wp2y , 0 , Steer(1) ];
DTD = norm([Wp2x Wp2y] - [UAVState.x, UAVState.y]);
y = [ Wp1(1,:) ; UAVState.x , UAVState.y , UAVState.z-2 , 0 ; Wp2x , Wp2y , 0 , 0 ];
DTD = norm([Wp2x Wp2y] - [UAVState.x, UAVState.y]);
y = [ Wp1(1,:) ; Wp2x , Wp2y, -11 , 0 ; Wp2x , Wp2y , -1 , 0 ];
I get this obvious error when I try to run the simulation:
I have tried sending the sigal from the GCS dirrectly into the MissionData (as expected), but then the quadcopter just flies back and forth around the first waypoint of the mission:
I would very much appreciate any advice on how to move further with this.
Regards,
Tudor