gusimplewhiteboard
guWhiteboard::NAO_State Class Reference

This class is for the robot to report its current state. More...

#include <NAO_State.hpp>

Inheritance diagram for guWhiteboard::NAO_State:
Collaboration diagram for guWhiteboard::NAO_State:

Public Member Functions

 NAO_State ()
 Constructor, calls the data structs default constructor, which sets some default values. More...
 
bool fallen () const
 Convenience method for checking the Fallen values. More...
 
 NAO_State (const std::string &command)
 string constructor (see from_string() below) More...
 
std::string description ()
 pretty print method for showing the current property values More...
 
void from_string (const std::string &str)
 parse class properties from a string More...
 
- Public Member Functions inherited from wb_nao_state
 PROPERTY (enum Robot_Stance, stance) PROPERTY(enum Robot_Walk
 Currently SMRobotPosition detects if the robot has fallen over. More...
 
walk PROPERTY (bool, chest_pressed_long) PROPERTY(bool
 chest pressed for more than half a second More...
 
walk left_foot_pressed_long PROPERTY (bool, right_foot_pressed_long) PROPERTY(bool
 right foot pressed for more than half a second More...
 
walk left_foot_pressed_long chest_pressed PROPERTY (bool, left_foot_pressed) PROPERTY(bool
 left foot pressed
More...
 
 wb_nao_state ()
 constructor More...
 

Additional Inherited Members

- Public Attributes inherited from wb_nao_state
walk left_foot_pressed_long chest_pressed right_foot_pressed int16_t pad
 padding More...
 

Detailed Description

This class is for the robot to report its current state.

It is updated by various machines

NOTE: Read, Change, Write operations in state machines will not result in a race condition here. clfsm evaluates and runs states synchronously

Examples

Get the 'sticky' state of the Chest Button (worked out and updated by the SMButtonChest fsm)

NAO_State s = NAO_State_t.get(); //get from the whiteboard
bool button_state = s.chest_pressed_long(); //pull the variable out of the class

Definition at line 61 of file NAO_State.hpp.

Constructor & Destructor Documentation

◆ NAO_State() [1/2]

guWhiteboard::NAO_State::NAO_State ( )
inline

Constructor, calls the data structs default constructor, which sets some default values.

Definition at line 65 of file NAO_State.hpp.

◆ NAO_State() [2/2]

guWhiteboard::NAO_State::NAO_State ( const std::string &  command)
inline

string constructor (see from_string() below)

Parameters
[in]commanda serialised string containing properties to set in this class

Definition at line 74 of file NAO_State.hpp.

References from_string().

Member Function Documentation

◆ description()

std::string guWhiteboard::NAO_State::description ( )
inline

pretty print method for showing the current property values

Returns
pretty printed string

Definition at line 79 of file NAO_State.hpp.

◆ fallen()

bool guWhiteboard::NAO_State::fallen ( ) const
inline

Convenience method for checking the Fallen values.

Definition at line 68 of file NAO_State.hpp.

References FallenBack, FallenForward, FallenLeft, and FallenRight.

◆ from_string()

void guWhiteboard::NAO_State::from_string ( const std::string &  str)
inline

parse class properties from a string

Parameters
[in]stra serialised string containing properties to set in this class

Definition at line 91 of file NAO_State.hpp.

References Modded_UNSW_Walk, NUM_OF_STANCES, NUM_OF_WALKS, and Standing.

Referenced by NAO_State().


The documentation for this class was generated from the following file: