Public Member Functions | Private Member Functions | Private Attributes | List of all members
ColorSequenceChecker Class Reference

A class to monitor if the color sequence reported matches the color displayed in the light buoy. More...

#include <scan_dock_scoring_plugin.hh>

Public Member Functions

 ColorSequenceChecker (const std::vector< std::string > &_expectedColors, const std::string &_rosNameSpace, const std::string &_rosColorSequenceService)
 Constructor. More...
 
bool Correct () const
 Wheter a team submitted the color sequence and is correct or not. More...
 
void Disable ()
 Disable the ROS submission service. More...
 
void Enable ()
 Enable the ROS submission service. More...
 
bool SubmissionReceived () const
 Whether a team submitted the color sequence or not. More...
 

Private Member Functions

bool OnColorSequence (ros::ServiceEvent< vrx_gazebo::ColorSequence::Request, vrx_gazebo::ColorSequence::Response > &_event)
 Callback executed when a new color submission is received. More...
 

Private Attributes

bool colorSequenceReceived = false
 Whether the color sequence has been received or not. More...
 
ros::ServiceServer colorSequenceServer
 Service to generate and display a new color sequence. More...
 
std::string colorSequenceService
 ROS topic where the color sequence should be sent. More...
 
bool correctSequence = false
 Whether the color sequence received is correct or not. More...
 
std::vector< std::string > expectedSequence
 The expected color sequence. More...
 
ros::NodeHandle nh
 ROS Node handle. More...
 
std::string ns
 ROS namespace. More...
 

Detailed Description

A class to monitor if the color sequence reported matches the color displayed in the light buoy.

Definition at line 38 of file scan_dock_scoring_plugin.hh.

Constructor & Destructor Documentation

ColorSequenceChecker::ColorSequenceChecker ( const std::vector< std::string > &  _expectedColors,
const std::string &  _rosNameSpace,
const std::string &  _rosColorSequenceService 
)

Constructor.

Parameters
[in]_expectedColorsThe sequence of expected colors.
[in]_rosNameSpaceROS namespace.
[in]_rosColorSequenceServiceThe ROS service used to receive the color submisison.

Definition at line 24 of file scan_dock_scoring_plugin.cc.

Member Function Documentation

bool ColorSequenceChecker::Correct ( ) const

Wheter a team submitted the color sequence and is correct or not.

Returns
True when the team submitted the color sequence and it is correct or false otherwise.

Definition at line 60 of file scan_dock_scoring_plugin.cc.

void ColorSequenceChecker::Disable ( )

Disable the ROS submission service.

Definition at line 48 of file scan_dock_scoring_plugin.cc.

void ColorSequenceChecker::Enable ( )

Enable the ROS submission service.

Definition at line 41 of file scan_dock_scoring_plugin.cc.

bool ColorSequenceChecker::OnColorSequence ( ros::ServiceEvent< vrx_gazebo::ColorSequence::Request, vrx_gazebo::ColorSequence::Response > &  _event)
private

Callback executed when a new color submission is received.

Parameters
[in]_requestContains the submission.
[out]_resThe Response. Note that this will be true even if the reported sequence is incorrect.

Definition at line 66 of file scan_dock_scoring_plugin.cc.

bool ColorSequenceChecker::SubmissionReceived ( ) const

Whether a team submitted the color sequence or not.

Returns
True when the submission was received or false otherwise.

Definition at line 54 of file scan_dock_scoring_plugin.cc.

Member Data Documentation

bool ColorSequenceChecker::colorSequenceReceived = false
private

Whether the color sequence has been received or not.

Definition at line 87 of file scan_dock_scoring_plugin.hh.

ros::ServiceServer ColorSequenceChecker::colorSequenceServer
private

Service to generate and display a new color sequence.

Definition at line 84 of file scan_dock_scoring_plugin.hh.

std::string ColorSequenceChecker::colorSequenceService
private

ROS topic where the color sequence should be sent.

Definition at line 78 of file scan_dock_scoring_plugin.hh.

bool ColorSequenceChecker::correctSequence = false
private

Whether the color sequence received is correct or not.

Definition at line 90 of file scan_dock_scoring_plugin.hh.

std::vector<std::string> ColorSequenceChecker::expectedSequence
private

The expected color sequence.

Definition at line 72 of file scan_dock_scoring_plugin.hh.

ros::NodeHandle ColorSequenceChecker::nh
private

ROS Node handle.

Definition at line 81 of file scan_dock_scoring_plugin.hh.

std::string ColorSequenceChecker::ns
private

ROS namespace.

Definition at line 75 of file scan_dock_scoring_plugin.hh.


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


vrx_gazebo
Author(s): Brian Bingham , Carlos Aguero
autogenerated on Thu May 7 2020 03:54:56