Function rpc_api::getRobotsLocation#

Function Documentation#

string rpc_api::getRobotsLocation()

Get the latest MAPF instance, newly finished task IDs, and initialization status.

Returns:

A JSON string with the following schema.

{
  "initialized": true,
  "mapf_instance": {
    "starts": [ State, ... ],
    "goals":  [ [ Task, ... ], ... ]
  },
  "new_finished_tasks": [ 0, 1, 2, 3 ]
}
  • initialized indicates whether the system has completed initialization.

  • mapf_instance contains the current MAPF problem state:

    • starts is a list of State objects describing the current start states of all agents:

      • Each State has the structure:

        {
          "location": 42,
          "timestep": 10,
          "orientation": 1
        }
        

      • location is the flattened cell ID.

      • timestep is the start timestep, usually 0.

      • orientation is encoded as:

        • 0: East

        • 1: North

        • 2: West

        • 3: South

    • goals is a list of task lists, where each task list corresponds to a robot:

      • Each Task object has the structure:

        {
          "id": 0,
          "location": 84,
          "task_wait_time": 0,
          "orientation": -1
        }
        

      • id is the unique task identifier.

      • location is the flattened cell ID of the task location.

      • task_wait_time is the number of timesteps the agent should wait at the task location, usually 0.

      • orientation is the required orientation at the task location, with -1 indicating no constraint.

  • new_finished_tasks is a list of task IDs completed since the last query.