It adds the possibility to set "start conditions" for a PosTable entry. These are defined as a bit pattern (array, size set by global constant).
In this step 1, if there are start conditions programmed for an entry, PosTable will always schedule a standstill (state 5) and go to the new waiting state (even if conditions are already met).
See the diagram below.
Code changes
Add CONDITIONS_UBOUND global constant
This is used for setting the array sizes for the start conditions mechanism.
Users can easily scale the number of start conditions to their needs.
Update McePosTableEntry data type
Add startConditions (array of n bools)
This is where the user defines the start conditions for an entry. It only checks for TRUE states.
Update McePosTableIO data type
input: add conditions (array of n bools)
This is where the user connects the signals which are used as start condition.
Output: add missingConditions (array of n bools)
This informs the user which of the start conditions are not met for the current entry (entry[index])
Add McePosTableCheckConditions function
This function shall check the conditions for a given entry. It will return a McePosTableConditions struct.
It will be useful to determine which conditions are holding the trajectory.
input: index
input: posTableSize
input: conditions
in_out: PosTable
Add McePosTableConditions data type
hasConditions (bool)
TRUE if the entry requires a condition
conditionsOk (bool)
TRUE if all programmed start conditions for the entry are satisfied
missingCondition (array of n bools)
Indicates which of the conditions are not yet satisfied
Update McePosTableRemainingEntries
Next valid entry with conditions is processed as a "stop entry"
Update McePosTableRecalcQA
Next valid entry with conditions is processed as a "stop entry"
This implements step 1 of #31.
It adds the possibility to set "start conditions" for a PosTable entry. These are defined as a bit pattern (array, size set by global constant).
In this step 1, if there are start conditions programmed for an entry, PosTable will always schedule a standstill (state 5) and go to the new waiting state (even if conditions are already met). See the diagram below.
Code changes
Add
CONDITIONS_UBOUND
global constantThis is used for setting the array sizes for the start conditions mechanism. Users can easily scale the number of start conditions to their needs.
Update
McePosTableEntry
data typestartConditions
(array of n bools) This is where the user defines the start conditions for an entry. It only checks forTRUE
states.Update
McePosTableIO
data typeconditions
(array of n bools)This is where the user connects the signals which are used as start condition.
missingConditions
(array of n bools) This informs the user which of the start conditions are not met for the current entry (entry[index]
)Add
McePosTableCheckConditions
functionThis function shall check the conditions for a given entry. It will return a
McePosTableConditions
struct. It will be useful to determine which conditions are holding the trajectory.index
posTableSize
conditions
PosTable
Add
McePosTableConditions
data typehasConditions
(bool) TRUE if the entry requires a conditionconditionsOk
(bool)TRUE if all programmed start conditions for the entry are satisfied
missingCondition
(array of n bools)Indicates which of the conditions are not yet satisfied
Update
McePosTableRemainingEntries
Update
McePosTableRecalcQA
waitEntry
booleanUpdate
McePosTable
waitEntry
bit (likestopEntry
orlastEntry
)