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

Implement rain logic #148

Merged
merged 7 commits into from
Sep 23, 2024
Merged

Implement rain logic #148

merged 7 commits into from
Sep 23, 2024

Conversation

olliewalsh
Copy link
Collaborator

Adds 3 modes for rain:
0 - Ignore it
1 - Dock when rain detected. If in automatic mode it will resume again when battery is full etc...
2 - Dock until dry. If in automatic mode will resume again when rain is no longer detected for OM_RAIN_DELAY_MINUTES
3 - Pause Automatic Mode. Pauses automatic mode when rain detected. Needs to be manually resumed

Adds 3 modes for rain:
0 - Ignore it
1 - Dock when rain detected. If in automatic mode it will resume again when battery is full etc...
2 - Dock until dry. If in automatic mode will resume again when rain is no longer detected for OM_RAIN_DELAY_MINUTES
3 - Pause Automatic Mode. Pauses automatic mode when rain detected. Needs to be
manually resumed
@Apehaenger
Copy link
Collaborator

Quite cool flexible implementation!
Will test it asap...

@@ -534,6 +538,29 @@ void checkSafety(const ros::TimerEvent &timer_event) {
dockingNeeded = true;
}

// Rain detected is initialized to true and flips to false if rain is not detected
// continuously for rain_check_seconds. This is to avoid false positives due to noise
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TODO: move this logic to the low level firmware

Copy link
Contributor

Choose a reason for hiding this comment

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

A positive side of having this in higher level is that rain could be signalled externally without having to reimplement everything. But then again, I guess we could just set manual_pause_mowing...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just meant move to logic to deal with noise to the low level firmware so we get a stable true/false from the low level status

@Apehaenger
Copy link
Collaborator

Sorry to dirt your branch, but had problems creating an image for testing.

Finally could test.
Tested only the default mode "Ignore", "Dock" and "Dock until dry", but code is pretty clear.
All worked as expected.

Thanks a lot for this quite cool PR, I do know that a lot of people are waiting for this functionality!

@Apehaenger Apehaenger merged commit 1dcf79c into ClemensElflein:main Sep 23, 2024
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants