## For instruction on writing tutorials
## http://www.ros.org/wiki/WritingTutorials
####################################
##FILL ME IN
####################################
## for a custom note with links:
## note =
## for the canned note of "This tutorial assumes that you have completed the previous tutorials:" just add the links
## note.1=
## descriptive title for the tutorial
## title = HSM
## multi-line description to be displayed in search
## description = Writing Hierarchical FSM
## the next tutorial description (optional)
## next =
## links to next tutorial (optional)
## next.1.link=[[decision_making/Tutorials/BehaviorTree]]
## next.2.link=
## what level user is this tutorial for
## level= BeginnerCategory
## keywords = decision_making
####################################
<<IncludeCSTemplate(TutorialCSHeaderTemplate)>>

<<TableOfContents(4)>>

== Introduction ==

One way to avoid the explosion of states and events is to design the FSM in a hierarchical manner. First, there are a number of high-level states, corresponding to very broad contexts of the robot behavior. Then within each high-level state, we could have many sub-states, which would be used for modeling more refined behaviors within this state. The resulting system is called a hierarchical finite state machine (HFSM). 

HSMs use the same annotation as FSM. In order to call hierarchical calls between FSM, from your current FSM use FSM_CALL_FSM [[http://wiki.ros.org/decision_making/Tutorials/FSM%28C%2B%2B%29#FSM_CALL_FSM]]

== Reading material ==
 1. FSM, HSM and Behavior trees[[http://www.cs.umd.edu/class/spring2013/cmsc425/Lects/lect20.pdf]]

## AUTOGENERATED DO NOT DELETE
## TutorialCategory
## FILL IN THE STACK TUTORIAL CATEGORY HERE