0% found this document useful (0 votes)
41 views1 page

Hierarchical State Machine Defense

This header file defines functions and data types for a hierarchical state machine to control a robot's defense behavior. It defines an enumerated type for the different defense states like rotating clockwise, driving straight, or waiting at a goal. It also prototypes public functions for running and starting the state machine, querying the current state, and checking for sharp sensor events.

Uploaded by

api-397509789
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views1 page

Hierarchical State Machine Defense

This header file defines functions and data types for a hierarchical state machine to control a robot's defense behavior. It defines an enumerated type for the different defense states like rotating clockwise, driving straight, or waiting at a goal. It also prototypes public functions for running and starting the state machine, querying the current state, and checking for sharp sensor events.

Uploaded by

api-397509789
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

/****************************************************************************

Defense header file for Hierarchical Sate Machines AKA StateCharts


02/08/12 adjsutments for use with the Events and Services Framework Gen2
3/17/09 Fixed prototpyes to use Event_t

****************************************************************************/

#ifndef Defense_SM_H
#define Defense_SM_H

// typedefs for the states


// State definitions for use with the query function
//typedef enum { LINE_FOLLOWING_DEFENSE, ROTATING_CW, DRIVING_STRAIGHT,
WAITING_AT_GOAL, ROTATING_CCW, ROTATING_CW_EDGE_CASE } DefenseState_t ;
typedef enum {ROTATING_CW, DRIVING_STRAIGHT, WAITING_AT_GOAL, ROTATING_CW_2,
DRIVING_STRAIGHT_2, WAITING_AT_OPPONENT_RELOADER } DefenseState_t ;

// Public Function Prototypes

ES_Event_t RunDefenseSM( ES_Event_t CurrentEvent );


void StartDefenseSM ( ES_Event_t CurrentEvent );
DefenseState_t QueryDefenseSM ( void );
bool Check4SharpEvents(void);

#endif /*Defense_SM_H */

You might also like