Not sure if this is a rover or scripting questions but hoping for a little nudge or pointer.
I have the hall effect sensor all working nicely, and RPM1 is populated on the Quickscreen - so thats all good. The plan is - that when the (very slow) mower hits long grass, we notice the rpm’s drop - so Slow down until they recover. This is very similar to Yuri’s rough terrain script (thanks) which i’ll use to build this out. Other scripts are running fine also.
My problem - how to get the rpm:get_rpm(instance) values sent back to the GCS / mission planner.
Once i can reference the values from the script - i can bash my way through lua and not mow the rest of the lawns with the petrol motor stalled out…
I found a working snipped and added my rpm:get_rpm() into it - but its complaining.
21/12/2023 8:59:59 pm : to index a nil value (global ‘rpm’)
21/12/2023 8:59:59 pm : Lua: /APM/scripts/active_source_set.lua:7: attempt
21/12/2023 8:59:59 pm : current source set in use :0
> function update() -- this is the loop which periodically runs
> gcs:send_text(0, string.format("current source set in use :%d", ahrs:get_posvelyaw_source_set()))
> gcs:send_text(0, string.format("rpm(1) :%d", rpm:get_rpm(1)))
> return update, 1000 -- 1000ms reschedules the loop (1Hz)
> end
> return update() -- run immediately before starting to reschedule
update: I’ve moved from arducopter 4.4 to the latest ardurover 4.4 beta with the same results. Im getting similar errors copy/pasting some of the examples without mod. Bit stuck help please !