-
Notifications
You must be signed in to change notification settings - Fork 7
Communication
The FIRASim communication is thought Google ProtoBuf (v.3 or up, as described in ReadME). It consists in receiving the packages with the command to the robots (wheel speeds) and sending the Vision Buffer to strategy code.
Here, it will be described which INFO are being passed in each Package,as well the IP Address and Port used to communication.
The Vision Communication is via Multicast. In this way, the sender can transmit the message for more than one recivers. For that, the range of IP Address must be in range 224.0.0.0 to 239.255.255.255. By default, the IP used in FiraSimulator is 224.0.0.1. The port used to send the message is 10020.
The receiver port (which receives the INFO with the commands) is located in the port 20011.
The Packet corresponds to the information received by simulator.
Packet { Commands cmd = 1; Replacement replace = 2; }
The commands corresponds to the information to move the robots. Replacement is used to the arbiter communicates with the Simulator (NOT USED. The arbiter is already inside the simulator).
The commands carry the data from multiple commands responsible for robots moving.
message Command { uint32 id = 1; bool yellowteam = 2; double wheel_left = 6; double wheel_right = 7; }
message Commands { repeated Command robot_commands = 1; }
Each command has the robot id, a bool specifying if it is from yellowteam and the speeds for the wheels, wheel_left and wheel_right.
uint32 step = 1; Frame frame = 2; Field field = 3; uint32 goals_blue = 4; uint32 goals_yellow =5;
The environment carries the INFO about the step, i.e. the time of the current match, the _field _ information, the frame, with ball and robots pose information and the goals from each team.
double width = 1; double length = 2; double goal_width = 3; double goal_depth = 4;
The field information contains the field width and length as well as the goal's width and depth, as can be seen in the figure below.
message Ball { double x = 1; double y = 2; double z = 3; double vx = 4; double vy = 5; double vz = 6; }
message Robot { uint32 robot_id = 1; double x = 2; double y = 3; double orientation = 4; double vx = 5; double vy = 6; double vorientation = 7; }
message Frame { Ball ball = 1; repeated Robot robots_yellow = 2; repeated Robot robots_blue = 3; }
The frame contains the ball, the robots_yellow and the robots_blue. The ball contains its position in x, y and z as well its speed in the 3 axis. Each robot yellow contains it position in x and y and its angle, as well as its speed in x and y and its angular speed. Each robot blue contains it position in x and y and its angle, as well as its speed in x and y and its angular speed.