TraveSim Adapters  0.1
Protobuf adapters for TraveSim project
teams_sender.hpp
Go to the documentation of this file.
1 /**
2  * @file teams_sender.hpp
3  *
4  * @author Felipe Gomes de Melo <felipe.gomes@thunderatz.org>
5  * @author Lucas Haug <lucas.haug@thunderatz.org>
6  *
7  * @brief ROS teams commands sender class definition
8  *
9  * @date 06/2021
10  *
11  * @copyright MIT License - Copyright (c) 2021 ThundeRatz
12  *
13  */
14 
15 #ifndef __TEAMS_SENDER_H__
16 #define __TEAMS_SENDER_H__
17 
18 #include <ros/ros.h>
19 #include <ros/console.h>
20 
23 
24 #include <vector>
25 #include <iostream>
26 
27 namespace travesim {
28 namespace ros_side {
29 /**
30  * @brief Helper struct to group same robot command topics
31  */
32 typedef struct {
33  ros::Publisher left;
34  ros::Publisher right;
36 
37 class TeamsSender {
38  private:
39  /**
40  * @brief Yellow team ROS publishers
41  *
42  */
43  std::vector<robot_command_pub_t> yellow_pubs;
44 
45  /**
46  * @brief Blue team ROS publishers
47  *
48  */
49  std::vector<robot_command_pub_t> blue_pubs;
50 
51  uint8_t robots_per_team;
52 
53  public:
54  /**
55  * @brief Construct a new Teams Sender object
56  *
57  * @param teams_formation Number of robots per team, default is 3
58  */
60 
61  /**
62  * @brief Send the stored commands to Gazebo controllers
63  *
64  */
65  void send(TeamCommand* yellow_team_command, TeamCommand* blue_team_command);
66 };
67 } // ros_side
68 } // travesim
69 
70 #endif // __TEAMS_SENDER_H__
std::vector< robot_command_pub_t > yellow_pubs
Yellow team ROS publishers.
Common constants and types for the data structures.
std::vector< robot_command_pub_t > blue_pubs
Blue team ROS publishers.
Team command data structure.
Data structure to hold the command for a team.
TeamsSender(TeamsFormation teams_formation=TeamsFormation::THREE_ROBOTS_PER_TEAM)
Construct a new Teams Sender object.
Helper struct to group same robot command topics.
void send(TeamCommand *yellow_team_command, TeamCommand *blue_team_command)
Send the stored commands to Gazebo controllers.
TeamsFormation
Formation of the teams.
Definition: data_common.hpp:40