CallanDaniel
4 years ago
committed by
Randy Mackay
3 changed files with 38 additions and 0 deletions
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
-- example script for using "get_origin()" |
||||
-- prints the home and ekf origin lat long and altitude to the console every 5 seconds |
||||
|
||||
function update () |
||||
|
||||
home = ahrs:get_home() |
||||
origin = ahrs:get_origin() |
||||
|
||||
if home then |
||||
gcs:send_text(0, string.format("Home - Lat:%.1f Long:%.1f Alt:%.1f", home:lat(), home:lng(), home:alt())) |
||||
end |
||||
|
||||
if origin then |
||||
gcs:send_text(0, string.format("Origin - Lat:%.1f Long:%.1f Alt:%.1f", origin:lat(), origin:lng(), origin:alt())) |
||||
end |
||||
|
||||
return update, 5000 |
||||
|
||||
end |
||||
|
||||
return update() |
@ -0,0 +1,15 @@
@@ -0,0 +1,15 @@
|
||||
-- example script for using "set_home()" |
||||
-- sets the home location to the current vehicle location every 5 seconds |
||||
|
||||
function update () |
||||
|
||||
if ahrs:home_is_set() then |
||||
ahrs:set_home(ahrs:get_position()) |
||||
gcs:send_text(0, "Home position reset") |
||||
end |
||||
|
||||
return update, 5000 |
||||
|
||||
end |
||||
|
||||
return update() |
Loading…
Reference in new issue