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

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

#include "team_command.hpp"

Collaboration diagram for travesim::RobotCommand:

Public Member Functions

 RobotCommand (double left_speed=0, double right_speed=0)
 Construct a new Robot Command object. More...
 

Public Attributes

double left_speed
 Public attributes. More...
 
double right_speed
 

Friends

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

Detailed Description

Data structure to hold the command for a robot.

Definition at line 24 of file team_command.hpp.

Constructor & Destructor Documentation

◆ RobotCommand()

travesim::RobotCommand::RobotCommand ( double  left_speed = 0,
double  right_speed = 0 
)

Construct a new Robot Command object.

Parameters
left_speedCommand left speed
right_speedCommand right speed

Definition at line 19 of file team_command.cpp.

19  {
20  this->left_speed = left_speed;
21  this->right_speed = right_speed;
22 }
double left_speed
Public attributes.

References left_speed, and right_speed.

Friends And Related Function Documentation

◆ operator<<

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

Output stream operator overloading.

Definition at line 24 of file team_command.cpp.

24  {
25  output << std::fixed << std::setprecision(PRINTING_DECIMAL_PRECISION);
26 
27  output << "LEFT SPEED: " << std::setw(PRINTING_MIN_WIDTH) << command.left_speed << std::endl;
28  output << "RIGHT SPEED: " << std::setw(PRINTING_MIN_WIDTH) << command.right_speed;
29 
30  return output;
31 }
#define PRINTING_DECIMAL_PRECISION
Definition: data_common.hpp:22
#define PRINTING_MIN_WIDTH
Printing output configuration constants.
Definition: data_common.hpp:21

Member Data Documentation

◆ left_speed

double travesim::RobotCommand::left_speed

Public attributes.

Definition at line 44 of file team_command.hpp.

◆ right_speed

double travesim::RobotCommand::right_speed

Definition at line 45 of file team_command.hpp.


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