Skip to content

[Feature request]: Add idle robot preferred option in Task Planning #127

@kjchee

Description

@kjchee

Before proceeding, is there an existing issue or discussion for this?

Description

In some deployments, users prefer to see all robots moving rather than just a handful handling all tasks. What user asked is that: why i have 5 robots, and I always see 1 of it working? Then the rest (idle robots) just sits in charger will full battery charged.

Example Scenario:

  • Multiple tasks have end waypoints close to each other.
  • The planner repeatedly assigns all these tasks to the same “fastest” robot because it minimizes finish time.
  • This robot ends up handling the majority of the work, draining its battery quickly, while other robots remain idle with full battery for extended periods.

Implementation Considerations

I’ve implemented an Idle Robot Preferred option, which allows the task planner to prioritize idle robots during node expansion.
Currently, node expansion selects the best candidate purely based on the shortest estimated finish time. With this new option enabled, the planner will first look for idle robots (robots with no task on hand before entering task planning) when assigning unassigned tasks during node expansion.

This behavior is configurable at the fleet level (a parameter in fleet config), since not every deployment requires this strategy — most still prefer the default shortest-finish-time approach.

Core changes:

  • The main changes is in TaskPlanner.cpp, inside expand().
  • If the idle robot preferred flag is enabled, the planner will:
    • While looping over unassigned tasks, choose an idle robot if possible.
    • The idle status is determined in TaskManager.cpp and passed into the planner as part of each robot’s initial state.
    • If no idle robot, or all robots are idle, or all robots are busy, the planner falls back to the default strategy — selecting the best candidate based on shortest estimated finish time.

Alternatives

No response

Additional information

Initially, I considered adding a LoadBalancingCostCalculator on top of the idle robot preferred layer to adjust cost calculations, or possibly introduce a penalty when task assignments are unbalanced (e.g., one robot got assigned multiple tasks while others got none).

However, I realized that RMF already has a built-in task reassignment mechanism, controlled by reassign_task_interval. With idle robot preferred enabled, every time this interval elapses, RMF will replan task assignments and allocate available tasks to idle robots. This means the system already self-corrects imbalances over time, and this additional load-balancing mechanism is unnecessary.

So, solely with the idle robot preferred option in task planning will b good enough.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions