Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AriacScorer Class Reference

A scorer for the ARIAC game. More...

#include <AriacScorer.h>

Public Member Functions

 AriacScorer ()
 Constructor. More...
 
void AssignGoal (const ariac::Goal &goal)
 Assign a goal to process. More...
 
ariac::GoalScore GetCurrentGoalScore ()
 Get the score of the current goal. More...
 
ariac::GameScore GetGameScore ()
 Get the current score. More...
 
bool GetTrayById (const ariac::TrayID_t &trayID, ariac::KitTray &kitTray)
 Get the kit tray with the specified ID. More...
 
bool IsCurrentGoalComplete ()
 Get the score of the current goal. More...
 
void OnGoalReceived (const osrf_gear::Goal::ConstPtr &goalMsg)
 Callback for receiving goal message. More...
 
void OnGripperStateReceived (const osrf_gear::VacuumGripperState &stateMsg)
 Callback for receiving gripper state message. More...
 
void OnTrayInfoReceived (const osrf_gear::KitTray::ConstPtr &trayMsg)
 Callback for receiving tray state message. More...
 
ariac::TrayScore SubmitTray (const ariac::KitTray &tray)
 Submit tray for scoring and store the result in the goal score. More...
 
ariac::GoalScore UnassignCurrentGoal (double timeTaken=0.0)
 Stop processing the current goal. More...
 
void Update (double timeStep=0.0)
 Update the scorer. More...
 
virtual ~AriacScorer ()
 Destructor. More...
 

Static Public Member Functions

static void FillKitFromMsg (const osrf_gear::Kit &kitMsg, ariac::Kit &kit)
 Helper function for filling a Kit from a kit ROS message. More...
 

Protected Member Functions

void ScoreCurrentState ()
 Calculate the score for the trays given the objects in them. More...
 
ariac::TrayScore ScoreTray (const ariac::KitTray &tray)
 Calculate the score for a tray given the type of kit being built. More...
 

Protected Attributes

ariac::Goal currentGoal
 Current goal being monitored. More...
 
ariac::GameScore gameScore
 The score of the run. More...
 
ariac::GoalScoregoalScore
 Pointer to the score of the current goal. More...
 
bool isPartTravelling = false
 Whether or not there is a travelling part in the gripper. More...
 
std::map< ariac::TrayID_t, ariac::KitTraykitTrays
 The trays to monitor the score of. More...
 
boost::mutex kitTraysMutex
 Mutex for protecting the kit trays being monitored. More...
 
ariac::Goal newGoal
 Goal receivd from goal messages. More...
 
bool newGoalReceived
 Flag for signalling new goal to process. More...
 
bool newTrayInfoReceived
 Flag for signalling new tray info to process. More...
 
ariac::ScoringParameters scoringParameters
 Parameters to use for calculating scores. More...
 

Detailed Description

A scorer for the ARIAC game.

Definition at line 36 of file AriacScorer.h.

Constructor & Destructor Documentation

AriacScorer::AriacScorer ( )

Constructor.

Definition at line 27 of file AriacScorer.cpp.

AriacScorer::~AriacScorer ( )
virtual

Destructor.

Definition at line 32 of file AriacScorer.cpp.

Member Function Documentation

void AriacScorer::AssignGoal ( const ariac::Goal goal)

Assign a goal to process.

Parameters
[in]goalThe goal.

Definition at line 293 of file AriacScorer.cpp.

void AriacScorer::FillKitFromMsg ( const osrf_gear::Kit &  kitMsg,
ariac::Kit kit 
)
static

Helper function for filling a Kit from a kit ROS message.

Definition at line 317 of file AriacScorer.cpp.

ariac::GoalScore AriacScorer::GetCurrentGoalScore ( )

Get the score of the current goal.

Returns
The score for the goal.

Definition at line 43 of file AriacScorer.cpp.

ariac::GameScore AriacScorer::GetGameScore ( )

Get the current score.

Parameters
[in]Thetime in seconds since the last update.
Returns
The score for the game.

Definition at line 37 of file AriacScorer.cpp.

bool AriacScorer::GetTrayById ( const ariac::TrayID_t trayID,
ariac::KitTray kitTray 
)

Get the kit tray with the specified ID.

Parameters
[in]trayIDThe ID of the tray to get.
[in]kitTrayThe kitTray found.
Returns
True if the tray was found, false otherwise.

Definition at line 114 of file AriacScorer.cpp.

bool AriacScorer::IsCurrentGoalComplete ( )

Get the score of the current goal.

Returns
True if the goal is complete.

Definition at line 79 of file AriacScorer.cpp.

void AriacScorer::OnGoalReceived ( const osrf_gear::Goal::ConstPtr &  goalMsg)

Callback for receiving goal message.

Definition at line 275 of file AriacScorer.cpp.

void AriacScorer::OnGripperStateReceived ( const osrf_gear::VacuumGripperState &  stateMsg)

Callback for receiving gripper state message.

Definition at line 334 of file AriacScorer.cpp.

void AriacScorer::OnTrayInfoReceived ( const osrf_gear::KitTray::ConstPtr &  trayMsg)

Callback for receiving tray state message.

Definition at line 251 of file AriacScorer.cpp.

void AriacScorer::ScoreCurrentState ( )
protected

Calculate the score for the trays given the objects in them.

Definition at line 85 of file AriacScorer.cpp.

ariac::TrayScore AriacScorer::ScoreTray ( const ariac::KitTray tray)
protected

Calculate the score for a tray given the type of kit being built.

Definition at line 136 of file AriacScorer.cpp.

ariac::TrayScore AriacScorer::SubmitTray ( const ariac::KitTray tray)

Submit tray for scoring and store the result in the goal score.

Definition at line 127 of file AriacScorer.cpp.

ariac::GoalScore AriacScorer::UnassignCurrentGoal ( double  timeTaken = 0.0)

Stop processing the current goal.

Parameters
[in]timeTakenThe time spent on the goal.
Returns
The score for the goal.

Definition at line 308 of file AriacScorer.cpp.

void AriacScorer::Update ( double  timeStep = 0.0)

Update the scorer.

Definition at line 49 of file AriacScorer.cpp.

Member Data Documentation

ariac::Goal AriacScorer::currentGoal
protected

Current goal being monitored.

Definition at line 103 of file AriacScorer.h.

ariac::GameScore AriacScorer::gameScore
protected

The score of the run.

Definition at line 124 of file AriacScorer.h.

ariac::GoalScore* AriacScorer::goalScore
protected

Pointer to the score of the current goal.

Definition at line 121 of file AriacScorer.h.

bool AriacScorer::isPartTravelling = false
protected

Whether or not there is a travelling part in the gripper.

Definition at line 112 of file AriacScorer.h.

std::map<ariac::TrayID_t, ariac::KitTray> AriacScorer::kitTrays
protected

The trays to monitor the score of.

Definition at line 97 of file AriacScorer.h.

boost::mutex AriacScorer::kitTraysMutex
mutableprotected

Mutex for protecting the kit trays being monitored.

Definition at line 100 of file AriacScorer.h.

ariac::Goal AriacScorer::newGoal
protected

Goal receivd from goal messages.

Definition at line 115 of file AriacScorer.h.

bool AriacScorer::newGoalReceived
protected

Flag for signalling new goal to process.

Definition at line 109 of file AriacScorer.h.

bool AriacScorer::newTrayInfoReceived
protected

Flag for signalling new tray info to process.

Definition at line 106 of file AriacScorer.h.

ariac::ScoringParameters AriacScorer::scoringParameters
protected

Parameters to use for calculating scores.

Definition at line 118 of file AriacScorer.h.


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


osrf_gear
Author(s):
autogenerated on Wed Sep 7 2016 03:48:12