GPS_Denied_Day_2

this is the originol code

’ if (not gps_or_ekf_bad) then
local home = ahrs:get_home()
local curr_loc = ahrs:get_location()
if home and curr_loc then
home_dist = curr_loc:get_distance(home)
home_yaw = math.deg(curr_loc:get_bearing(home))
elseif (update_user) then
– warn user of unexpected failure
gcs:send_text(0, “DR: could not get home or vehicle location”)
end
end’

i have modified the code a bit like below

'if (not gps_or_ekf_bad) then
local home = ahrs:get_home()
local curr_loc = ahrs:get_location()
if home and curr_loc then
home_dist = curr_loc:get_distance(home)
current_pitch = ahrs:get_pitch() – Update: Get the current pitch from ahrs

-- Rest of your code using current_pitch goes here

elseif (update_user) then
– warn user of unexpected failure
gcs:send_text(0, “DR: could not get home or vehicle location”)
end
end’

My Goal is to reach the next waypoint (pitch, yaw) to the current heading, to move the vechle forword in guided_no_Gps mode, i get a bit success but not perfect (tested in SITL), the error are look like this

can anyone help me in this project.

i want to manuplate this but still i am stuck : Lua Scripts — Copter documentation

Please stop creating new topics with identical questions. Instead, tell us more about what you’re trying to do. It’s not very clear.

Oay… i m sorry for the created disturbance