rescue junior simplus

Select Sidearea

Robocup Junior Rescue Simulation Platform

Server/Client Messages

Server/Client Messages

Server/Client Messages

In Computer scienceclient-server is a software architecture model consisting of two parts, client systems, and server systems, both communicating over a computer network or on the same computer.

Both clients and servers are computers that communicate with each other. The client will send a request to the server and the server will process the request and send back the response. For example, the client will send a request to the server to receive the color sensor’s information and the server will receive this request send the information to the client. These requests and responses are done in terms of messages.  You may think is it possible to have this communication with only one computer and the answer is yes it’s possible and that’s how you are using the platform by following the setup structure.

client server structure

It should be mentioned that you don’t need to change the following message or writing extra code to communicate with the server. The Simplus platform done all this works for you by providing the following APIs. So don’t worry if you don’t understand the server/client approach or the following messages section and just glance at the next section and start to use one of the following APIs. 

Messages

This document explained each message entity. These messages communicate with all the supported languages by GRPC such as Python, C++, Java (incl. support for Android), Objective-C (for iOS), Ruby, Go, Node.js, and C#. In order to show this communication, we create a Python API which will be described in the next section.

WorldInfo

message WorldInfo {
  int32 team_size                  = 1; # number of team participating
  int32 robot_per_team             = 2; # number of robots per team
  int32 color_sensor_size          = 3; # number of color sensors per robot
  int32 proximity_sensor_size      = 4; # number of proximity sensors per robot
  repeated CheckPoint check_points = 5; # a list of checkpoint and score of each of them
}
message CheckPoint {
  string color = 1; # Color of the check point
  int32 point  = 2; # Score of the check point
}

Server Info

message ServerInfo {
  uint32 time         = 1; # Time of Game
  string server_state = 2; # Server Status
  int32 my_score      = 3; # Score of Your Robot/Team
  int32 opp_score     = 4; # Score of Opponent Team (if exists)
}

Team Info

message TeamInfo {
  string name = 1; # Team registered name
}

Observations

message Observations {
  ServerInfo server = 1; # Server Info
  repeated Observation robots = 2; # List of Robots Observations
}
message Observation {
  Image camera = 1; # Camera Image
  repeated Pixel colors = 2; # Output of color sensor
  repeated Proximity distances = 3; # Output of proximity sensors
  Position pos = 4; # Absolute Position of Robot in the world
}
message Image {
  int32 w = 1;
  int32 h = 2;
  bytes raw = 3;
}
message Pixel {
  int32 r = 1;
  int32 g = 2;
  int32 b = 3;
}
message Proximity {
  bool detected   = 1; # Is wall detected or not?
  double distance = 2; # Distance to the wall
}
message Position {
  double x = 1; 
  double y = 2;
  double z = 3;
  double roll  = 4;
  double pitch = 5;
  double yaw   = 6;
  bool gps_enabled = 7;
}

Commands

message Commands {
  repeated Command commands = 1; # List of Commands from Client to Server
}
message Command {
  int32  id       = 1;   # ID of Robot
  double linear   = 2;   # Speed in Linear Direction
  double angular  = 3;   # Speed in Angular Axis
  string  LED      = 4;  # Color of LED
  repeated Action actions = 5; # List of applied actions
}
message Action {
  double x = 1;    # X of Applied Possition 
  double y = 2;    # Y of Applied Possition 
  double z = 3;    # Z of Applied Possition 
  string type = 4; # Type of Action (Decided by Referee in the rules)
}

Ending

message Ending {
  ServerInfo server = 1; # Final Server Information
}
message Result {
  Image map = 1; # Generated Map by robots
  string message = 2; # Generated Message
}

Share this story:

Write a comment