TraveSim Adapters  0.1
Protobuf adapters for TraveSim project
team_command.hpp
Go to the documentation of this file.
1 /**
2  * @file team_command.hpp
3  *
4  * @brief Team command data structure
5  *
6  * @author Lucas Haug <lucas.haug@thunderatz.org>
7  *
8  * @date 06/2021
9  */
10 
11 #ifndef __TEAM_COMMAND_H__
12 #define __TEAM_COMMAND_H__
13 
14 #include <vector>
15 #include <iostream>
16 
18 
19 namespace travesim {
20 /**
21  * @brief Data structure to hold the command for a robot
22  *
23  */
24 class RobotCommand {
25  public:
26  /**
27  * @brief Construct a new Robot Command object
28  *
29  * @param left_speed Command left speed
30  * @param right_speed Command right speed
31  */
32  RobotCommand(double left_speed = 0, double right_speed = 0);
33 
34  /**
35  * @brief Output stream operator overloading
36  *
37  */
38  friend std::ostream& operator <<(std::ostream& output, const RobotCommand& command);
39 
40  /**
41  * @brief Public attributes
42  *
43  */
44  double left_speed;
45  double right_speed;
46 };
47 
48 /**
49  * @brief Data structure to hold the command for a team
50  *
51  */
52 class TeamCommand {
53  public:
54  /**
55  * @brief Construct a new Team Command object
56  *
57  * @param teams_formation Number of robots per team, default is 3
58  */
60 
61  /**
62  * @brief Output stream operator overloading
63  *
64  */
65  friend std::ostream& operator <<(std::ostream& output, const TeamCommand& command);
66 
67  /**
68  * @brief Public attributes
69  *
70  */
71  uint8_t robots_per_team;
72 
73  std::vector<RobotCommand> robot_command;
74 };
75 }
76 
77 #endif // __TEAM_COMMAND_H__
TeamCommand(TeamsFormation teams_formation=TeamsFormation::THREE_ROBOTS_PER_TEAM)
Construct a new Team Command object.
Common constants and types for the data structures.
uint8_t robots_per_team
Public attributes.
std::vector< RobotCommand > robot_command
Data structure to hold the command for a team.
Data structure to hold the command for a robot.
TeamsFormation
Formation of the teams.
Definition: data_common.hpp:40
friend std::ostream & operator<<(std::ostream &output, const TeamCommand &command)
Output stream operator overloading.
RobotCommand(double left_speed=0, double right_speed=0)
Construct a new Robot Command object.
friend std::ostream & operator<<(std::ostream &output, const RobotCommand &command)
Output stream operator overloading.
double left_speed
Public attributes.