Hello !
I am trying to write a little script for a copter and I would like to access the current target location of the vehicle. I found vehicle:get_target_location() on this page and tryied it but it returns null all the time. I’ve tried it on a plane and it worked and I had the location but not in copter. Is there an equivalent for Copter ?
Here’s my script :
function update()
local next_WP = vehicle:get_target_location()
if not next_WP then
– not in a flight mode with a target location
gcs:send_text(0,“not in a flight mode with target loc”)
else
gcs:send_text(0,"target loc : " … next_WP:lat() … " ; " … next_WP:lng() )
end
return update, 1000
end
return update()
thanks in advance