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 examples for RangeFinder filter #25217

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rishabsingh3003
Copy link
Contributor

This script provides an easy framework to implement custom filters with RangeFinders. Two simple examples are implemented. With this script, if two or more rangefinders are present, you can:
A. Get the minimum of the two rangefinders
B. Get the average of the two rangefinders

local sent_successfully = lua_backend:handle_script_msg(distances_sum / same_direction_sensor_count)
if not sent_successfully then
gcs:send_text(0, "RangeFinder Lua Script Error")
return update, update_rate_error_ms
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like it will stop for 5s if a rangefinder goes out of range

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.

None yet

3 participants