I've built some robotic systems that rely on handcrafted hierarchical FSM, I'm hoping to learn more by studying codes from some open source system that have more complex structures. Can anyone point out some open source robotics projects that have complex software structure? For example, a service humannoid robot might need to handle different situations, so if it's a handcrafted system then it should have a complex structure storing and retrieving instances of interaction. It shouldn't just be a system like an end-to-end deep reinforcement learning based humanoid walking because this system encapsulates too much its working functions in a blackbox but still pretty straightforward in terms of input-output relationships in control and perception.
Robotics software can be separated into environments and the motion controller itself. Notable example for robotics environments are ROS or Lejos. They are providing hardware capabilities to control the robot on a physical level and they have built in message passing features. On top of ROS and similar software so called robotics controllers are realized. That's a cognitive layer which is able to control the robot autonomously. A motion controller is a replacement for a manual driven remote control. They are replacing a human operator.
The robot controller can be realized with the mentioned hierarchical FSM, deeplearning or with behavior trees. In most cases, domain knowledge has to be given in a machine readable language. More simpler controller are able to pathplanning the trajectory between two points. They are working with searching in the state space. The lejos project provides a built-in package for finding the shortest path between points which is helpful for implementing an obstacle avoidance system.
4D/RCS is a more complicated system. I recall that there were only a couple systems implementing it that had publications written. It's the most comprehensive system design I've seen published. I know of others but they are not as well documented.
Understanding the RCS approach and how FSMs fit (or don't) within will definitely give you a better understanding of the pros and cons of FSMs.