How to track success/failure of SMACH states
Hello,
I have a SMACH state machine that simulates navigating to three different rooms and performing a number of cleaning tasks in each room. I'd like to be able to track which tasks succeed or fail as well as which rooms may not be reached at all, perhaps due to obstacles. I'm using the SimpleActionState to wrap move_base for navigating to each room. I then have simple states for each cleaning task such as Vacuum(), Mop(), etc. The top level state machine navigates to a room, performs the tasks for that room, then moves to the next room and so on.
My question is: what is the SMACH way to track which tasks were completed and which rooms were actually reached? Should I be passing userdata, using callbacks, or some kind of global Python variable(s)? When the state machine completes, I want to know if certain rooms or tasks need to be revisited.
Thanks!
patrick