Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_Scripting: add binding for GCS last seen time #25444

Merged
merged 1 commit into from
Nov 4, 2023

Conversation

IamPete1
Copy link
Member

@IamPete1 IamPete1 commented Nov 2, 2023

This adds a binding for sysid_myggcs_last_seen_time_ms renaming it to last_seen such then it can be called as gcs:last_seen().

This allows GCS failsafe actions to be implemented in scripting. Very basic example:

function update()

  local gcs_dt = millis() - gcs:last_seen()

  gcs:send_text(0, string.format("Last GCS was: %0.2f seconds ago", gcs_dt:tofloat() * 0.001))

  return update, 1000
end

return update()

@tridge tridge merged commit 66b8fd9 into ArduPilot:master Nov 4, 2023
87 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants