I need my rover to HOLD when there is no rtk GPS fix (i.e. when GPS fix type is lower than 5). Also, after such a hold, if the GPS fix recovers (i.e. changes back to 5 or 6) I’d like the rover to resume its mission, i.e. go back to AUTO mode. The basic logic I need is:
If in AUTO, and GPS fix changes from (5 or 6) to (value <5), change mode to HOLD and DO_SET_SERVO #5 to 900
If in HOLD because of the above rule (i.e. and not because of some other reason), and GPS fix changes from (value <5) to (5 or 6), then DO_SET_SERVO #5 to 2000 and change mode to AUTO
I looked and didn’t see any internal support for this within the Failsafe mechanisms inside Ardurover… Right? Given that, what if any difference do you see between implementing this as a LUA script and building logic on my companion computer?
Hi Cristopher
It would be very a very interesting improvement this failsafe for rovers . It would ensure a secure path over time in restricted areas. there was an issue raised about this time ago https://github.com/ArduPilot/ardupilot/issues/8787 but for some reason was never implemented in rover upgrades.
Let me know if you succeed in a sript. I tried it in dronekit time ago but had some difficulties. I don’t remember very well but i think there was no way to ask for rtk status (5 or 6) in dronekit
Jose Luis, I implemented this failsafe in my companion computer… It’s running mavproxy and as such knows the GPS status. So I have solved this another way, and moved on. -Chris
I implemented this via code on my companion computer. At a high level, the companion computer is running a python program we wrote that talks to the autopilot using MAV (using pymavlink). It monitors the GPS status and when the status falls below a certain level it sets the autopilot mode to HOLD while it waits for the GPS to recover, and when it recovers, it sets the autopilot mode to AUTO.
I think I have the default behavior set to use manual mode in the event of an undesired fix type, the intent being to drive out from under tree cover and auto-resume the mission when the fix type recovers.
@Yuri_Rage FYI at the recommendation of the ardusimple folks we are experimenting with upgrading our antennas to “budget survey” antennas to improve performance under heavy tree canopy . Initial experience (1 rover, 30 mins of operation) is encouraging. I’ll post when I have more robust comparison results.
Hello Yuri,
Thank for this script, i will try it i will learn to use Lua script it is new for me. I see your tuto ’ ArduPilot Lua Scripting Basics’ it is a beginning. Now i’m not sure my version of ardurover is good for lua, i use the 3.5.1, maybe i have to update with ArduRover 4.2.3.
I’ve been thinking about the human factors on this - if the mower loses GPS stopping makes sense. Electric mowers can be silent while waiting - so springing back in to life may be surprising for anyone near.
We’ll implement a flavour of Yuri’s script (thanks Yuri - excellent) but start the ICE motor/blades then wait 10? seconds before moving again.,