nasa / fprime

F´ - A flight software and embedded systems framework
https://fprime.jpl.nasa.gov
Apache License 2.0
9.95k stars 1.28k forks source link

Comand completion wait for action completion #2782

Open csmith608 opened 2 weeks ago

csmith608 commented 2 weeks ago
F´ Version x.x.x
Affected Component Command Dispatcher/all components with commands

Feature Description

A commonly desired design pattern is to have commands wait for an action to complete before returning the command completion. For example, rather than sending a movement command and immediately returning, having the command wait for the movement to finish before completing. This would allow a sequence to call many in a row without guessing at the time that the motion takes to complete.

(Really, it would be great if the sequence or commander could choose when it completes, either immediately or upon action completion)

Rationale

This is a common design pattern and is currently difficult and time consuming to do in f prime. It is fairly easy to mess up and to have a command never return without careful state tracking. I'm not sure exactly what needs to happen, but I feel like this could be made easier and/or documented as a design pattern.