TraveSim Adapters  0.1
Protobuf adapters for TraveSim project
travesim::TeamCommand Class Reference

Data structure to hold the command for a team. More...

#include "team_command.hpp"

Collaboration diagram for travesim::TeamCommand:

Public Member Functions

 TeamCommand (TeamsFormation teams_formation=TeamsFormation::THREE_ROBOTS_PER_TEAM)
 Construct a new Team Command object. More...
 

Public Attributes

uint8_t robots_per_team
 Public attributes. More...
 
std::vector< RobotCommandrobot_command
 

Friends

std::ostream & operator<< (std::ostream &output, const TeamCommand &command)
 Output stream operator overloading. More...
 

Detailed Description

Data structure to hold the command for a team.

Definition at line 52 of file team_command.hpp.

Constructor & Destructor Documentation

◆ TeamCommand()

travesim::TeamCommand::TeamCommand ( TeamsFormation  teams_formation = TeamsFormation::THREE_ROBOTS_PER_TEAM)

Construct a new Team Command object.

Parameters
teams_formationNumber of robots per team, default is 3

Definition at line 37 of file team_command.cpp.

37  : robots_per_team(teams_formation) {
38  this->robot_command = std::vector<RobotCommand>(this->robots_per_team);
39 }
uint8_t robots_per_team
Public attributes.
std::vector< RobotCommand > robot_command

References robot_command, and robots_per_team.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  output,
const TeamCommand command 
)
friend

Output stream operator overloading.

Definition at line 41 of file team_command.cpp.

41  {
42  output << std::fixed << std::setprecision(PRINTING_DECIMAL_PRECISION);
43 
44  for (int i = 0; i < command.robots_per_team; i++) {
45  output << "ROBOT " << i << ":" << std::endl;
46  output << command.robot_command[i] << std::endl;
47  output << std::endl;
48  }
49 
50  return output;
51 }
#define PRINTING_DECIMAL_PRECISION
Definition: data_common.hpp:22

Member Data Documentation

◆ robot_command

std::vector<RobotCommand> travesim::TeamCommand::robot_command

Definition at line 73 of file team_command.hpp.

◆ robots_per_team

uint8_t travesim::TeamCommand::robots_per_team

Public attributes.

Definition at line 71 of file team_command.hpp.


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