mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-08-06 01:37:33 +00:00
cleanup: separate functions for requesting and forcing state transitions, fix publishing behavior
This commit is contained in:
@@ -41,11 +41,23 @@ namespace sta
|
||||
* @param from The start we want to transition from.
|
||||
* @param to The state we want to transition to.
|
||||
* @param lockout An optional timer blocking state transition for a given time.
|
||||
* @param force If true, the state transition will be executed regardless of the current state.
|
||||
* @param publish If true, the state transition will be published via CAN.
|
||||
*
|
||||
* @ingroup tacos_api
|
||||
*/
|
||||
void setState(uint32_t from, uint32_t to, uint32_t lockout = 0, bool force = false, bool publish = false);
|
||||
void requestState(uint32_t from, uint32_t to, uint32_t lockout = 0, bool publish = true);
|
||||
|
||||
/**
|
||||
* @brief Request a state transition. Invalid state transitions will be dismissed.
|
||||
*
|
||||
* @param from The start we want to transition from.
|
||||
* @param to The state we want to transition to.
|
||||
* @param lockout An optional timer blocking state transition for a given time.
|
||||
* @param publish If true, the state transition will be published via CAN.
|
||||
*
|
||||
* @ingroup tacos_api
|
||||
*/
|
||||
void forceState(uint32_t from, uint32_t to, uint32_t lockout = 0, bool publish = true);
|
||||
|
||||
/**
|
||||
* @brief Request a state transition after a given time has passed. Invalid state transitions will be dismissed.
|
||||
|
@@ -174,11 +174,23 @@ namespace sta
|
||||
* @param from The state which we want to leave. This is used to filter out obsolete transitions.
|
||||
* @param to The state to transition to.
|
||||
* @param lockout The minimum number of milliseconds we expect to stay in this state. This is used to block premature transitions.
|
||||
* @param force If true, the state transition will be executed regardless of the current state.
|
||||
* @param publish If true, the state transition will be published via CAN.
|
||||
*
|
||||
* @ingroup tacos_statemachine
|
||||
*/
|
||||
void requestStateTransition(uint32_t from, uint32_t to, uint32_t lockout = 0, bool force = false, bool publish = true);
|
||||
void requestStateTransition(uint32_t from, uint32_t to, uint32_t lockout = 0, bool publish = true);
|
||||
|
||||
/**
|
||||
* @brief Request a state transition from a state to another.
|
||||
*
|
||||
* @param from The state which we want to leave. This is used to filter out obsolete transitions.
|
||||
* @param to The state to transition to.
|
||||
* @param lockout The minimum number of milliseconds we expect to stay in this state. This is used to block premature transitions.
|
||||
* @param publish If true, the state transition will be published via CAN.
|
||||
*
|
||||
* @ingroup tacos_statemachine
|
||||
*/
|
||||
void forceStateTransition(uint32_t from, uint32_t to, uint32_t lockout = 0, bool publish = true);
|
||||
|
||||
/**
|
||||
* @brief Request a state transition after a given time has passed.
|
||||
@@ -187,6 +199,7 @@ namespace sta
|
||||
* @param to The state to transition to.
|
||||
* @param millis the number of milliseconds to wait before triggering the transition.
|
||||
* @param lockout The minimum number of milliseconds we expect to stay in this state. This is used to block premature transitions.
|
||||
* @param publish If true, the state transition will be published via CAN.
|
||||
*
|
||||
* @ingroup tacos_statemachine
|
||||
*/
|
||||
|
Reference in New Issue
Block a user