Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
AriacScorer Class Reference

A scorer for the ARIAC game. More...

#include <AriacScorer.h>

List of all members.

Public Member Functions

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

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.

Protected Member Functions

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

Protected Attributes

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

Detailed Description

A scorer for the ARIAC game.

Definition at line 36 of file AriacScorer.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 27 of file AriacScorer.cpp.

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.

Get the score of the current goal.

Returns:
The score for the goal.

Definition at line 43 of file AriacScorer.cpp.

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.

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.

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

Definition at line 136 of file AriacScorer.cpp.

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

Definition at line 127 of file AriacScorer.cpp.

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

Current goal being monitored.

Definition at line 103 of file AriacScorer.h.

The score of the run.

Definition at line 124 of file AriacScorer.h.

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.

The trays to monitor the score of.

Definition at line 97 of file AriacScorer.h.

boost::mutex AriacScorer::kitTraysMutex [mutable, protected]

Mutex for protecting the kit trays being monitored.

Definition at line 100 of file AriacScorer.h.

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.

Flag for signalling new tray info to process.

Definition at line 106 of file AriacScorer.h.

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 Mon Sep 5 2016 03:41:33