We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For example the current version
State *Idle::checkTransition(Logger &log) { updateModuleData(); bool emergency = checkEmergency(log, embrakes_data_, nav_data_, batteries_data_, telemetry_data_, sensors_data_, motors_data_); if (emergency) { return FailureStopped::getInstance(); } bool calibrate_command = checkCalibrateCommand(log, telemetry_data_); if (!calibrate_command) { return nullptr; } bool all_initialised = checkModulesInitialised(log, embrakes_data_, nav_data_, batteries_data_, telemetry_data_, sensors_data_, motors_data_); if (all_initialised) { return Calibrating::getInstance(); } return nullptr; }
should be rewritten to
const State *Idle::checkTransition(Logger &log) { updateModuleData(); const bool emergency = checkEmergency(log, embrakes_data_, nav_data_, batteries_data_, telemetry_data_, sensors_data_, motors_data_); if (emergency) { return FailureStopped::getInstance(); } const bool calibrate_command = checkCalibrateCommand(log, telemetry_data_); if (!calibrate_command) { return nullptr; } const bool all_initialised = checkModulesInitialised(log, embrakes_data_, nav_data_, batteries_data_, telemetry_data_, sensors_data_, motors_data_); if (all_initialised) { return Calibrating::getInstance(); } return nullptr; }
Alternatives like
std::optional<std::unique_ptr<State>> Idle::checkTransition(Logger &log)
also seem possible. Similarly, all transition functions should only use const references to the data objects.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
For example the current version
should be rewritten to
Alternatives like
std::optional<std::unique_ptr<State>> Idle::checkTransition(Logger &log)
also seem possible.
Similarly, all transition functions should only use const references to the data objects.
The text was updated successfully, but these errors were encountered: