RobotLocomotion / robot-plan-runner

10 stars 4 forks source link

Implementing StateMachine as a Diagram. #31

Open pangtao22 opened 3 years ago

pangtao22 commented 3 years ago

With the performance issue of Systems largely resolved (#29), the remaining question asked by @RussTedrake is whether the StateMachine can be converted to a Diagram where state-dependent behavior is controlled by a PortSwitch. It certainly seems doable, but a more insightful answer can only be obtained by digging into the details. For example, the request-reply behavior used in aborting the current plan, supported by ZMQ, is not supported by LCM, but can certainly be emulated by having multiple LCM channels, but this will lead to more cumbersome Diagrams or event handling/input port updating in LCM-driven loop.

I think a good first step is to identify an essential subset of the features supported by StateMachine and implement those features as a Diagram.