NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
executive::OpState Class Reference

#include <op_state.h>

Inheritance diagram for executive::OpState:
Inheritance graph

Public Member Functions

virtual ~OpState ()
 
virtual OpStateStartupState (std::string const &cmd_id="")
 
virtual OpStateHandleCmd (ff_msgs::CommandStampedPtr const &cmd)
 
OpStateHandleCmd (ff_msgs::CommandStampedPtr const &cmd, bool &completed, bool &successful)
 
virtual OpStateHandleResult (ff_util::FreeFlyerActionState::Enum const &state, std::string const &result_response, std::string const &cmd_id, Action const &action)
 
virtual OpStateHandleWaitCallback ()
 
virtual OpStateHandleGuestScienceAck (ff_msgs::AckStampedConstPtr const &ack)
 
virtual void AckCmd (std::string const &cmd_id, uint8_t completed_status=ff_msgs::AckCompletedStatus::OK, std::string const &message="", uint8_t status=ff_msgs::AckStatus::COMPLETED)
 
std::string GenerateActionFailedMsg (ff_util::FreeFlyerActionState::Enum const &state, Action const &action, std::string const &action_result="")
 
std::string GetActionString (Action const &action)
 
virtual bool PausePlan (ff_msgs::CommandStampedPtr const &cmd)
 
OpStateTransitionToState (unsigned char id)
 
std::string const & name () const
 
unsigned char const & id () const
 

Protected Member Functions

 OpState (std::string const &name, unsigned char id)
 
void SetExec (Executive *const exec)
 
void SetPlanStatus (bool successful, std::string err_msg="")
 

Protected Attributes

const std::string name_
 
unsigned const char id_
 
Executiveexec_
 

Friends

class OpStateRepo
 

Detailed Description

OpState class must be derived from for each operating state and added to the OpStateRepo, allowing explicit state specific behavior

Constructor & Destructor Documentation

◆ ~OpState()

virtual executive::OpState::~OpState ( )
inlinevirtual

◆ OpState()

executive::OpState::OpState ( std::string const &  name,
unsigned char  id 
)
protected

Member Function Documentation

◆ AckCmd()

void executive::OpState::AckCmd ( std::string const &  cmd_id,
uint8_t  completed_status = ff_msgs::AckCompletedStatus::OK,
std::string const &  message = "",
uint8_t  status = ff_msgs::AckStatus::COMPLETED 
)
virtual

Reimplemented in executive::OpStatePlanExec.

◆ GenerateActionFailedMsg()

std::string executive::OpState::GenerateActionFailedMsg ( ff_util::FreeFlyerActionState::Enum const &  state,
Action const &  action,
std::string const &  action_result = "" 
)

◆ GetActionString()

std::string executive::OpState::GetActionString ( Action const &  action)

◆ HandleCmd() [1/2]

OpState * executive::OpState::HandleCmd ( ff_msgs::CommandStampedPtr const &  cmd)
virtual

◆ HandleCmd() [2/2]

OpState * executive::OpState::HandleCmd ( ff_msgs::CommandStampedPtr const &  cmd,
bool &  completed,
bool &  successful 
)

◆ HandleGuestScienceAck()

OpState * executive::OpState::HandleGuestScienceAck ( ff_msgs::AckStampedConstPtr const &  ack)
virtual

◆ HandleResult()

OpState * executive::OpState::HandleResult ( ff_util::FreeFlyerActionState::Enum const &  state,
std::string const &  result_response,
std::string const &  cmd_id,
Action const &  action 
)
virtual

◆ HandleWaitCallback()

OpState * executive::OpState::HandleWaitCallback ( )
virtual

Reimplemented in executive::OpStatePlanExec.

◆ id()

unsigned char const& executive::OpState::id ( ) const
inline

◆ name()

std::string const& executive::OpState::name ( ) const
inline

◆ PausePlan()

bool executive::OpState::PausePlan ( ff_msgs::CommandStampedPtr const &  cmd)
virtual

Reimplemented in executive::OpStatePlanExec.

◆ SetExec()

void executive::OpState::SetExec ( Executive *const  exec)
protected

◆ SetPlanStatus()

void executive::OpState::SetPlanStatus ( bool  successful,
std::string  err_msg = "" 
)
protected

◆ StartupState()

OpState * executive::OpState::StartupState ( std::string const &  cmd_id = "")
virtual

Reimplemented in executive::OpStatePlanExec.

◆ TransitionToState()

OpState * executive::OpState::TransitionToState ( unsigned char  id)

Friends And Related Function Documentation

◆ OpStateRepo

friend class OpStateRepo
friend

Member Data Documentation

◆ exec_

Executive* executive::OpState::exec_
protected

◆ id_

unsigned const char executive::OpState::id_
protected

◆ name_

const std::string executive::OpState::name_
protected

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