Skip to content

Base states #113

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

Merged
merged 1 commit into from
May 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 136 additions & 0 deletions Firmware/RTK_Surveyor/States.ino
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,85 @@ void updateSystemState()
}
break;

/*
.-----------------------------------.
startBase() | STATE_BASE_NOT_STARTED |
.------------| Text: 'Base' |
| = false '-----------------------------------'
| |
| Stop WiFi, | startBase() = true
| Stop | Stop WiFi
| Bluetooth | Start Bluetooth
| V
| .-----------------------------------.
| | STATE_BASE_TEMP_SETTLE |
| | Temp Base Icon. Blinking HPA. |
| | "HPA: 7.15" |
| | "SIV: 5" |
| '-----------------------------------'
V |
STATE_BASE_FIXED_NOT_STARTED | horizontalAccuracy > 0.0
(next diagram) | && horizontalAccuracy
| < settings.surveyInStartingAccuracy
| && beginSurveyIn() == true
V
.-----------------------------------.
| STATE_BASE_TEMP_SURVEY_STARTED | svinObservationTime >
| Temp Base Icon blinking | maxSurveyInWait_s
| "Mean: 0.089" |--------------.
| "Time: 36" | |
'-----------------------------------' |
| |
| getSurveyInValid() |
| = true V
| STATE_ROVER_NOT_STARTED
V (Previous diagram)
.-----------------------------------.
| STATE_BASE_TEMP_TRANSMITTING |
| Temp Base Icon solid |
| "Xmitting" |
| "RTCM: 2145" |
'-----------------------------------'
|
| NTRIP enabled = true
V
.-----------------------------------.
| STATE_BASE_TEMP_WIFI_STARTED |
| Blinking WiFi Icon |
| "Xmitting" |
| "RTCM: 0" |
'-----------------------------------'
|
| WiFi connected = true
| radioState = WIFI_CONNECTED
V
.-----------------------------------.
| STATE_BASE_TEMP_WIFI_CONNECTED |
.--------------->| Solid WiFi Icon |
| | "Xmitting" |
| | "RTCM: 2145" |
| '-----------------------------------'
| |
| | Caster enabled
| V
| .-----------------------------------.
| | STATE_BASE_TEMP_CASTER_STARTED |
| Caster failed | Solid WiFi Icon |
+<---------------| "Connecting" |
^ Authorization | "RTCM: 2145" |
| failed '-----------------------------------'
| |
| | Caster connected
| V
| .-----------------------------------.
| Caster failed | STATE_BASE_TEMP_CASTER_CONNECTED |
'----------------| Solid WiFi Icon |
| "Casting" |
| "RTCM: 2145" |
'-----------------------------------'

*/

case (STATE_BASE_NOT_STARTED):
{
if (online.gnss == false)
Expand Down Expand Up @@ -585,6 +664,63 @@ void updateSystemState()
}
break;

/*
.-----------------------------------.
startBase() | STATE_BASE_FIXED_NOT_STARTED |
= false | Text: "Base Started" |
.-------------| |
| '-----------------------------------'
V |
STATE_ROVER_NOT_STARTED | startBase() = true
(Rover diagram) V
.-----------------------------------.
| STATE_BASE_FIXED_TRANSMITTING |
| Castle Base Icon solid |
| "Xmitting" |
| "RTCM: 0" |
'-----------------------------------'
|
| NTRIP enabled = true
| Stop Bluetooth
| Start WiFi
V
.-----------------------------------.
| STATE_BASE_FIXED_WIFI_STARTED |
| Blinking WiFi Icon |
| "Xmitting" |
| "RTCM: 0" |
'-----------------------------------'
|
| WiFi connected
| radioState = WIFI_CONNECTED
V
.-----------------------------------.
| STATE_BASE_FIXED_WIFI_CONNECTED |
.----------->| Solid WiFi Icon |
| | "Xmitting" |
| | "RTCM: 2145" |
| '-----------------------------------'
| |
| | Caster enabled
| V
| .-----------------------------------.
| Caster | STATE_BASE_FIXED_CASTER_STARTED |
| Connection | Solid WiFi Icon |
| Failed | "Xmitting" |
+------------| "RTCM: 2145" |
^ Failed '-----------------------------------'
| Authroization |
| | Caster connected
| V
| .-----------------------------------.
| Caster | STATE_BASE_FIXED_WIFI_CONNECTED |
| Connection | Solid WiFi Icon |
| Failed | "Casting" |
'------------| "RTCM: 2145" |
'-----------------------------------'

*/

//User has set switch to base with fixed option enabled. Let's configure and try to get there.
//If fixed base fails, we'll handle it here
case (STATE_BASE_FIXED_NOT_STARTED):
Expand Down