16 #include <ros/console.h> 25 int main(
int argc,
char** argv) {
26 ros::init(argc, argv,
"teams_adapter");
32 int32_t yellow_port = teams_configurer.
get_port(travesim::TeamsConfigurer::TeamColor::YELLOW);
33 std::string yellow_address_str = teams_configurer.
get_address(travesim::TeamsConfigurer::TeamColor::YELLOW);
35 int32_t blue_port = teams_configurer.
get_port(travesim::TeamsConfigurer::TeamColor::BLUE);
36 std::string blue_address_str = teams_configurer.
get_address(travesim::TeamsConfigurer::TeamColor::BLUE);
51 ROS_ERROR_STREAM(
"Invalid number of robots per team");
66 ROS_INFO_STREAM(
"Teams adapter config:" << std::endl << teams_configurer);
69 if (yellow_receiver.
receive(&yellow_command) || blue_receiver.
receive(&blue_command)) {
70 teams_sender.
send(&yellow_command, &blue_command);
75 yellow_port = teams_configurer.
get_port(travesim::TeamsConfigurer::TeamColor::YELLOW);
76 yellow_address_str = teams_configurer.
get_address(travesim::TeamsConfigurer::TeamColor::YELLOW);
78 blue_port = teams_configurer.
get_port(travesim::TeamsConfigurer::TeamColor::BLUE);
79 blue_address_str = teams_configurer.
get_address(travesim::TeamsConfigurer::TeamColor::BLUE);
86 yellow_receiver.
reset();
91 blue_receiver.
reset();
94 ROS_INFO_STREAM(
"Teams adapter config:" << std::endl << teams_configurer);
void force_specific_source(bool force_specific_source)
Set wheter to enable any source or source specific multicast. True for specific source,...
ROS teams commands sender class definition.
Team control data receiver with UDP and protobuf.
void set_receiver_endpoint(const std::string receiver_address, const short receiver_port)
Set the receiver endpoint.
Team command data structure.
Data structure to hold the command for a team.
Team control data receiver class with UDP and protobuf.
void send(TeamCommand *yellow_team_command, TeamCommand *blue_team_command)
Send the stored commands to Gazebo controllers.
TeamsFormation
Formation of the teams.
void reset(void)
Reset the receiver.
int main(int argc, char **argv)
bool receive(TeamCommand *p_team_cmd)
Receive the command from a team.