16 #include <std_msgs/Float64.h> 30 #define ROBOT_WHEEL_TOPIC(color, num, side) \ 31 "/" color "_team/robot_" + std::to_string(num) + "/" side "_controller/command" 59 std_msgs::Float64 yellow_left_msg, yellow_right_msg;
60 std_msgs::Float64 blue_left_msg, blue_right_msg;
63 yellow_left_msg.data = yellow_team_command->
robot_command[i].left_speed;
64 yellow_right_msg.data = yellow_team_command->
robot_command[i].right_speed;
66 blue_left_msg.data = blue_team_command->
robot_command[i].left_speed;
67 blue_right_msg.data = blue_team_command->
robot_command[i].right_speed;
70 this->
yellow_pubs[i].right.publish(yellow_right_msg);
72 this->
blue_pubs[i].left.publish(blue_left_msg);
73 this->
blue_pubs[i].right.publish(blue_right_msg);
std::vector< robot_command_pub_t > yellow_pubs
Yellow team ROS publishers.
std::vector< robot_command_pub_t > blue_pubs
Blue team ROS publishers.
ROS teams commands sender class definition.
std::vector< RobotCommand > robot_command
Data structure to hold the command for a team.
TeamsSender(TeamsFormation teams_formation=TeamsFormation::THREE_ROBOTS_PER_TEAM)
Construct a new Teams Sender object.
void send(TeamCommand *yellow_team_command, TeamCommand *blue_team_command)
Send the stored commands to Gazebo controllers.
#define ROBOT_WHEEL_TOPIC(color, num, side)
TeamsFormation
Formation of the teams.