This package is for high level state_machine code for the competition
It is going to have code for a Finite State Machine (usign the ros smach package)
NOTE: there is a bug with smach that you sometimes can't kill it with CTRL+C. There are a few solutions to this problem.
- Go into teleop mode and double tap the select button. Then kill the node normally.
- Run
ps -x
, find the pid of the node andkill -9 <PID>
it.)
Here is an example of a prototype state machine from last year
To get started, build your workspace with this package, and run
roslaunch amee_2dnav all.launch
roslaunch fsm test.launch
rosrun fsm competition_smach.py
and rviz will also be helpful
rviz
You will want to read over the documentation for the smach package to figure out what is going on.
About smach
Here are some notes from last year:
To view the current state of the smach, run:
rosrun rqt_smach rqt_smach
NOTE: If you are running this on your own smach, you must add the
introspection server, see competition_smach.py.
smach is a ROS package that allows you to create state machines, good for linking together several actions and behaviors in sequence for more complicated autonomous behavior. It was used by Willow Garage in their milestone with the PR2, including being able to plug itself in.
The code for our state machine lives in the competition_smach.py
file. The
top level consists of a Concurrence container for autonomy and a MonitorState
for teleop. The Concurrence container allows us to run a MonitorState at the
same time as the main autonomy path. We listen to the /teleop_toggle
topic,
and if anything is published to this topic, we abort all of the autonomy
sequence and enter teleop mode.